Unchanged APIs
The following are unchanged between v1 and v2 apart from the import path — except where an entry notes its own signature change:
Clientconstructor andconnect,close, and the typed verbs (listTools,listPrompts,listResources,readResource, …) — notecallTool()andrequest()signatures changed (schema parameter dropped for spec methods).McpServerconstructor,server.connect(transport),server.close(), and theMcpServer.serveraccessor — still the supported way to call the low-levelServer's push verbs (createMessage/listRoots/sendLoggingMessage— ⚠@deprecated, see §Deprecated in v2) outside a handler context.- The server Streamable HTTP transports' constructor options (
sessionIdGenerator,onsessioninitialized,onsessionclosed,enableJsonResponse,eventStore,retryInterval) and thehandleRequestsurface — only the class name and import moved:StreamableHTTPServerTransportis nowNodeStreamableHTTPServerTransportfrom@modelcontextprotocol/node, a thin wrapper overWebStandardStreamableHTTPServerTransportfrom@modelcontextprotocol/server, which exposes the same options (decision rule). The transport-levelcloseSSEStream(requestId)/closeStandaloneSSEStream()methods keep their v1 names too — only the handler-context accessors moved toctx.http(remap table). UriTemplate(v1:@modelcontextprotocol/sdk/shared/uriTemplate.js) —expand/matchsemantics carry over; import it from@modelcontextprotocol/serveror@modelcontextprotocol/client(top-level export; the codemod rewrites the path).StreamableHTTPClientTransport,SSEClientTransportconstructors and options — including resumability: the per-requestresumptionToken/onresumptiontokenrequest options carry over from v1 unchanged (Resume a dropped stream).StdioClientTransportandStdioServerTransport— import path moved to the./stdiosubpath and gained an optionalmaxBufferSize(Imports & transports).- The
Transportinterface contract —start/send/close,onmessage/onclose/onerror, optionalsessionIdandsetProtocolVersion,TransportSendOptions,MessageExtraInfo. Hand-rolled v1 transports (recording wrappers, test doubles, decorators) compile and run against v2 with only the import path updated. v2 adds optional members only —hasPerRequestStreamandsetSupportedProtocolVersionson the interface,requestSignal/headers/onRequestStreamEndonTransportSendOptions— which matter only for 2026-era per-request-stream cancellation andMcp-Param-*header attachment (support-2026-07-28.md). - All TypeScript type definitions from
types.ts(except the aliases listed under Removed type aliases and theexperimentalcapability payload narrowing — see Types & schemas). - Tool, prompt, and resource callback return types.
The
Server(low-level) constructor and most of its methods are unchanged, butsetRequestHandler/setNotificationHandlerandrequest()signatures changed (Low-level protocol). In particular,Server.createElicitationCompletionNotifier()is unchanged — including its construction-time client-capability check — for 2025-era URL-mode elicitation (support-2026-07-28.md). The Zod*Schemaconstants are not part of the unchanged surface — they moved to@modelcontextprotocol/core(Types & schemas).