Skip to content

Commit 5af5343

Browse files
Merge branch 'main' into fix/bug-015-cors-retry-masks-errors
2 parents b8a2e61 + 0784be1 commit 5af5343

File tree

118 files changed

+7069
-8341
lines changed

Some content is hidden

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

118 files changed

+7069
-8341
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
"@modelcontextprotocol/core": minor
3+
"@modelcontextprotocol/server": major
4+
---
5+
6+
Fix error handling for unknown tools and resources per MCP spec.
7+
8+
**Tools:** Unknown or disabled tool calls now return JSON-RPC protocol errors with
9+
code `-32602` (InvalidParams) instead of `CallToolResult` with `isError: true`.
10+
Callers who checked `result.isError` for unknown tools should catch rejected promises instead.
11+
12+
**Resources:** Unknown resource reads now return error code `-32002` (ResourceNotFound)
13+
instead of `-32602` (InvalidParams).
14+
15+
Added `ProtocolErrorCode.ResourceNotFound`.

.changeset/quick-islands-occur.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/hono': patch
4+
'@modelcontextprotocol/node': patch
5+
'@modelcontextprotocol/client': patch
6+
'@modelcontextprotocol/server': patch
7+
'@modelcontextprotocol/core': patch
8+
---
9+
10+
remove npm references, use pnpm

.changeset/rich-hounds-report.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/hono': patch
4+
'@modelcontextprotocol/node': patch
5+
'@modelcontextprotocol/client': patch
6+
'@modelcontextprotocol/server': patch
7+
'@modelcontextprotocol/core': patch
8+
---
9+
10+
clean up package manager usage, all pnpm
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
'@modelcontextprotocol/core': minor
3+
'@modelcontextprotocol/server': minor
4+
'@modelcontextprotocol/client': minor
5+
---
6+
7+
Support Standard Schema for tool and prompt schemas
8+
9+
Tool and prompt registration now accepts any schema library that implements the [Standard Schema spec](https://standardschema.dev/): Zod v4, Valibot, ArkType, and others. `RegisteredTool.inputSchema`, `RegisteredTool.outputSchema`, and `RegisteredPrompt.argsSchema` now use `StandardSchemaWithJSON` (requires both `~standard.validate` and `~standard.jsonSchema`) instead of the Zod-specific `AnySchema` type.
10+
11+
**Zod v4 schemas continue to work unchanged** — Zod v4 implements the required interfaces natively.
12+
13+
```typescript
14+
import { type } from 'arktype';
15+
16+
server.registerTool('greet', {
17+
inputSchema: type({ name: 'string' })
18+
}, async ({ name }) => ({ content: [{ type: 'text', text: `Hello, ${name}!` }] }));
19+
```
20+
21+
For raw JSON Schema (e.g. TypeBox output), use the new `fromJsonSchema` adapter:
22+
23+
```typescript
24+
import { fromJsonSchema, AjvJsonSchemaValidator } from '@modelcontextprotocol/core';
25+
26+
server.registerTool('greet', {
27+
inputSchema: fromJsonSchema({ type: 'object', properties: { name: { type: 'string' } } }, new AjvJsonSchemaValidator())
28+
}, handler);
29+
```
30+
31+
**Breaking changes:**
32+
- `experimental.tasks.getTaskResult()` no longer accepts a `resultSchema` parameter. Returns `GetTaskPayloadResult` (a loose `Result`); cast to the expected type at the call site.
33+
- Removed unused exports from `@modelcontextprotocol/core`: `SchemaInput`, `schemaToJson`, `parseSchemaAsync`, `getSchemaShape`, `getSchemaDescription`, `isOptionalSchema`, `unwrapOptionalSchema`. Use the new `standardSchemaToJsonSchema` and `validateStandardSchema` instead.
34+
- `completable()` remains Zod-specific (it relies on Zod's `.shape` introspection).

.changeset/twelve-dodos-taste.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@modelcontextprotocol/express": patch
3+
---
4+
5+
Add jsonLimit option to createMcpExpressApp
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@modelcontextprotocol/client': minor
3+
---
4+
5+
Apply resolved scope consistently to both DCR and the authorization URL (SEP-835)
6+
7+
When `scopes_supported` is present in the protected resource metadata (`/.well-known/oauth-protected-resource`), the SDK already uses it as the default scope for the authorization URL. This change applies the same resolved scope to the dynamic client registration request body, ensuring both use a consistent value.
8+
9+
- `registerClient()` now accepts an optional `scope` parameter that overrides `clientMetadata.scope` in the registration body.
10+
- `auth()` now computes the resolved scope once (WWW-Authenticate → PRM `scopes_supported``clientMetadata.scope`) and passes it to both DCR and the authorization request.

.gitattributes

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/pages/_config.yml

Lines changed: 0 additions & 5 deletions
This file was deleted.

.github/pages/index.html

Lines changed: 0 additions & 183 deletions
This file was deleted.

.github/workflows/deploy-docs.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Deploy Docs
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- v1.x
8+
workflow_dispatch:
9+
10+
concurrency:
11+
group: deploy-docs
12+
cancel-in-progress: true
13+
14+
jobs:
15+
deploy-docs:
16+
runs-on: ubuntu-latest
17+
18+
permissions:
19+
contents: read
20+
pages: write
21+
id-token: write
22+
23+
environment:
24+
name: github-pages
25+
url: ${{ steps.deployment.outputs.page_url }}
26+
27+
steps:
28+
- uses: actions/checkout@v4
29+
30+
- name: Install pnpm
31+
uses: pnpm/action-setup@v4
32+
with:
33+
run_install: false
34+
- uses: actions/setup-node@v4
35+
with:
36+
node-version: 24
37+
cache: pnpm
38+
cache-dependency-path: pnpm-lock.yaml
39+
40+
- name: Generate multi-version docs
41+
run: bash scripts/generate-multidoc.sh tmp/docs-combined
42+
43+
- name: Configure Pages
44+
uses: actions/configure-pages@v5
45+
46+
- name: Upload Pages artifact
47+
uses: actions/upload-pages-artifact@v3
48+
with:
49+
path: tmp/docs-combined
50+
51+
- name: Deploy to GitHub Pages
52+
id: deployment
53+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)