Skip to content

Commit b2347db

Browse files
authored
add npm run dev:sdk to get live sdk changes w/ simple server (#533)
* add `npm run dev:sdk` to get live sdk changes w/ simple server
1 parent c57dc78 commit b2347db

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ client/tsconfig.app.tsbuildinfo
99
client/tsconfig.node.tsbuildinfo
1010
cli/build
1111
test-output
12+
# symlinked by `npm run link:sdk`:
13+
sdk
1214
client/playwright-report/
1315
client/results.json
1416
client/test-results/
15-

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,12 @@ Development mode:
254254

255255
```bash
256256
npm run dev
257+
258+
# To co-develop with the typescript-sdk package (assuming it's cloned in ../typescript-sdk; set MCP_SDK otherwise):
259+
npm run dev:sdk "cd sdk && npm run examples:simple-server:w"
260+
# then open http://localhost:3000/mcp as SHTTP in the inspector.
261+
# To go back to the deployed SDK version:
262+
# npm run unlink:sdk && npm i
257263
```
258264

259265
> **Note for Windows users:**

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
"clean": "rimraf ./node_modules ./client/node_modules ./cli/node_modules ./build ./client/dist ./server/build ./cli/build ./package-lock.json && npm install",
3030
"dev": "node client/bin/start.js --dev",
3131
"dev:windows": "node client/bin/start.js --dev",
32+
"dev:sdk": "npm run link:sdk && concurrently \"npm run dev\" \"cd sdk && npm run build:esm:w\"",
33+
"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",
34+
"unlink:sdk": "(cd sdk && npm unlink -g) && rm sdk && npm unlink @modelcontextprotocol/sdk",
3235
"start": "node client/bin/start.js",
3336
"start-server": "cd server && npm run start",
3437
"start-client": "cd client && npm run preview",

0 commit comments

Comments
 (0)