Model Context Protocol · sdk · fg-0531

server.tool is not a function, or SSEServerTransport is missing, after upgrading the MCP TypeScript SDK to v2

If you see TypeError: server.tool is not a function, the cause and the fix for Model Context Protocol are below, last verified 2026-10-15.

Verified Oct 2026trust 50/100
Symptom
TypeError: server.tool is not a functionModule '"@modelcontextprotocol/server"' has no exported member 'SSEServerTransport'mcp-handler 2.x rejects the basePath, redisUrl, or sseEndpoint options
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}` }] }));
Affected
@modelcontextprotocol/server 2.x and mcp-handler 2.x; @modelcontextprotocol/sdk 1.x and mcp-handler 1.x keep the old API
Sources

Last verified 2026-10-15 · Confirmed by 0 builders

Related traps

Have your agent know this before it fails

$ /plugin marketplace add getfootgun/footgun
$ /plugin install footgun@footgun