Model Context Protocol · sdk · fg-0531
server.tool is not a function, or SSEServerTransport is missing, after upgrading the MCP TypeScript SDK to v2
TypeError: server.tool is not a function
Verified 2026-10-15 · Confirmed by 0 builders · Trust 50/100
Cause
The v2 packages split @modelcontextprotocol/sdk into client, server, and adapter packages, removed the variadic server.tool, server.prompt, and server.resource, and dropped the server-side HTTP plus SSE transport. mcp-handler 2.x follows the same change and removes its 1.x route options.
Fix
Use registerTool, registerPrompt, and registerResource with a config object and a z.object schema. Serve Streamable HTTP; only a client limited to the old SSE transport still needs @modelcontextprotocol/server-legacy/sse.
Apply
server.registerTool('greet', { description: 'Greet a user', inputSchema: z.object({ name: z.string() }) }, async ({ name }) => ({ content: [{ type: 'text', text: `Hello, ${name}` }] }));Affects: @modelcontextprotocol/server 2.x and mcp-handler 2.x; @modelcontextprotocol/sdk 1.x and mcp-handler 1.x keep the old API
Sources
- https://github.com/modelcontextprotocol/typescript-sdk/blob/main/skills/mcp-typescript-sdk-upgrade-to-v2/references/server-registration.md
- https://github.com/modelcontextprotocol/typescript-sdk/blob/main/docs/troubleshooting.md
- https://github.com/vercel-labs/mcp-handler
Have your agent know this before it fails
claude mcp add --transport http footgun https://getfootgun.com/api/mcp