Skip to content

Commit 016c08f

Browse files
Merge branch 'main' into feat/auth-test-server
Resolved conflicts: - Moved auth-test-server.ts to test/conformance/src/authTestServer.ts (following the src/conformance -> test/conformance restructure) - Updated imports to use NodeStreamableHTTPServerTransport from @modelcontextprotocol/node and isInitializeRequest from @modelcontextprotocol/server - Inlined bearer auth middleware since requireBearerAuth was moved to examples-shared (demo-only code) - Updated inputSchema to use z.object() wrapper for zod/v4 - Updated README paths
2 parents e9377fb + a7c7896 commit 016c08f

File tree

227 files changed

+20570
-12800
lines changed

Some content is hidden

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

227 files changed

+20570
-12800
lines changed

.changeset/add-hono-peer-dep.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@modelcontextprotocol/node': patch
3+
---
4+
5+
Add missing `hono` peer dependency to `@modelcontextprotocol/node`. The package already depends on `@hono/node-server` which requires `hono` at runtime, but `hono` was only listed in the workspace root, not as a peer dependency of the package itself.

.changeset/config.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,11 @@
77
"access": "public",
88
"baseBranch": "main",
99
"updateInternalDependencies": "patch",
10-
"ignore": ["@modelcontextprotocol/examples-client", "@modelcontextprotocol/examples-server", "@modelcontextprotocol/examples-shared"]
10+
"ignore": [
11+
"@modelcontextprotocol/examples-client",
12+
"@modelcontextprotocol/examples-client-quickstart",
13+
"@modelcontextprotocol/examples-server",
14+
"@modelcontextprotocol/examples-server-quickstart",
15+
"@modelcontextprotocol/examples-shared"
16+
]
1117
}
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+
Add `discoverOAuthServerInfo()` function and unified discovery state caching for OAuth
6+
7+
- New `discoverOAuthServerInfo(serverUrl)` export that performs RFC 9728 protected resource metadata discovery followed by authorization server metadata discovery in a single call. Use this for operations like token refresh and revocation that need the authorization server URL outside of `auth()`.
8+
- New `OAuthDiscoveryState` type and optional `OAuthClientProvider` methods `saveDiscoveryState()` / `discoveryState()` allow providers to persist all discovery results (auth server URL, resource metadata URL, resource metadata, auth server metadata) across sessions. This avoids redundant discovery requests and handles browser redirect scenarios where discovery state would otherwise be lost.
9+
- New `'discovery'` scope for `invalidateCredentials()` to clear cached discovery state.
10+
- New `OAuthServerInfo` type exported for the return value of `discoverOAuthServerInfo()`.
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+
Fix InMemoryTaskStore to enforce session isolation. Previously, sessionId was accepted but ignored on all TaskStore methods, allowing any session to enumerate, read, and mutate tasks created by other sessions. The store now persists sessionId at creation time and enforces ownership on all reads and writes.
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/oauth-error-http200.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 OAuth error handling for servers returning errors with HTTP 200 status
6+
7+
Some OAuth servers (e.g., GitHub) return error responses with HTTP 200 status instead of 4xx. The SDK now checks for an `error` field in the JSON response before attempting to parse it as tokens, providing users with meaningful error messages.

.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
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@modelcontextprotocol/client': patch
3+
---
4+
5+
Respect capability negotiation in list methods by returning empty lists when server lacks capability
6+
7+
The Client now returns empty lists instead of sending requests to servers that don't advertise the corresponding capability:
8+
9+
- `listPrompts()` returns `{ prompts: [] }` if server lacks prompts capability
10+
- `listResources()` returns `{ resources: [] }` if server lacks resources capability
11+
- `listResourceTemplates()` returns `{ resourceTemplates: [] }` if server lacks resources capability
12+
- `listTools()` returns `{ tools: [] }` if server lacks tools capability
13+
14+
This respects the MCP spec requirement that "Both parties SHOULD respect capability negotiation" and avoids unnecessary server warnings and traffic. The existing `enforceStrictCapabilities` option continues to throw errors when set to `true`.

.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).

0 commit comments

Comments
 (0)