-
Notifications
You must be signed in to change notification settings - Fork 1.6k
v2 - clean deprecated methods and exports
#1419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v2 - clean deprecated methods and exports
#1419
Conversation
🦋 Changeset detectedLatest commit: 43f9738 The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@modelcontextprotocol/client
@modelcontextprotocol/server
@modelcontextprotocol/express
@modelcontextprotocol/hono
@modelcontextprotocol/node
commit: |
…onstantinov/typescript-sdk into feature/clean-deprecated-method-calls
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for doing this, .tool() really needs to go :D
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).