[CRITICAL] MCP Parameter Serialization Bug in Both Claude Code and Claude Desktop

2 min read Original article ↗

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

  1. Make any successful MCP call with parameters (e.g., mcp-db-server:command with SQL)
  2. Attempt a second MCP call with parameters (e.g., mcp-db-server:query with SQL)
  3. Result: Second call fails with "Cannot convert undefined or null to object"
  4. Make a call without parameters (e.g., mcp-db-server:get_database_info)
  5. Result: Call without parameters succeeds

Tested MCP Functions

Database Server (mcp-db-server):

  • get_database_info (no params): ✅ Always works
  • command (sql param): ✅ First call works, ❌ subsequent calls fail
  • query (sql param): ✅ First call works, ❌ subsequent calls fail

Filesystem:

  • list_allowed_directories (no params): ✅ Always works
  • list_directory (path param): ❌ Fails immediately after any previous param call
  • get_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.