[BUG] Claude Code MCP Parameter Serialization Bug
Claude Code MCP Parameter Serialization Bug
Summary
Claude Code is sending empty parameter dictionaries {} to MCP servers, breaking all tools that require parameters.
Environment
- Claude Code version: Latest (July 2025) - check with claude --version
- OS: macOS Darwin 24.3.0
- Node.js: v23.11.0
- MCP SDK: @modelcontextprotocol/sdk (latest)
- Server type: Both stdio and HTTP MCP servers affected
Expected Behavior
When calling MCP tools with parameters like:
mcp__server-name__tool_name
Parameters: {"param1": "value1", "param2": "value2"}
The MCP server should receive the parameters correctly in request.params.
Actual Behavior
MCP servers receive empty parameter dictionaries {} regardless of what parameters are specified in Claude Code.
Evidence
Production Server Logs
Server logs consistently show:
"Raw params_dict: {}"
"Type of params_dict: <class 'dict'>"
Comprehensive Testing Results
- ✅ Direct MCP Protocol: Works perfectly - parameters properly received
- ✅ Claude Desktop: Works perfectly with identical servers
- ❌ Claude Code: Sends empty objects instead of parameters
- ✅ 48-tool production system: Works flawlessly in Claude Desktop, fails in Claude Code
Reproduction Steps
Quick Reproduction
- Set up any MCP server with tools requiring parameters
- Configure Claude Code to use the server: claude mcp add server-name "node" "/path/to/server.js"
- Call any tool with parameters
- Check server logs - parameters are empty {}
Detailed Reproduction (Attached Files)
The attached claude-code-mcp-bug-repro folder contains a complete reproduction case:
- Install: npm install
- Verify server works: ./test-mcp-direct.sh (shows parameters received correctly)
- Configure Claude Code: claude mcp add test-server "node" "/path/to/test-server.js"
- Test in Claude Code: Call mcp__test-server__test_tool with test_param: "hello"
- Observe bug: Server logs show empty parameters despite tool call
Root Cause
Parameter serialization bug in Claude Code's MCP implementation. The issue is NOT in:
- ❌ MCP server implementations (work perfectly with direct protocol)
- ❌ Parameter schemas (correctly defined)
- ❌ MCP SDK (works with Claude Desktop)
The bug IS in:
- ✅ Claude Code's parameter passing to MCP servers
Impact
- All parameterized MCP tools are broken in Claude Code
- Same tools work perfectly in Claude Desktop
- Affects entire MCP ecosystem compatibility
- Forces users to switch to Claude Desktop for MCP workflows
- Breaks production systems (our 48-tool email management platform)
Comparison: Working vs Broken
| Environment | Parameter Reception | Status |
|---------------------|---------------------------------------------------|----------|
| Direct MCP Protocol | {"name": "tool", "arguments": {"param": "value"}} | ✅ Works |
| Claude Desktop | Parameters received correctly | ✅ Works |
| Claude Code | {} (empty object) | ❌ Broken |
Workaround
Use Claude Desktop instead of Claude Code for MCP tools requiring parameters.
Additional Context
- Simple tools with no parameters work correctly in Claude Code
- Issue affects both custom and official MCP servers
- Parameter schemas are correctly defined per MCP specification
- Direct API calls to servers work with proper parameters
- Multiple server architectures tested (stdio, HTTP, different languages)
Attached Files
Complete reproduction package in claude-code-mcp-bug-repro/:
- test-server.js - Minimal MCP server with detailed parameter logging
- test-mcp-direct.sh - Proof that direct MCP protocol works
- REPRODUCTION_STEPS.md - Step-by-step reproduction guide
- BUG_EVIDENCE.md - Comprehensive evidence documentation
- package.json - Required dependencies
---
Priority: High - This breaks fundamental MCP compatibility for Claude Code users and significantly impacts the MCP ecosystem
adoption.
BUG_EVIDENCE.md
REPRODUCTION_STEPS.md
package-lock.json
package.json
9 Comments
Hi @ivan-rivera-projects - thanks for reporting this
Would you also be able to provide the test-server.js? I can't seem to reproduce this myself
Hi, I installed Claude for Windows (Claude 0.12.28 (5f9bc7)) a few days back and built an MCP server using stdio. When logging out the tool call context, we can see the params are never set.
This should be pretty easy to recreate?
I've also hit this with 0.12.28 (5f9bc7), starting today. It even happens with the filesystem MCP client. From the logs:
2025-07-23T03:45:55.174Z [filesystem] [info] Message from client: {"method":"tools/call","params":{"name":"read_file"},"jsonrpc":"2.0","id":8} { metadata: undefined }The first call after restarting the app works, subsequent ones have no
argumentsfield in the params.✅ Root Cause Identified + Minimal Reproduction Case
Through systematic testing, claude has identified the exact schema pattern that triggers this MCP parameter bug:
🎯 Specific Bug Trigger:
Schema pattern:
{"type": ["string", "null"], "default": null}combined with required fieldsWorking schemas:
{"type": "string"}+"required": ["field"]{"type": "string", "default": "value"}+"required": []Failing schema:
{"type": ["string", "null"], "default": null}+ required fields🧪 Minimal Reproduction Case:
I've created a complete reproduction script: Claude Code MCP Parameter Bug Reproduction
The gist includes:
🔍 Evidence:
MCP Protocol Logs show Claude Code sending:
📋 Quick Reproduction:
.mcp.jsontest_mixed_params(content: "hello", parent: "test")This union type + null default pattern is commonly used by MCP servers for optional parameters, making this bug affect many real-world tools.
Tested on Claude Code 1.0.69
by: Claude Code 1.0.69
@ollie-anthropic It's quite unfortunate I have to add separate MCP tool for every parameter variation currently. (can't use optional parameters)
I also can't use other MCP tools that have this kind of optional parameters.
Please investigate this 🙏
I attempted to reproduce this bug locally and it appears to be fixed in recent versions.
Reproduction Setup
With the debug MCP server from the gist, and Claude Code version
2.0.37, I tested by having Claude call thetest_mixed_paramstool through the MCP server. The server logs to a file showing exactly what arguments it receives.Test 1: With both required and optional parameters
Request: Call
test_mixed_paramswithcontent='test log'andparent='parent123'Server logs:
Result: ✅ Success - Both parameters received correctly
Test 2: With only the required parameter
Request: Call
test_mixed_paramswith onlycontent='only required test'Server logs:
Result: ✅ Success - Required parameter received correctly
Conclusion
The bug reported in version
1.0.69where parameters weren't passed when using the{"type": ["string", "null"], "default": null}pattern appears to be fixed in version2.0.37.@tennox Can you update to the latest version and confirm if this is still an issue for you?
Confirmed! Just tested on my end with v2.0.37 and can verify the fix is working.
Caveat
this issue is marked as macos-specific - I'm on linux.
Details of my test
I created a dedicated test MCP server with the exact problematic schema pattern and tested all edge cases:
Test tool schema (the pattern that was broken):
Test results:
{"message":"hello world"}- received correctly{"message":null}- received correctly{"message":null}- received correctlyAll tested via:
Server logs confirmed parameters are being passed properly - no empty
{}objects. The union type + null default + required field combination now works as expected.Thanks for fixing this! 🎉
Great! I'm going to close this issue, but do please open a new issue if you do notice any bad MCP behavior in future. Thanks again for reporting this and glad it's fixed.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.