Replies: 1 comment
-
Where are you getting the "list_tools" and "call_tool" method names from? I don't think any of the methodFormats in McpClient/Program.cs are valid MCP JSON-RPC messages. Instead, the methods should be "tools/list" and "tools/call" as specified in https://modelcontextprotocol.io/specification/2025-03-26/server/tools#protocol-messages. I think using the proper schema will fix most of your issues. I also noticed that you're using both WithToolsFromAssembly and defining a custom ListToolsHandler/CallToolHandler on the server. While we do have some logic to try to fall back to your handler if there a no matching tools in the ToolCollection, and that should work, I'd start out trying to get just getting the higher-level WithToolsFromAssembly working first. While ListToolsHandler/CallToolHandler is lower level, it does not allow you to listen for arbitrary JSON-RPC requests. They listen for the "tools/list" and "tools/call" methods respectively. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug
I am not able to build a working MCP server and client
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The server and client should be able to communicate
Logs
See the repo README
Additional context
Maybe I'm just doing something wrong, but so far I've been unable to get this to work. Please point out what I may be doing wrong.
Beta Was this translation helpful? Give feedback.
All reactions