[BUG] JSON Parse issue for MCP Client
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
⏺ You're absolutely right! MCP is a standardized protocol, and both Cline and Claude Code should be sending the same JSON-RPC format to the MCP server. The LLM should be able to generate tool calls that work identically in both.
The issue is likely a bug or implementation difference in how Claude Code's MCP client handles JSON parameter serialization compared to Cline's implementation.
Looking at the system prompt instructions:
"When making function calls using tools that accept array or object parameters ensure those are structured using JSON."
This suggests Claude Code expects me to use JSON strings for complex objects. However, based on the errors, it appears Claude Code's MCP client is NOT parsing those JSON strings before sending them to the MCP server - it's sending them as literal strings.
What should happen:
When I call:
<parameter name="parent">{"database_id": "2d5b2522-4b23-8010-8566-000beb23e7cd"}</parameter>
Claude Code should send to the MCP server:
{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "API-post-page",
"arguments": {
"parent": {"database_id": "2d5b2522-4b23-8010-8566-000beb23e7cd"}
}
}
}
What's actually happening:
Claude Code appears to be sending:
{
"arguments": {
"parent": "{\"database_id\": \"2d5b2522-4b23-8010-8566-000beb23e7cd\"}"
}
}
This is a bug in Claude Code's MCP implementation. It should parse JSON strings in parameters before sending them to MCP servers, just like Cline does.
What Should Happen?
What should happen:
When I call:
<parameter name="parent">{"database_id": "2d5b2522-4b23-8010-8566-000beb23e7cd"}</parameter>
Claude Code should send to the MCP server:
{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "API-post-page",
"arguments": {
"parent": {"database_id": "2d5b2522-4b23-8010-8566-000beb23e7cd"}
}
}
}
What's actually happening:
Claude Code appears to be sending:
{
"arguments": {
"parent": "{\"database_id\": \"2d5b2522-4b23-8010-8566-000beb23e7cd\"}"
}
}
Error Messages/Logs
Steps to Reproduce
What should happen:
When I call:
<parameter name="parent">{"database_id": "2d5b2522-4b23-8010-8566-000beb23e7cd"}</parameter>
Claude Code should send to the MCP server:
{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "API-post-page",
"arguments": {
"parent": {"database_id": "2d5b2522-4b23-8010-8566-000beb23e7cd"}
}
}
}
What's actually happening:
Claude Code appears to be sending:
{
"arguments": {
"parent": "{\"database_id\": \"2d5b2522-4b23-8010-8566-000beb23e7cd\"}"
}
}
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.0.76
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗