conformance/package.json
Paul Carleton 22196ca809
fix: bump SDK to 1.26.0, add session management to tools_call scenario (#134)
* fix: bump SDK to 1.26.0, add session management to tools_call scenario

SDK 1.26.0 made Protocol.connect() throw if already connected to a
transport. The tools_call scenario was calling server.connect(transport)
on every request with the same Server instance, which now throws.

Fixed by adding proper session management: each initialize request
creates a new Server + Transport pair, and subsequent requests are
routed to the correct transport via the mcp-session-id header.

* fix: return 404 for invalid session IDs in tools_call POST handler

The else branch was returning 400 for both missing-session and
invalid/stale-session cases. The MCP spec requires 404 for invalid
session IDs and 400 only for non-initialization requests without
any session ID.

* refactor: keep tools_call stateless, create fresh server per request

Instead of adding session management, simply create a new Server
instance per request. This preserves the original stateless design
while fixing the SDK 1.26.0 Protocol.connect() restriction.
2026-02-05 15:43:21 +00:00

57 lines
1.6 KiB
JSON

{
"name": "@modelcontextprotocol/conformance",
"version": "0.1.12",
"type": "module",
"license": "MIT",
"author": "Anthropic, PBC (https://anthropic.com)",
"homepage": "https://modelcontextprotocol.io",
"bugs": "https://github.com/modelcontextprotocol/conformance/issues",
"repository": {
"type": "git",
"url": "git+https://github.com/modelcontextprotocol/conformance.git"
},
"scripts": {
"start": "tsx src/index.ts",
"test": "vitest run",
"test:watch": "vitest",
"build": "tsdown src/index.ts --minify --clean --target node20",
"lint": "eslint src/ examples/ && prettier --check .",
"lint:fix": "eslint src/ examples/ --fix && prettier --write .",
"lint:fix_check": "npm run lint:fix && git diff --exit-code --quiet",
"check": "npm run typecheck && npm run lint",
"typecheck": "tsgo --noEmit",
"prepack": "npm run build"
},
"files": [
"dist"
],
"bin": {
"conformance": "dist/index.js"
},
"devDependencies": {
"@eslint/js": "^9.39.1",
"@types/express": "^5.0.3",
"@types/node": "^22.10.2",
"@typescript/native-preview": "^7.0.0-dev.20251201.1",
"cors": "^2.8.5",
"eslint": "^9.8.0",
"eslint-config-prettier": "^10.1.8",
"lefthook": "^2.0.2",
"prettier": "3.6.2",
"tsdown": "^0.15.12",
"tsx": "^4.7.0",
"typescript": "^5.5.4",
"typescript-eslint": "8.48.0",
"vitest": "^4.0.16"
},
"dependencies": {
"@modelcontextprotocol/sdk": "^1.26.0",
"commander": "^14.0.2",
"eventsource-parser": "^3.0.6",
"express": "^5.1.0",
"jose": "^6.1.2",
"undici": "^7.19.0",
"yaml": "^2.8.2",
"zod": "^3.25.76"
}
}