chore: replacing deprecated server with McpServer - #187
Conversation
06ef823 to
15f5f32
Compare
| } | ||
|
|
||
| const server = new Server( | ||
| const server = new McpServer( |
There was a problem hiding this comment.
Maybe rename to mcp or mcpServer to avoid the server.server bits?
|
|
||
| // List available tools | ||
| server.setRequestHandler(ListToolsRequestSchema, async () => { | ||
| server.server.setRequestHandler(ListToolsRequestSchema, async () => { |
There was a problem hiding this comment.
@deprecated Use
McpServerinstead for the high-level API. Only useServerfor advanced use cases.
I don't really understand the deprecation policy here. Server is "deprecated" unless you want to use advanced APIs. And apparently setRequestHandler is one of those? Is it then better to keep instantiating Server or to access it via MCPServer.server? Will one or both be removed in the future?
Let's move forward with this for now, but it's not really clear to me what the guideline is.
(no action needed here, but let's be mindful of this if other "deprecation" cleanups come up in the future)
There was a problem hiding this comment.
Yeah now that you mention it, that's confusing to me as well. My understanding is that McpServer is now the intended high level entry point while lower level methods like setRequestHandler are still exposed through McpServer.server. The deprecation wording is still a little uncertain about whether Server is completely deprecated or the access method is slightly changed (though probably the later).
15f5f32 to
09a5219
Compare
|
I've made all the requested changes! |
juliandescottes
left a comment
There was a problem hiding this comment.
Perfect, thanks!
No description provided.