diff --git a/.gitignore b/.gitignore index 60faf653..f849c43a 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,5 @@ client/tsconfig.app.tsbuildinfo client/tsconfig.node.tsbuildinfo cli/build test-output +# symlinked by `npm run link:sdk`: +sdk diff --git a/README.md b/README.md index 94efe83c..3b0fdc43 100644 --- a/README.md +++ b/README.md @@ -254,6 +254,12 @@ Development mode: ```bash npm run dev + +# To co-develop with the typescript-sdk package (assuming it's cloned in ../typescript-sdk; set MCP_SDK otherwise): +npm run dev:sdk "cd sdk && npm run examples:simple-server:w" +# then open http://localhost:3000/mcp as SHTTP in the inspector. +# To go back to the deployed SDK version: +# npm run unlink:sdk && npm i ``` > **Note for Windows users:** diff --git a/package.json b/package.json index 20c69c2a..cb08fbbf 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,9 @@ "clean": "rimraf ./node_modules ./client/node_modules ./cli/node_modules ./build ./client/dist ./server/build ./cli/build ./package-lock.json && npm install", "dev": "node client/bin/start.js --dev", "dev:windows": "node client/bin/start.js --dev", + "dev:sdk": "npm run link:sdk && concurrently \"npm run dev\" \"cd sdk && npm run build:esm:w\"", + "link:sdk": "(test -d sdk || ln -sf ${MCP_SDK:-$PWD/../typescript-sdk} sdk) && (cd sdk && npm link && (test -d node_modules || npm i)) && npm link @modelcontextprotocol/sdk", + "unlink:sdk": "(cd sdk && npm unlink -g) && rm sdk && npm unlink @modelcontextprotocol/sdk", "start": "node client/bin/start.js", "start-server": "cd server && npm run start", "start-client": "cd client && npm run preview",