build-mcp-server-sdk-v2
Installation
SKILL.md
Build MCP Server (SDK v2 Alpha)
Build and maintain MCP servers on the v2 alpha split-package SDK: @modelcontextprotocol/server, @modelcontextprotocol/client, @modelcontextprotocol/core, plus /node, /express, /hono adapters. ESM-only, Node 20+, Zod v4. Status as of 2026-05-09: latest npm tag is 2.0.0-alpha.2 — pin exact, plan rollback.
When to use
Trigger this skill if any of these are true:
- Building a brand-new MCP server and the user picks v2, "the alpha", or split packages.
package.jsonalready depends on@modelcontextprotocol/server,@modelcontextprotocol/client, or@modelcontextprotocol/core.- Existing code uses
new McpServer(...)from@modelcontextprotocol/serverandserver.registerTool(...)with the high-level API. - Tool/resource/prompt handlers use
(args, ctx)withctx.mcpReq.signal,ctx.mcpReq.log(),ctx.mcpReq.notify(), orctx.http?.authInfo. - HTTP work uses
NodeStreamableHTTPServerTransportfrom@modelcontextprotocol/node, orcreateMcpExpressApp()/createMcpHonoApp()from the official adapters. - Schemas are full
z.object({...})fromzod/v4, not raw-shape shorthand.
Do NOT use this skill if any of these are true: