[CRITICAL] MCP Parameter Serialization Bug in Both Claude Code and Claude Desktop
Critical MCP Parameter Serialization Bug
Summary
MCP parameter serialization fails consistently on consecutive function calls in both Claude Code and Claude Desktop, making MCP tools effectively unusable for any workflow requiring multiple parameter-based calls.
Environment
- Platform: Claude Desktop (not Claude Code CLI)
- Operating System: Windows
- MCP Servers Tested: mcp-db-server, filesystem
- Issue Scope: Affects ALL MCP servers requiring parameters
Bug Description
Pattern of Failure:
- ✅ First call with parameters: SUCCESS
- ❌ Subsequent calls with parameters: FAIL with "Cannot convert undefined or null to object"
- ✅ Calls without parameters: SUCCESS (always work)
Reproduction Steps
- Make any successful MCP call with parameters (e.g.,
mcp-db-server:commandwith SQL) - Attempt a second MCP call with parameters (e.g.,
mcp-db-server:querywith SQL) - Result: Second call fails with "Cannot convert undefined or null to object"
- Make a call without parameters (e.g.,
mcp-db-server:get_database_info) - Result: Call without parameters succeeds
Tested MCP Functions
Database Server (mcp-db-server):
get_database_info(no params): ✅ Always workscommand(sql param): ✅ First call works, ❌ subsequent calls failquery(sql param): ✅ First call works, ❌ subsequent calls fail
Filesystem:
list_allowed_directories(no params): ✅ Always workslist_directory(path param): ❌ Fails immediately after any previous param callget_file_info(path param): ❌ Fails immediately after any previous param call
Critical Impact
- Makes MCP unusable: Any workflow requiring >1 parameter call fails
- Affects both major Claude interfaces: Claude Code AND Claude Desktop
- Production blocker: Cannot build reliable automations with MCP
- Cross-platform issue: Not limited to specific OS or setup
Related Issues
This appears related to #3966 and #2089, but is more severe as it affects Claude Desktop users as well, indicating a fundamental problem with Claude's MCP parameter serialization architecture.
Expected Behavior
All MCP calls with proper parameters should succeed regardless of call order or previous calls.
Actual Behavior
Only the first parameter-based MCP call in a session succeeds; all subsequent parameter calls fail with serialization errors.
Workaround
Currently requires restarting the entire Claude session after each parameter-based MCP operation, making MCP impractical for real workflows.
Priority: Critical - This affects the core functionality of MCP across all Claude interfaces.
Update: Admin Privileges Test Results
Testing Environment: Claude Desktop running with Administrator privileges
Test Results
Ran comprehensive tests with admin privileges to rule out permission-related issues:
Session Start (Fresh)
- ✅
mcp-db-server:get_database_info(no params) → SUCCESS - ❌
mcp-db-server:querywith SQL parameter → FAILED ("Cannot convert undefined or null to object") - ❌
filesystem:list_directorywith path parameter → FAILED - ❌
filesystem:list_allowed_directories(no params) → FAILED
Critical Discovery
Even more severe pattern observed:
- ✅ First parameter-less call: Works
- ❌ First parameter call attempt: Fails and corrupts entire MCP session
- ❌ ALL subsequent calls: Fail, even those without parameters
Conclusion
- Not a permission issue: Admin privileges do not resolve the problem
- Complete MCP system failure: First parameter call attempt breaks the entire MCP subsystem
- Session corruption: Once a parameter call fails, even parameter-less calls start failing
- Confirms fundamental architectural bug: This is a core MCP implementation defect
This makes the issue even more critical as it shows complete MCP system instability rather than just parameter serialization issues.
Impact Assessment
Severity: CRITICAL++
- Makes MCP completely unusable in production
- Single failed parameter call corrupts entire session
- Affects both Claude Code and Claude Desktop
- No viable workarounds beyond constant session restarts
Bump: can confirm, experiencing exactly the same. Tried multiple MCP servers, my own, filesystem, vs code, etc. Consistently get "Cannot convert undefined or null to object" when multiple calls are made in succession or when a call contains multiple parameters/arguments.
See issue https://github.com/anthropics/claude-code/issues/4188
"Cannot convert undefined or null to object" when multiple calls are made in succession or when a call contains multiple parameters/arguments.
Same issue here, first tool call works then all other tools from other MCPs returns the same error
Dost work even if the session is restarted. On Claude desktop
Same problem...
same here
Remote connectors and dtx also have that problems.. please fix it quickly.
Confirming this exact bug pattern.
I can reproduce the identical behaviour:
- First MCP call with parameters: SUCCESS
- Second MCP call with parameters: FAIL with "Cannot convert undefined or null to object"
- Calls without parameters: Always work
Additionally found that any first MCP call that returns an error (e.g., check a non-existent resource) immediately corrupts the client state, causing all subsequent parameterised calls to fail with the same JavaScript error.
Platform: Claude Desktop Impact: Critical - makes MCP unusable for any multi-step workflows
I get this error: "Failed to call tool execute_sql: TypeError: Cannot convert undefined or null to object" when I try to use mysql_mcp_server. I’ve tried both Sonnet and Opus, and the issue is the same. Is this the same problem you’re experiencing?
Exactly the same @cris82mi. Not an issue with your MCP.
Same issue here.
@cris82mi Widespread issue. Suffering the same here.
Same here
Same issue with Jira MCP.
Exactly the same issue... Windows 11.
same issue
Can confirm on macOS Sequoia 15.5
Game breaker for me. I have several long running complex projects and Claude has free rein to read-write persistent memories to a directory I've given it.
Confirmed here to. Huge issue for me, killing several critical processes
same issue
I'll help you check the PostgreSQL database. Let me start by exploring the database structure to see what's available.Now let me check what tables and other objects are in the main user schema:Let me try a different approach and run a SQL query to check the database:Let me try checking the database health to see if there are any connectivity issues:I'm encountering connectivity issues with the PostgreSQL database - all the functions are returning "Cannot convert undefined or null to object" errors. This suggests the database connection might not be properly configured or the database might not be accessible.
Let me check if there are any database files or alternative data sources available:Let me try checking if there's a DuckDB database available:I'm unable to access the PostgreSQL database due to connectivity issues. All the database functions are returning "Cannot convert undefined or null to object" errors, which suggests:
- Database Connection Issues: The PostgreSQL server might not be running or accessible
- Configuration Problems: The database connection parameters might not be properly configured
- MCP Server Issues: The Model Context Protocol servers that provide database access might not be properly connected
Troubleshooting steps you could try:
- Check PostgreSQL Status: Verify that the PostgreSQL service is running
- Verify Connection Settings: Ensure the database host, port, username, password, and database name are correctly configured
- Network Connectivity: Check if there are any firewall or network issues preventing database access
- MCP Configuration: Verify that the PostgreSQL MCP server is properly configured and connected
Would you like me to help you with any specific aspects once the database connectivity is restored? I can assist with:
- Database schema analysis
- Performance monitoring
- Query optimization
- Health checks
- Index recommendations
If you have any database dump files or SQL scripts available, I could also help analyze those while the connectivity issues are being resolved.