claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] Claude Desktop MCP fails on all parameterized calls for filesystem tool — "Cannot convert undefined or null to object"

Open jinho7 opened this issue 1 year ago • 11 comments

Environment

  • Platform (select one):
    • Claude Desktop with MCP [Claude CLI Code works fine — this bug occurs only in the Desktop app]

Bug Description

Claude Desktop fails consistently on all parameter-based MCP operations for the @modelcontextprotocol/server-filesystem tool, including:

  • read_file
  • get_file_info
  • directory_tree
  • search_files

Only list_directory (which requires no parameters) succeeds.

The error returned is:

Error executing code: Cannot convert undefined or null to object

This issue does not occur in Claude CLI, suggesting the problem is specific to Claude Desktop’s parameter serialization or transmission layer.


Expected Behavior

  • File and directory operations with valid parameters should execute normally.
  • MCP tools should receive properly serialized arguments.
  • Behavior should be consistent between Claude CLI and Claude Desktop.

Actual Behavior

  • list_directory works correctly (no parameters).
  • All parameter-based operations fail with serialization errors.
  • Works flawlessly on Claude CLI with the same configuration and tool.

🛠️ Troubleshooting Attempted

  • ✅ Verified MCP server output
  • ✅ Confirmed correct ~/.claude/mcp.config.json
  • ✅ Used absolute file paths
  • ✅ Restarted Claude Desktop and MCP multiple times
  • ✅ Confirmed functionality in Claude CLI
  • ❌ No workaround found — issue persists in all Desktop sessions

🧾 Configuration Used

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-filesystem",
        "/Users/{MyName}"
      ]
    }
  }
}

Technical Analysis

The error message: TypeError: Cannot convert undefined or null to object

suggests that the parameter object passed from Claude Desktop is either missing or not properly constructed. This usually happens in JavaScript when:

  • Object.keys(), Object.entries() or Object.assign() are called on undefined
  • Destructuring is attempted on null/undefined

Since list_directory (no params) works, but read_file (needs path) fails, this is likely due to MCP parameter serialization logic breaking down inside Claude Desktop.


Affected Operations

  • ✅ list_directory: success
  • ❌ read_file: fails
  • ❌ get_file_info: fails
  • ❌ directory_tree: fails
  • ❌ search_files: fails

System Info

  • Claude Desktop Version: Claude 0.12.28 (5f9bc7) — 2025-07-18T21:14:50.000Z
  • Claude CLI: All MCP operations work as expected
  • Operating System: macOS 15.4.1 (Sequoia) Build 24E263
  • Node.js Version: v22.17.1
  • npm Version: 10.9.2
  • Terminal: macOS Terminal & iTerm2

Related Issues

  • This appears related to https://github.com/anthropics/claude-code/issues/4195

Priority

🔴 High — prevents any meaningful use of MCP in Claude Desktop for parameter-based tools. Workflows relying on file reading, writing, or searching are completely blocked.

jinho7 avatar Jul 23 '25 08:07 jinho7

See https://github.com/anthropics/claude-code/issues/4188 and https://github.com/anthropics/claude-code/issues/4192

hildebrandt avatar Jul 23 '25 09:07 hildebrandt

This error first appeared more than 12 hours ago as far as I can tell. There is no sign of any effort on the part of anthropic to deal with this problem. Apparently it is not happening with claude code.

There is a suggested relationship there - spend more money on claude code or get incomptent service from claude desktop ai

kevinhagel avatar Jul 23 '25 14:07 kevinhagel

Sequential Thinking isn't working neither.

tatwong avatar Jul 23 '25 14:07 tatwong

Claude Desktop has become unusable, when will the problem be fixed?

projeman avatar Jul 23 '25 15:07 projeman

Everything was working fine just yesterday. Today, I keep getting errors all day — MCP servers are down! I'm on the Max plan — what exactly am I paying for?Everything was working fine just yesterday. Today, I keep getting errors all day — MCP servers are down! I'm on the Max plan — what exactly am I paying for?

itoop2019 avatar Jul 23 '25 15:07 itoop2019

Fix the mcp pls!

Hank-coder avatar Jul 23 '25 15:07 Hank-coder

Same problem... Yesterday, everything was working and this morning, this strange message of "Failed tool..." appeared til now. I tried all the possibilities to fiw this issue but none worked

addaben26 avatar Jul 23 '25 16:07 addaben26

Sorry, we can't help with Claude Desktop issues.

reverie avatar Jul 23 '25 16:07 reverie

it was working until yesterday

psychosys avatar Jul 23 '25 16:07 psychosys

I have the same problem, yesterday everything worked, today nothing, is there any fix for this?

Image

yo999i avatar Jul 23 '25 16:07 yo999i

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.

github-actions[bot] avatar Jul 31 '25 14:07 github-actions[bot]