Skip to content
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

[Bug] mcp Unrecognized field \"tools\ #30

Closed
cookiejoo opened this issue Mar 5, 2025 · 3 comments
Closed

[Bug] mcp Unrecognized field \"tools\ #30

cookiejoo opened this issue Mar 5, 2025 · 3 comments

Comments

@cookiejoo
Copy link

i used cursor add mcp,

There is indeed a 'tools' field under 'capabilities'.
However, according to the MCP specification on Capabilities negociation , the client should not have a 'tools' field as 'capabilities', since it is up to the server to set them.

Steps to Reproduce
bom version:1.0.0-M6

Run the example Spring AI MCP WebFlux server here: https://github.com/spring-projects/spring-ai-examples/tree/main/model-context-protocol/weather/starter-webflux-server
Launch it
Add the server url under mcpServers (type: sse)
Launch the Cursor MCP Server
Log :
event:endpoint
data:/mcp/message

event:message
data:{"jsonrpc":"2.0","id":0,"error":{"code":-32603,"message":"Unrecognized field "tools" (class io.modelcontextprotocol.spec.McpSchema$ClientCapabilities), not marked as ignorable (3 known properties: "experimental", "roots", "sampling"])\n at [Source: UNKNOWN; byte offset: #UNKNOWN] (through reference chain: io.modelcontextprotocol.spec.McpSchema$InitializeRequest["capabilities"]->io.modelcontextprotocol.spec.McpSchema$ClientCapabilities["tools"])"}}

Image

Image

@deemkeen
Copy link

deemkeen commented Mar 7, 2025

https://witsyai.com/ has the same problem, defining the tools field in the client capabilities, it seems that many mcp clients don't implement the spec correctly

@tzolov
Copy link
Contributor

tzolov commented Mar 10, 2025

Thanks for bringing this up @cookiejoo, @deemkeen.

However the McpSchema.ClientCapabilities class is compliant with the MCP spec and doesn't include a "tools" field. The issue appears to be that Cursor is sending non-compliant JSON with extra fields not in the specification.

The error:

data:{"jsonrpc":"2.0","id":0,"error":{"code":-32603,"message":"Unrecognized field "tools" (class io.modelcontextprotocol.spec.McpSchema$ClientCapabilities), not marked as ignorable (3 known properties: "experimental", "roots", "sampling"])\n at [Source: UNKNOWN; byte offset: #UNKNOWN] (through reference chain: io.modelcontextprotocol.spec.McpSchema$InitializeRequest["capabilities"]->io.modelcontextprotocol.spec.McpSchema$ClientCapabilities["tools"])"}}

occurs because Cursor is sending a tools field in the capabilities object that is not compliant with the spec and the receiving system doesn't recognize.

I suggest:

  • Report this spec incompatibility issue to Cursor and Witsyai
  • As a workaround, we can relax the client-side JSON schema strictness in the MCP Java SDK to ignore unknown properties

The core issue is with Cursor's client implementation, not our client-side code.

@cookiejoo
Copy link
Author

感谢您提出这个问题@cookiejoo@deemkeen

但是McpSchema.ClientCapabilities类符合 MCP 规范,不包含“工具”字段。问题似乎是 Cursor 发送了不符合规范的 JSON,其中包含规范中没有的额外字段。

错误:

data:{"jsonrpc":"2.0","id":0,"error":{"code":-32603,"message":"Unrecognized field "tools" (class io.modelcontextprotocol.spec.McpSchema$ClientCapabilities), not marked as ignorable (3 known properties: "experimental", "roots", "sampling"])\n at [Source: UNKNOWN; byte offset: #UNKNOWN] (through reference chain: io.modelcontextprotocol.spec.McpSchema$InitializeRequest["capabilities"]->io.modelcontextprotocol.spec.McpSchema$ClientCapabilities["tools"])"}}

发生这种情况的原因是 Cursor 发送的tools功能对象中有一个字段不符合规范,并且接收系统无法识别。

我建议:

核心问题在于 Cursor 的客户端实现,而不是我们的客户端代码。

Thank you, I will report this issue to the cursor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants