Replies: 2 comments 4 replies
-
You generally don't need to manipulate the ServerCapabilities directly. It is used by the server during the init handshake to tell the client the servers capabilities. There's a similar object, ClientCapabilities, being passed by the client to the server. For example, if a server doesn't support tools, it doesn't make sense for the client to call ListTools. If the client doesn't support roots, the server shouldn't try to list those. There's a bit more complexity, as it also includes stuff like whether there's support for subscriptions and such, but you really don't need to concern yourself with it for your first server - and perhaps not ever - at least not implementation-wise. Unless you're working at a very low level where you're manually creating handlers, you can just focus on adding the tools, prompts, resources, etc. that you want to expose, and the SDK will then handle providing the right capabilities to the client. |
Beta Was this translation helpful? Give feedback.
-
Thanks @PederHP , what you say looks reasonable. IMO the property |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Pre-submission Checklist
Question Category
Your Question
I am creating a generic McpClient and I am not sure what is the intended usage for
IMcpClient.ServerCapabilities
.I expect the ServerCapabilities to be used by the MCP Server but this object is also available on the client side where most of the properties of
PromptsCapability
,ToolsCapability
, etc. are tagged withJsonIgnore
.Are the ServerCapabilities being refactored into a smaller object representing only the info that is exchanged during the iniitalization with the MCP Server?
Beta Was this translation helpful? Give feedback.
All reactions