Skip to content

Commit f70f969

Browse files
Merge branch 'main' into fix/roots-list
2 parents 47f27a2 + 7ba58da commit f70f969

48 files changed

Lines changed: 1257 additions & 217 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/fast-dragons-lead.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@modelcontextprotocol/express': patch
3+
'@modelcontextprotocol/fastify': patch
4+
'@modelcontextprotocol/hono': patch
5+
'@modelcontextprotocol/node': patch
6+
'@modelcontextprotocol/client': patch
7+
'@modelcontextprotocol/server': patch
8+
---
9+
10+
tsdown exports resolution fix
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+
Prevent stack overflow in StreamableHTTPServerTransport.close() with re-entrant guard

.changeset/odd-forks-enjoy.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"@modelcontextprotocol/client": patch
3+
---
4+
5+
fix(client): append custom Accept headers to spec-required defaults in StreamableHTTPClientTransport
6+
7+
Custom Accept headers provided via `requestInit.headers` are now appended to the spec-mandated Accept types instead of being overwritten. This ensures the required media types (`application/json, text/event-stream` for POST; `text/event-stream` for GET SSE) are always present while allowing users to include additional types for proxy/gateway routing.

.changeset/pre.json

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,48 @@
2121
"@modelcontextprotocol/test-helpers": "2.0.0-alpha.0",
2222
"@modelcontextprotocol/test-integration": "2.0.0-alpha.0"
2323
},
24-
"changesets": []
24+
"changesets": [
25+
"abort-handlers-on-close",
26+
"add-fastify-middleware",
27+
"add-hono-peer-dep",
28+
"add-resource-size-field",
29+
"brave-lions-glow",
30+
"busy-rice-smoke",
31+
"busy-weeks-hang",
32+
"cyan-cycles-pump",
33+
"drop-zod-peer-dep",
34+
"expose-auth-server-discovery",
35+
"extract-task-manager",
36+
"fast-dragons-lead",
37+
"finish-sdkerror-capability",
38+
"fix-abort-listener-leak",
39+
"fix-oauth-5xx-discovery",
40+
"fix-onerror-callbacks",
41+
"fix-server-protocol-version",
42+
"fix-session-status-codes",
43+
"fix-stdio-epipe-crash",
44+
"fix-stdio-windows-hide",
45+
"fix-streamable-http-error-response",
46+
"fix-task-session-isolation",
47+
"fix-transport-exact-optional-property-types",
48+
"fix-unknown-tool-protocol-error",
49+
"funky-baths-attack",
50+
"heavy-walls-swim",
51+
"oauth-error-http200",
52+
"quick-islands-occur",
53+
"reconnection-scheduler",
54+
"remove-websocket-transport",
55+
"respect-capability-negotiation",
56+
"rich-hounds-report",
57+
"schema-object-type-for-unions",
58+
"shy-times-learn",
59+
"spotty-cats-tickle",
60+
"stdio-skip-non-json",
61+
"support-standard-json-schema",
62+
"tame-camels-greet",
63+
"tender-snails-fold",
64+
"token-provider-composable-auth",
65+
"twelve-dodos-taste",
66+
"use-scopes-supported-in-dcr"
67+
]
2568
}
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+
Allow additional JSON Schema properties in elicitInput's requestedSchema type by adding .catchall(z.unknown()), matching the pattern used by inputSchema. This fixes type incompatibility when using Zod v4's .toJSONSchema() output which includes extra properties like $schema and additionalProperties.

.github/workflows/release.yml

Lines changed: 43 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
name: Release
22

3-
permissions:
4-
contents: write
5-
pull-requests: write
6-
73
on:
84
push:
95
branches:
@@ -12,9 +8,14 @@ on:
128
concurrency: ${{ github.workflow }}-${{ github.ref }}
139

1410
jobs:
15-
release:
16-
name: Release
11+
version:
12+
name: Version
1713
runs-on: ubuntu-latest
14+
permissions:
15+
contents: write
16+
pull-requests: write
17+
outputs:
18+
hasChangesets: ${{ steps.changesets.outputs.hasChangesets }}
1819
steps:
1920
- uses: actions/checkout@v6
2021

@@ -29,17 +30,50 @@ jobs:
2930
node-version: 24
3031
cache: pnpm
3132
cache-dependency-path: pnpm-lock.yaml
32-
registry-url: 'https://registry.npmjs.org'
3333

3434
- name: Install dependencies
3535
run: pnpm install
3636

37-
- name: Create Release Pull Request or Publish to npm
37+
- name: Create or update Version Packages PR
3838
id: changesets
39+
uses: changesets/action@6a0a831ff30acef54f2c6aa1cbbc1096b066edaf # v1
40+
env:
41+
GITHUB_TOKEN: ${{ github.token }}
42+
43+
publish:
44+
name: Publish
45+
needs: version
46+
if: needs.version.outputs.hasChangesets == 'false'
47+
runs-on: ubuntu-latest
48+
environment: release
49+
permissions:
50+
contents: write
51+
id-token: write
52+
steps:
53+
- uses: actions/checkout@v6
54+
55+
- name: Install pnpm
56+
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
57+
with:
58+
run_install: false
59+
60+
- name: Setup Node.js
61+
uses: actions/setup-node@v6
62+
with:
63+
node-version: 24
64+
cache: pnpm
65+
cache-dependency-path: pnpm-lock.yaml
66+
registry-url: 'https://registry.npmjs.org'
67+
68+
- name: Install dependencies
69+
run: pnpm install
70+
71+
- name: Publish to npm
3972
uses: changesets/action@6a0a831ff30acef54f2c6aa1cbbc1096b066edaf # v1
4073
with:
41-
publish: pnpm run build:all && pnpm changeset publish
74+
publish: pnpm run ci:publish
4275
env:
4376
GITHUB_TOKEN: ${{ github.token }}
4477
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
4578
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
79+
NPM_CONFIG_PROVENANCE: 'true'

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ Next steps:
135135
## Documentation
136136

137137
- Local SDK docs:
138-
- [docs/server.md](docs/server.md) – building MCP servers, transports, tools/resources/prompts, sampling, elicitation, tasks, and deployment patterns.
138+
- [docs/server.md](docs/server.md) – building MCP servers: transports, tools, resources, prompts, server-initiated requests, and deployment
139139
- [docs/client.md](docs/client.md) – building MCP clients: connecting, tools, resources, prompts, server-initiated requests, and error handling
140140
- [docs/faq.md](docs/faq.md) – frequently asked questions and troubleshooting
141141
- External references:

docs/documents.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ children:
1111
# Documents
1212

1313
- [Server Quickstart](./server-quickstart.md) – build a weather server from scratch and connect it to VS Code
14-
- [Server](./server.md) – building MCP servers, transports, tools/resources/prompts, sampling, elicitation, tasks, and deployment patterns
14+
- [Server](./server.md) – building MCP servers: transports, tools, resources, prompts, server-initiated requests, and deployment
1515
- [Client Quickstart](./client-quickstart.md) – build an LLM-powered chatbot that connects to an MCP server and calls its tools
1616
- [Client](./client.md) – building MCP clients: connecting, tools, resources, prompts, server-initiated requests, and error handling
1717
- [FAQ](./faq.md) – frequently asked questions and troubleshooting

docs/migration-SKILL.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,10 @@ new McpServer(
480480
new McpServer({ name: 'server', version: '1.0.0' }, {});
481481
```
482482

483-
Access validators via `_shims` export: `import { DefaultJsonSchemaValidator } from '@modelcontextprotocol/server/_shims';`
483+
Access validators explicitly:
484+
- Runtime-aware default: `import { DefaultJsonSchemaValidator } from '@modelcontextprotocol/server/_shims';`
485+
- AJV (Node.js): `import { AjvJsonSchemaValidator } from '@modelcontextprotocol/server';`
486+
- CF Worker: `import { CfWorkerJsonSchemaValidator } from '@modelcontextprotocol/server/validators/cf-worker';`
484487

485488
## 15. Migration Steps (apply in this order)
486489

docs/migration.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,8 @@ This means Cloudflare Workers users no longer need to explicitly pass the valida
835835
**Before (v1) - Cloudflare Workers required explicit configuration:**
836836

837837
```typescript
838-
import { McpServer, CfWorkerJsonSchemaValidator } from '@modelcontextprotocol/server';
838+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
839+
import { CfWorkerJsonSchemaValidator } from '@modelcontextprotocol/sdk/validation/cfworker';
839840

840841
const server = new McpServer(
841842
{ name: 'my-server', version: '1.0.0' },
@@ -858,12 +859,15 @@ const server = new McpServer(
858859
);
859860
```
860861

861-
You can still explicitly override the validator if needed. The validators are available via the `_shims` export:
862+
You can still explicitly override the validator if needed:
862863

863864
```typescript
865+
// Runtime-aware default (auto-selects AjvJsonSchemaValidator or CfWorkerJsonSchemaValidator)
864866
import { DefaultJsonSchemaValidator } from '@modelcontextprotocol/server/_shims';
865-
// or
866-
import { AjvJsonSchemaValidator, CfWorkerJsonSchemaValidator } from '@modelcontextprotocol/server';
867+
868+
// Specific validators
869+
import { AjvJsonSchemaValidator } from '@modelcontextprotocol/server';
870+
import { CfWorkerJsonSchemaValidator } from '@modelcontextprotocol/server/validators/cf-worker';
867871
```
868872

869873
## Unchanged APIs

0 commit comments

Comments
 (0)