Skip to content

Commit b60b516

Browse files
committed
update run setup
1 parent 459a66c commit b60b516

File tree

3 files changed

+11
-25
lines changed

3 files changed

+11
-25
lines changed

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@
5959
"build:cjs": "mkdir -p dist/cjs && echo '{\"type\": \"commonjs\"}' > dist/cjs/package.json && tsc -p tsconfig.cjs.json",
6060
"build:cjs:w": "npm run build:cjs -- -w",
6161
"examples:simple-server:w": "tsx --watch src/examples/server/simpleStreamableHttp.ts --oauth",
62-
"examples:tool-loop": "tsx examples/backfill/backfillSampling.ts tsx examples/server/toolLoopSampling.ts",
63-
"build:backfill-sampling": "bun build examples/backfill/backfillSampling.ts --outdir=dist --banner '#!/usr/bin/env node' --target=node --minify && shx chmod +x dist/backfillSampling.js",
64-
"build:example-tool-loop": "bun build examples/server/toolLoopSampling.ts --outdir=dist --banner '#!/usr/bin/env node' --target=node --minify && shx chmod +x dist/toolLoopSampling.js",
62+
"examples:tool-loop": "tsx src/examples/backfill/backfillSampling.ts tsx src/examples/server/toolLoopSampling.ts",
63+
"build:backfill-sampling": "bun build src/examples/backfill/backfillSampling.ts --outdir=dist --banner '#!/usr/bin/env node' --target=node --minify && shx chmod +x dist/backfillSampling.js",
64+
"build:example-tool-loop": "bun build src/examples/server/toolLoopSampling.ts --outdir=dist --banner '#!/usr/bin/env node' --target=node --minify && shx chmod +x dist/toolLoopSampling.js",
6565
"prepack": "npm run build:esm && npm run build:cjs",
6666
"lint": "eslint src/",
6767
"test": "npm run fetch:spec-types && jest",
@@ -97,6 +97,7 @@
9797
"@types/node": "^22.0.2",
9898
"@types/supertest": "^6.0.2",
9999
"@types/ws": "^8.5.12",
100+
"bun": "^1.2.23",
100101
"eslint": "^9.8.0",
101102
"jest": "^29.7.0",
102103
"json-schema-to-zod": "^2.6.1",

src/bin/examples-tool-loop.ts

Lines changed: 0 additions & 22 deletions
This file was deleted.

src/examples/server/toolLoopSampling.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@
77
Usage:
88
npx -y @modelcontextprotocol/inspector npm -- --silent run examples:tool-loop
99
10+
# Or dockerized:
11+
rm -fR node_modules
12+
docker run --rm -v $PWD:/src -w /src node:latest npm i
13+
npx -y @modelcontextprotocol/inspector -- \
14+
docker run --rm -i -e ANTHROPIC_API_KEY="${ANTHROPIC_API_KEY}" -v $PWD:/src -w /src node:latest \
15+
npm run --silent examples:tool-loop
16+
1017
Then connect with an MCP client and call the "localResearch" tool with a query like:
1118
"Find all TypeScript files that export a Server class"
1219
*/

0 commit comments

Comments
 (0)