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

Status Fixed / completed
Maintainer reply None cached
Activity 11 comments · opened Jul 23, 2025 · closed Jul 23, 2025

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

---

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.

View original on GitHub ↗

11 Comments

kevinhagel · 1 year ago

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

tatwong · 1 year ago

Sequential Thinking isn't working neither.

projeman · 1 year ago

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

itoop2019 · 1 year ago

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?

Hank-coder · 1 year ago

Fix the mcp pls!

addaben26 · 1 year ago

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

reverie · 1 year ago

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

psychosys · 1 year ago

it was working until yesterday

yo999i · 1 year ago

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

<img width="654" height="466" alt="Image" src="https://github.com/user-attachments/assets/3afee7d1-e9d2-471e-9f35-0391a4f2c21b" />

github-actions[bot] · 1 year ago

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.