Skip to content

Commit 145cad3

Browse files
committed
fix adventure game command
1 parent 2c5ab4c commit 145cad3

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"scripts": {
5555
"prepare": "npm run build",
5656
"fetch:spec-types": "curl -o spec.types.ts https://raw.githubusercontent.com/modelcontextprotocol/modelcontextprotocol/refs/heads/main/schema/draft/schema.ts",
57-
"build": "npm run build:esm && npm run build:cjs && npm run build:backfill-sampling && npm run build:example-local-researcher",
57+
"build": "npm run build:esm && npm run build:cjs && npm run build:backfill-sampling && npm run build:example-local-researcher && npm run build:example-adventure-game",
5858
"build:esm": "mkdir -p dist/esm && echo '{\"type\": \"module\"}' > dist/esm/package.json && tsc -p tsconfig.prod.json",
5959
"build:esm:w": "npm run build:esm -- -w",
6060
"build:cjs": "mkdir -p dist/cjs && echo '{\"type\": \"commonjs\"}' > dist/cjs/package.json && tsc -p tsconfig.cjs.json",

src/examples/server/adventureGame.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,12 @@
1111
npx -y --silent tsx src/examples/backfill/backfillSampling.ts \
1212
npx -y --silent tsx src/examples/server/adventureGame.ts
1313
14-
# Or dockerized:
15-
rm -fR node_modules
16-
docker run --rm -v $PWD:/src -w /src node:latest npm i
14+
# Or dockerized, without cloning this repo:
15+
export SEP1577_PACKAGE="git://github.com/modelcontextprotocol/typescript-sdk.git#ochafik/sep1577"
1716
npx -y @modelcontextprotocol/inspector -- \
18-
docker run --rm -i -e ANTHROPIC_API_KEY="${ANTHROPIC_API_KEY}" \
19-
-v $PWD:/src -w /src \
20-
$( echo "
21-
FROM node:latest
22-
RUN apt update && apt install ripgrep
23-
" | docker build -q -f - . ) \
24-
npm run --silent examples:adventure-game
17+
docker run --rm -i -e ANTHROPIC_API_KEY="${ANTHROPIC_API_KEY}" node:latest \
18+
npx -y --silent "'--package=$SEP1577_PACKAGE'" -- backfill-sampling \
19+
npx -y --silent "'--package=$SEP1577_PACKAGE'" -- example-adventure-game
2520
2621
Then connect with an MCP client and call the "localResearch" tool with a query like:
2722
"Find all TypeScript files that export a Server class"

0 commit comments

Comments
 (0)