v2 - clean deprecated methods and exports
#1419
Open
+258
−565
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Clean deprecated method signature and some exports previously used for backwards compatibility
Motivation and Context
McpServer(.tool,.prompt,.resource) and migrates usage to the explicitregisterTool,registerPrompt, andregisterResourceAPIs.@modelcontextprotocol/coreexports/types that were retained as aliases during spec/API transitions.How Has This Been Tested?
pnpm test:allpnpm check:allBreaking Changes
McpServer.tool(),McpServer.prompt(), andMcpServer.resource()methods. UseregisterTool,registerPrompt, andregisterResourceinstead.registerTool(name, { description?, inputSchema?, outputSchema?, annotations?, execution? }, handler)(use{}when no options are needed).registerPrompt(name, { description?, argsSchema? }, handler)(use{}when no options are needed).registerResource(name, uriOrTemplate, metadata, handler)(use{}when no metadata is needed).@modelcontextprotocol/coreexports/types (update imports to the non-deprecated names):isJSONRPCResponse(useisJSONRPCResultResponse/isJSONRPCResponseSchemaas appropriate)JSONRPCErrorSchema(useJSONRPCErrorResponseSchema)isJSONRPCError(useisJSONRPCErrorResponse)ResourceReferenceSchema/ResourceReference(useResourceTemplateReferenceSchema/ResourceTemplateReference)JSONRPCError(useJSONRPCErrorResponse)Types of changes
Checklist
Additional context
@modelcontextprotocol/{core,server,node,test-integration}after removal of deprecated APIs.register*APIs (e.g.examples/server/src/ssePollingExample.ts, server/node middleware tests, and integration tests).