Skip to content

Commit ad00cfa

Browse files
Merge branch 'main' into fweinberger/elicit-schema-catchall
2 parents c027998 + babaa50 commit ad00cfa

50 files changed

Lines changed: 1498 additions & 133 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@modelcontextprotocol/fastify': minor
3+
---
4+
5+
Add Fastify middleware adapter for MCP servers, following the same pattern as the Express and Hono adapters.

.changeset/drop-zod-peer-dep.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
'@modelcontextprotocol/client': patch
3+
'@modelcontextprotocol/server': patch
4+
---
5+
6+
Drop `zod` from `peerDependencies` (kept as direct dependency)
7+
8+
Since Standard Schema support landed, `zod` is purely an internal runtime dependency used for protocol message parsing. User-facing schemas (`registerTool`, `registerPrompt`) accept any Standard Schema library. `zod` remains in `dependencies` and auto-installs; users no longer
9+
need to install it alongside the SDK.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@modelcontextprotocol/core': patch
3+
---
4+
5+
Consolidate per-request cleanup in `_requestWithSchema` into a single `.finally()` block. This fixes an abort signal listener leak (listeners accumulated when a caller reused one `AbortSignal` across requests) and two cases where `_responseHandlers` entries leaked on send-failure paths.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@modelcontextprotocol/server': patch
3+
---
4+
5+
fix(server): propagate negotiated protocol version to transport in _oninitialize
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@modelcontextprotocol/client': patch
3+
---
4+
5+
Fix StreamableHTTPClientTransport to handle error responses in SSE streams

.changeset/pre.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"mode": "pre",
3+
"tag": "alpha",
4+
"initialVersions": {
5+
"@modelcontextprotocol/eslint-config": "2.0.0",
6+
"@modelcontextprotocol/tsconfig": "2.0.0",
7+
"@modelcontextprotocol/vitest-config": "2.0.0",
8+
"@modelcontextprotocol/examples-client": "2.0.0-alpha.0",
9+
"@modelcontextprotocol/examples-client-quickstart": "2.0.0-alpha.0",
10+
"@modelcontextprotocol/examples-server": "2.0.0-alpha.0",
11+
"@modelcontextprotocol/examples-server-quickstart": "2.0.0-alpha.0",
12+
"@modelcontextprotocol/examples-shared": "2.0.0-alpha.0",
13+
"@modelcontextprotocol/client": "2.0.0-alpha.0",
14+
"@modelcontextprotocol/core": "2.0.0-alpha.0",
15+
"@modelcontextprotocol/express": "2.0.0-alpha.0",
16+
"@modelcontextprotocol/fastify": "2.0.0-alpha.0",
17+
"@modelcontextprotocol/hono": "2.0.0-alpha.0",
18+
"@modelcontextprotocol/node": "2.0.0-alpha.0",
19+
"@modelcontextprotocol/server": "2.0.0-alpha.0",
20+
"@modelcontextprotocol/test-conformance": "2.0.0-alpha.0",
21+
"@modelcontextprotocol/test-helpers": "2.0.0-alpha.0",
22+
"@modelcontextprotocol/test-integration": "2.0.0-alpha.0"
23+
},
24+
"changesets": []
25+
}

.github/workflows/main.yml

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ on:
44
- main
55
pull_request:
66
workflow_dispatch:
7-
release:
8-
types: [published]
97

108
concurrency:
119
group: ${{ github.workflow }}-${{ github.ref }}
@@ -94,53 +92,3 @@ jobs:
9492
- name: Run ${{ matrix.runtime }} integration tests
9593
run: pnpm --filter @modelcontextprotocol/test-integration test:integration:${{ matrix.runtime }}
9694

97-
publish:
98-
runs-on: ubuntu-latest
99-
if: github.event_name == 'release'
100-
environment: release
101-
needs: [build, test, test-runtimes]
102-
103-
permissions:
104-
contents: read
105-
id-token: write
106-
107-
steps:
108-
- uses: actions/checkout@v6
109-
110-
- name: Install pnpm
111-
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
112-
id: pnpm-install
113-
with:
114-
run_install: false
115-
- uses: actions/setup-node@v6
116-
with:
117-
node-version: 24
118-
cache: pnpm
119-
cache-dependency-path: pnpm-lock.yaml
120-
registry-url: 'https://registry.npmjs.org'
121-
- run: pnpm install
122-
123-
- name: Determine npm tag
124-
id: npm-tag
125-
run: |
126-
VERSION=$(node -p "require('./package.json').version")
127-
# Check if this is a beta release
128-
if [[ "$VERSION" == *"-beta"* ]]; then
129-
echo "tag=--tag beta" >> $GITHUB_OUTPUT
130-
# Check if this release is from a non-primary branch (patch/maintenance release)
131-
elif [[ "${{ github.event.release.target_commitish }}" != "main" && "${{ github.event.release.target_commitish }}" != "v1.x" ]]; then
132-
# Use "release-X.Y" as tag for old branch releases (e.g., "release-1.23" for 1.23.x)
133-
# npm tags are mutable pointers to versions (like "latest" pointing to 1.24.3).
134-
# Using "release-1.23" means users can `npm install @modelcontextprotocol/sdk@release-1.23`
135-
# to get the latest patch on that minor version, and the tag updates if we
136-
# release 1.23.2, 1.23.3, etc.
137-
# Note: Can't use "v1.23" because npm rejects tags that look like semver ranges.
138-
MAJOR_MINOR=$(echo "$VERSION" | cut -d. -f1,2)
139-
echo "tag=--tag release-${MAJOR_MINOR}" >> $GITHUB_OUTPUT
140-
else
141-
echo "tag=" >> $GITHUB_OUTPUT
142-
fi
143-
144-
- run: pnpm publish --provenance --access public ${{ steps.npm-tag.outputs.tag }}
145-
env:
146-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ jobs:
4040
- name: Publish preview packages
4141
run:
4242
pnpm dlx pkg-pr-new publish --packageManager=npm --pnpm './packages/server' './packages/client'
43-
'./packages/middleware/express' './packages/middleware/hono' './packages/middleware/node'
43+
'./packages/middleware/express' './packages/middleware/fastify' './packages/middleware/hono' './packages/middleware/node'

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ When a request arrives from the remote side:
164164
3. **`Protocol._onrequest()`**:
165165
- Looks up handler in `_requestHandlers` map (keyed by method name)
166166
- Creates `BaseContext` with `signal`, `sessionId`, `sendNotification`, `sendRequest`, etc.
167-
- Calls `buildContext()` to let subclasses enrich the context (e.g., Server adds `requestInfo`)
167+
- Calls `buildContext()` to let subclasses enrich the context (e.g., Server adds HTTP request info)
168168
- Invokes handler, sends JSON-RPC response back via transport
169169
4. **Handler** was registered via `setRequestHandler('method', handler)`
170170

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ This monorepo publishes split packages:
3939
- **`@modelcontextprotocol/server`**: build MCP servers
4040
- **`@modelcontextprotocol/client`**: build MCP clients
4141

42-
Both packages have a **required peer dependency** on `zod` for schema validation. The SDK uses Zod v4.
42+
Tool and prompt schemas use [Standard Schema](https://standardschema.dev/) — bring Zod v4, Valibot, ArkType, or any compatible library.
4343

4444
### Middleware packages (optional)
4545

@@ -56,21 +56,21 @@ They are intentionally thin adapters: they should not introduce new MCP function
5656
### Server
5757

5858
```bash
59-
npm install @modelcontextprotocol/server zod
59+
npm install @modelcontextprotocol/server
6060
# or
61-
bun add @modelcontextprotocol/server zod
61+
bun add @modelcontextprotocol/server
6262
# or
63-
deno add npm:@modelcontextprotocol/server npm:zod
63+
deno add npm:@modelcontextprotocol/server
6464
```
6565

6666
### Client
6767

6868
```bash
69-
npm install @modelcontextprotocol/client zod
69+
npm install @modelcontextprotocol/client
7070
# or
71-
bun add @modelcontextprotocol/client zod
71+
bun add @modelcontextprotocol/client
7272
# or
73-
deno add npm:@modelcontextprotocol/client npm:zod
73+
deno add npm:@modelcontextprotocol/client
7474
```
7575

7676
### Optional middleware packages
@@ -157,7 +157,8 @@ The `docs:multi` script checks out both the `v1.x` and `main` branches via git w
157157

158158
## v1 (legacy) documentation and fixes
159159

160-
If you are using the **v1** generation of the SDK, the **v1 API documentation** is available at [`https://ts.sdk.modelcontextprotocol.io/`](https://ts.sdk.modelcontextprotocol.io/). The v1 source code and any v1-specific fixes live on the long-lived [`v1.x` branch](https://github.com/modelcontextprotocol/typescript-sdk/tree/v1.x). V2 API docs are at [`/v2/`](https://ts.sdk.modelcontextprotocol.io/v2/).
160+
If you are using the **v1** generation of the SDK, the **v1 API documentation** is available at [`https://ts.sdk.modelcontextprotocol.io/`](https://ts.sdk.modelcontextprotocol.io/). The v1 source code and any v1-specific fixes live on the long-lived
161+
[`v1.x` branch](https://github.com/modelcontextprotocol/typescript-sdk/tree/v1.x). V2 API docs are at [`/v2/`](https://ts.sdk.modelcontextprotocol.io/v2/).
161162

162163
## Contributing
163164

0 commit comments

Comments
 (0)