Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9,163 changes: 4,589 additions & 4,574 deletions package-lock.json

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
{
"name": "@modelcontextprotocol/sdk",
"version": "1.24.3-mcp-use.1",
"description": "Model Context Protocol implementation for TypeScript",
"name": "@mcp-use/modelcontextprotocol-sdk",
"version": "1.24.3-mcp-use.2",
"description": "MCP TypeScript SDK fork with edge runtime support - maintained by mcp-use",
"license": "MIT",
"publishConfig": {
"access": "public"
},
"author": "Anthropic, PBC (https://anthropic.com)",
"homepage": "https://modelcontextprotocol.io",
"bugs": "https://github.com/modelcontextprotocol/typescript-sdk/issues",
Expand Down
4 changes: 2 additions & 2 deletions src/__fixtures__/zodTestMatrix.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as z3 from 'zod/v3';
import * as z4 from 'zod/v4';
import z3 from 'zod/v3';
import z4 from 'zod/v4';

// Shared Zod namespace type that exposes the common surface area used in tests.
export type ZNamespace = typeof z3 & typeof z4;
Expand Down
2 changes: 1 addition & 1 deletion src/examples/server/jsonResponseStreamableHttp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Request, Response } from 'express';
import { randomUUID } from 'node:crypto';
import { McpServer } from '../../server/mcp.js';
import { StreamableHTTPServerTransport } from '../../server/streamableHttp.js';
import * as z from 'zod/v4';
import z from 'zod/v4';
import { CallToolResult, isInitializeRequest } from '../../types.js';
import { createMcpExpressApp } from '../../server/express.js';

Expand Down
2 changes: 1 addition & 1 deletion src/examples/server/mcpServerOutputSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import { McpServer } from '../../server/mcp.js';
import { StdioServerTransport } from '../../server/stdio.js';
import * as z from 'zod/v4';
import z from 'zod/v4';

const server = new McpServer({
name: 'mcp-output-schema-high-level-example',
Expand Down
2 changes: 1 addition & 1 deletion src/examples/server/simpleSseServer.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Request, Response } from 'express';
import { McpServer } from '../../server/mcp.js';
import { SSEServerTransport } from '../../server/sse.js';
import * as z from 'zod/v4';
import z from 'zod/v4';
import { CallToolResult } from '../../types.js';
import { createMcpExpressApp } from '../../server/express.js';

Expand Down
2 changes: 1 addition & 1 deletion src/examples/server/simpleStatelessStreamableHttp.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Request, Response } from 'express';
import { McpServer } from '../../server/mcp.js';
import { StreamableHTTPServerTransport } from '../../server/streamableHttp.js';
import * as z from 'zod/v4';
import z from 'zod/v4';
import { CallToolResult, GetPromptResult, ReadResourceResult } from '../../types.js';
import { createMcpExpressApp } from '../../server/express.js';

Expand Down
2 changes: 1 addition & 1 deletion src/examples/server/simpleStreamableHttp.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Request, Response } from 'express';
import { randomUUID } from 'node:crypto';
import * as z from 'zod/v4';
import z from 'zod/v4';
import { McpServer } from '../../server/mcp.js';
import { StreamableHTTPServerTransport } from '../../server/streamableHttp.js';
import { getOAuthProtectedResourceMetadataUrl, mcpAuthMetadataRouter } from '../../server/auth/router.js';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { randomUUID } from 'node:crypto';
import { McpServer } from '../../server/mcp.js';
import { StreamableHTTPServerTransport } from '../../server/streamableHttp.js';
import { SSEServerTransport } from '../../server/sse.js';
import * as z from 'zod/v4';
import z from 'zod/v4';
import { CallToolResult, isInitializeRequest } from '../../types.js';
import { InMemoryEventStore } from '../shared/inMemoryEventStore.js';
import { createMcpExpressApp } from '../../server/express.js';
Expand Down
2 changes: 1 addition & 1 deletion src/examples/server/toolWithSampleServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { McpServer } from '../../server/mcp.js';
import { StdioServerTransport } from '../../server/stdio.js';
import * as z from 'zod/v4';
import z from 'zod/v4';

const mcpServer = new McpServer({
name: 'tools-with-sample-server',
Expand Down
2 changes: 1 addition & 1 deletion src/server/auth/handlers/authorize.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { RequestHandler } from 'express';
import * as z from 'zod/v4';
import z from 'zod/v4';
import express from 'express';
import { OAuthServerProvider } from '../provider.js';
import { rateLimit, Options as RateLimitOptions } from 'express-rate-limit';
Expand Down
2 changes: 1 addition & 1 deletion src/server/auth/handlers/token.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as z from 'zod/v4';
import z from 'zod/v4';
import express, { RequestHandler } from 'express';
import { OAuthServerProvider } from '../provider.js';
import cors from 'cors';
Expand Down
2 changes: 1 addition & 1 deletion src/server/auth/middleware/clientAuth.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as z from 'zod/v4';
import z from 'zod/v4';
import { RequestHandler } from 'express';
import { OAuthRegisteredClientsStore } from '../clients.js';
import { OAuthClientInformationFull } from '../../../shared/auth.js';
Expand Down
4 changes: 2 additions & 2 deletions src/server/zod-compat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import type * as z3 from 'zod/v3';
import type * as z4 from 'zod/v4/core';

import * as z3rt from 'zod/v3';
import * as z4mini from 'zod/v4-mini';
import z3rt from 'zod/v3';
import z4mini from 'zod/v4-mini';

// --- Unified schema types ---
export type AnySchema = z3.ZodTypeAny | z4.$ZodType;
Expand Down Expand Up @@ -82,7 +82,7 @@
): { success: true; data: SchemaOutput<S> } | { success: false; error: unknown } {
if (isZ4Schema(schema)) {
// Mini exposes top-level safeParse
const result = z4mini.safeParse(schema, data);

Check failure on line 85 in src/server/zod-compat.ts

View workflow job for this annotation

GitHub Actions / test (18)

test/client/index.test.ts > should initialize with supported older protocol version

TypeError: Cannot read properties of undefined (reading 'safeParse') ❯ safeParse src/server/zod-compat.ts:85:31 ❯ src/shared/protocol.ts:1169:41 ❯ Client._onresponse src/shared/protocol.ts:898:13 ❯ Object._transport.onmessage src/shared/protocol.ts:620:22 ❯ Object.<anonymous> test/client/index.test.ts:262:33 ❯ src/shared/protocol.ts:1218:33 ❯ Client.request src/shared/protocol.ts:1072:16 ❯ Client.connect src/client/index.ts:488:39

Check failure on line 85 in src/server/zod-compat.ts

View workflow job for this annotation

GitHub Actions / test (18)

test/client/index.test.ts > should initialize with matching protocol version

TypeError: Cannot read properties of undefined (reading 'safeParse') ❯ safeParse src/server/zod-compat.ts:85:31 ❯ src/shared/protocol.ts:1169:41 ❯ Client._onresponse src/shared/protocol.ts:898:13 ❯ Object._transport.onmessage src/shared/protocol.ts:620:22 ❯ Object.<anonymous> test/client/index.test.ts:203:33 ❯ src/shared/protocol.ts:1218:33 ❯ Client.request src/shared/protocol.ts:1072:16 ❯ Client.connect src/client/index.ts:488:39

Check failure on line 85 in src/server/zod-compat.ts

View workflow job for this annotation

GitHub Actions / test (24)

test/client/index.test.ts > should initialize with supported older protocol version

TypeError: Cannot read properties of undefined (reading 'safeParse') ❯ safeParse src/server/zod-compat.ts:85:31 ❯ src/shared/protocol.ts:1169:41 ❯ Client._onresponse src/shared/protocol.ts:898:13 ❯ Object._transport.onmessage src/shared/protocol.ts:620:22 ❯ Object.<anonymous> test/client/index.test.ts:262:33 ❯ src/shared/protocol.ts:1218:33 ❯ Client.request src/shared/protocol.ts:1072:16 ❯ Client.connect src/client/index.ts:488:39

Check failure on line 85 in src/server/zod-compat.ts

View workflow job for this annotation

GitHub Actions / test (24)

test/client/index.test.ts > should initialize with matching protocol version

TypeError: Cannot read properties of undefined (reading 'safeParse') ❯ safeParse src/server/zod-compat.ts:85:31 ❯ src/shared/protocol.ts:1169:41 ❯ Client._onresponse src/shared/protocol.ts:898:13 ❯ Object._transport.onmessage src/shared/protocol.ts:620:22 ❯ Object.<anonymous> test/client/index.test.ts:203:33 ❯ src/shared/protocol.ts:1218:33 ❯ Client.request src/shared/protocol.ts:1072:16 ❯ Client.connect src/client/index.ts:488:39
return result as { success: true; data: SchemaOutput<S> } | { success: false; error: unknown };
}
const v3Schema = schema as z3.ZodTypeAny;
Expand Down
2 changes: 1 addition & 1 deletion src/server/zod-json-schema-compat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import type * as z3 from 'zod/v3';
import type * as z4c from 'zod/v4/core';

import * as z4mini from 'zod/v4-mini';
import z4mini from 'zod/v4-mini';

import { AnySchema, AnyObjectSchema, getObjectShape, safeParse, isZ4Schema, getLiteralValue } from './zod-compat.js';
import { zodToJsonSchema } from 'zod-to-json-schema';
Expand Down
2 changes: 1 addition & 1 deletion src/shared/auth.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as z from 'zod/v4';
import z from 'zod/v4';

/**
* Reusable URL validation that disallows javascript: scheme
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as z from 'zod/v4';
import z from 'zod/v4';
import { AuthInfo } from './server/auth/types.js';

export const LATEST_PROTOCOL_VERSION = '2025-11-25';
Expand Down Expand Up @@ -2249,7 +2249,7 @@
}

// Default to generic McpError
return new McpError(code, message, data);

Check failure on line 2252 in src/types.ts

View workflow job for this annotation

GitHub Actions / test (18)

test/client/index.test.ts > should accept form-mode elicitation request when client advertises empty elicitation object (back-compat)

McpError: MCP error -32603: Cannot read properties of undefined (reading 'safeParse') ❯ Function.fromError src/types.ts:2252:16 ❯ Client._onresponse src/shared/protocol.ts:900:36 ❯ InMemoryTransport._transport.onmessage src/shared/protocol.ts:620:22 ❯ InMemoryTransport.send src/inMemory.ts:58:34 ❯ src/shared/protocol.ts:816:50 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { code: -32603, data: undefined }

Check failure on line 2252 in src/types.ts

View workflow job for this annotation

GitHub Actions / test (18)

test/client/index.test.ts > should respect server notification capabilities

McpError: MCP error -32603: Cannot read properties of undefined (reading 'safeParse') ❯ Function.fromError src/types.ts:2252:16 ❯ Client._onresponse src/shared/protocol.ts:900:36 ❯ InMemoryTransport._transport.onmessage src/shared/protocol.ts:620:22 ❯ InMemoryTransport.send src/inMemory.ts:58:34 ❯ src/shared/protocol.ts:816:50 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { code: -32603, data: undefined }

Check failure on line 2252 in src/types.ts

View workflow job for this annotation

GitHub Actions / test (18)

test/client/index.test.ts > should respect client notification capabilities

McpError: MCP error -32603: Cannot read properties of undefined (reading 'safeParse') ❯ Function.fromError src/types.ts:2252:16 ❯ Client._onresponse src/shared/protocol.ts:900:36 ❯ InMemoryTransport._transport.onmessage src/shared/protocol.ts:620:22 ❯ InMemoryTransport.send src/inMemory.ts:58:34 ❯ src/shared/protocol.ts:816:50 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { code: -32603, data: undefined }

Check failure on line 2252 in src/types.ts

View workflow job for this annotation

GitHub Actions / test (18)

test/client/index.test.ts > should respect server capabilities

McpError: MCP error -32603: Cannot read properties of undefined (reading 'safeParse') ❯ Function.fromError src/types.ts:2252:16 ❯ Client._onresponse src/shared/protocol.ts:900:36 ❯ InMemoryTransport._transport.onmessage src/shared/protocol.ts:620:22 ❯ InMemoryTransport.send src/inMemory.ts:58:34 ❯ src/shared/protocol.ts:816:50 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { code: -32603, data: undefined }

Check failure on line 2252 in src/types.ts

View workflow job for this annotation

GitHub Actions / test (18)

test/client/index.test.ts > should negotiate version when client is old, and newer server supports its version

McpError: MCP error -32603: Cannot read properties of undefined (reading 'safeParse') ❯ Function.fromError src/types.ts:2252:16 ❯ Client._onresponse src/shared/protocol.ts:900:36 ❯ InMemoryTransport._transport.onmessage src/shared/protocol.ts:620:22 ❯ InMemoryTransport.send src/inMemory.ts:58:34 ❯ src/shared/protocol.ts:816:50 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { code: -32603, data: undefined }

Check failure on line 2252 in src/types.ts

View workflow job for this annotation

GitHub Actions / test (18)

test/client/index.test.ts > should connect new client to old, supported server version

McpError: MCP error -32603: Cannot read properties of undefined (reading 'safeParse') ❯ Function.fromError src/types.ts:2252:16 ❯ Client._onresponse src/shared/protocol.ts:900:36 ❯ InMemoryTransport._transport.onmessage src/shared/protocol.ts:620:22 ❯ InMemoryTransport.send src/inMemory.ts:58:34 ❯ src/shared/protocol.ts:816:50 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { code: -32603, data: undefined }

Check failure on line 2252 in src/types.ts

View workflow job for this annotation

GitHub Actions / test (24)

test/client/index.test.ts > should accept form-mode elicitation request when client advertises empty elicitation object (back-compat)

McpError: MCP error -32603: Cannot read properties of undefined (reading 'safeParse') ❯ McpError.fromError src/types.ts:2252:16 ❯ Client._onresponse src/shared/protocol.ts:900:36 ❯ InMemoryTransport._transport.onmessage src/shared/protocol.ts:620:22 ❯ InMemoryTransport.send src/inMemory.ts:58:34 ❯ src/shared/protocol.ts:816:50 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { code: -32603, data: undefined }

Check failure on line 2252 in src/types.ts

View workflow job for this annotation

GitHub Actions / test (24)

test/client/index.test.ts > should respect server notification capabilities

McpError: MCP error -32603: Cannot read properties of undefined (reading 'safeParse') ❯ McpError.fromError src/types.ts:2252:16 ❯ Client._onresponse src/shared/protocol.ts:900:36 ❯ InMemoryTransport._transport.onmessage src/shared/protocol.ts:620:22 ❯ InMemoryTransport.send src/inMemory.ts:58:34 ❯ src/shared/protocol.ts:816:50 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { code: -32603, data: undefined }

Check failure on line 2252 in src/types.ts

View workflow job for this annotation

GitHub Actions / test (24)

test/client/index.test.ts > should respect client notification capabilities

McpError: MCP error -32603: Cannot read properties of undefined (reading 'safeParse') ❯ McpError.fromError src/types.ts:2252:16 ❯ Client._onresponse src/shared/protocol.ts:900:36 ❯ InMemoryTransport._transport.onmessage src/shared/protocol.ts:620:22 ❯ InMemoryTransport.send src/inMemory.ts:58:34 ❯ src/shared/protocol.ts:816:50 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { code: -32603, data: undefined }

Check failure on line 2252 in src/types.ts

View workflow job for this annotation

GitHub Actions / test (24)

test/client/index.test.ts > should respect server capabilities

McpError: MCP error -32603: Cannot read properties of undefined (reading 'safeParse') ❯ McpError.fromError src/types.ts:2252:16 ❯ Client._onresponse src/shared/protocol.ts:900:36 ❯ InMemoryTransport._transport.onmessage src/shared/protocol.ts:620:22 ❯ InMemoryTransport.send src/inMemory.ts:58:34 ❯ src/shared/protocol.ts:816:50 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { code: -32603, data: undefined }

Check failure on line 2252 in src/types.ts

View workflow job for this annotation

GitHub Actions / test (24)

test/client/index.test.ts > should negotiate version when client is old, and newer server supports its version

McpError: MCP error -32603: Cannot read properties of undefined (reading 'safeParse') ❯ McpError.fromError src/types.ts:2252:16 ❯ Client._onresponse src/shared/protocol.ts:900:36 ❯ InMemoryTransport._transport.onmessage src/shared/protocol.ts:620:22 ❯ InMemoryTransport.send src/inMemory.ts:58:34 ❯ src/shared/protocol.ts:816:50 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { code: -32603, data: undefined }

Check failure on line 2252 in src/types.ts

View workflow job for this annotation

GitHub Actions / test (24)

test/client/index.test.ts > should connect new client to old, supported server version

McpError: MCP error -32603: Cannot read properties of undefined (reading 'safeParse') ❯ McpError.fromError src/types.ts:2252:16 ❯ Client._onresponse src/shared/protocol.ts:900:36 ❯ InMemoryTransport._transport.onmessage src/shared/protocol.ts:620:22 ❯ InMemoryTransport.send src/inMemory.ts:58:34 ❯ src/shared/protocol.ts:816:50 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { code: -32603, data: undefined }
}
}

Expand Down
Loading