[BUG]

Resolved 💬 8 comments Opened Jul 23, 2025 by TIMBOTGPT Closed Jul 23, 2025

Environment

  • Platform (select one):
  • [x] Other: Claude Desktop with MCP (Desktop Commander)
  • Claude CLI version: N/A (Using Claude Desktop 0.12.28)
  • Operating System: macOS 15 (Sequoia) on M1 iMac
  • Terminal: Terminal.app

Bug Description

Desktop Commander MCP is throwing "Cannot convert undefined or null to object" errors on all file system and process operations, making the tool unusable. The error affects multiple tool categories systematically, suggesting a parameter serialization issue in the MCP protocol layer.

Steps to Reproduce

  1. Configure Desktop Commander in Claude Desktop MCP settings with NPX
  2. Restart Claude Desktop completely
  3. Attempt any file system operation: list_directory("/Users")
  4. Attempt any process operation: start_process("echo test", 5000)
  5. Both fail with "Cannot convert undefined or null to object"

Expected Behavior

  • Directory listings should return file/folder contents
  • Process operations should execute and return output
  • File operations should read/write successfully

Actual Behavior

All operations fail immediately with the object conversion error. Basic configuration access (get_config) works, but all file system, process, and editing operations fail systematically with "Error executing code: Cannot convert undefined or null to object".

Additional Context

  • Desktop Commander Version: 0.2.6
  • Operating System: macOS 15 (Sequoia) on M1 iMac
  • Claude Desktop Version: Claude 0.12.28 (5f9bc7) 2025-07-18T21:14:50.000Z
  • Node.js Version: v24.2.0
  • NPM Version: 11.3.0
  • Installation Method: NPX via Claude Desktop MCP config

Current Configuration

"desktop-commander": {
  "command": "npx",
  "args": [
    "-y",
    "@wonderwhy-er/desktop-commander@latest"
  ]
}

Error Details

Error Message

Error executing code: Cannot convert undefined or null to object

Affected Operations

  • list_directory - All directory listing operations fail
  • start_process - Cannot start any terminal processes
  • edit_block - File editing operations fail
  • read_file - File reading operations fail
  • get_config - Basic configuration access works

Error Statistics

  • Total Tool Calls: 894
  • Failed Calls: 81 (9.1% failure rate)
  • Pattern: Systematic failure across multiple tool types, not isolated to specific operations

Steps to Reproduce

  1. Configure Desktop Commander in Claude Desktop MCP settings
  2. Restart Claude Desktop
  3. Attempt any file system operation: list_directory("/Users")
  4. Attempt any process operation: start_process("echo test", 5000)
  5. Both fail with "Cannot convert undefined or null to object"

Expected Behavior

  • Directory listings should return file/folder contents
  • Process operations should execute and return output
  • File operations should read/write successfully

Actual Behavior

All operations fail immediately with the object conversion error, suggesting a parameter serialization issue in the MCP protocol layer.

Troubleshooting Attempted

  1. ✅ Added -y flag to NPX command to prevent installation prompts
  2. ✅ Restarted Claude Desktop completely
  3. ✅ Verified configuration syntax is correct
  4. ❌ Error persists across all troubleshooting attempts

Technical Analysis

The error "Cannot convert undefined or null to object" typically occurs when JavaScript tries to:

  • Use Object.keys(), Object.entries(), or Object.assign() on undefined/null values
  • Iterate over properties of undefined/null objects
  • Perform operations expecting an object but receiving undefined/null

This suggests the issue is in parameter handling/serialization between Claude Desktop and Desktop Commander, where expected object parameters are arriving as undefined or null.

Potential Root Causes

  1. MCP Protocol Version Mismatch: Desktop Commander 0.2.6 may be incompatible with current Claude Desktop MCP implementation
  2. Parameter Serialization Issue: Objects not being properly serialized/deserialized in the MCP transport layer
  3. Configuration Issue: Despite correct syntax, parameters may not be properly structured for the current version

Suggested Investigation Areas

  1. Check parameter validation logic in Desktop Commander's MCP handler
  2. Verify object destructuring/property access in tool implementations
  3. Review MCP protocol compatibility between versions
  4. Test with alternative installation methods (global npm install vs npx)

Additional Context

  • Multiple MCP servers in the same environment work correctly (filesystem, applescript-automation, etc.)
  • Basic Desktop Commander connection works (get_config succeeds)
  • The issue appears specific to operations requiring parameter processing
  • Error is consistent and reproducible across all affected operations

Workaround Needed

Currently no workaround available - the tool is completely unusable for file system and process operations.

Original post on MCP site https://github.com/wonderwhy-er/DesktopCommanderMCP/issues/193#issuecomment-3106116048 but now it seems that many MCP's are failing with the new desktop app.

---

Priority: High - Complete loss of functionality for primary use cases

View original on GitHub ↗

This issue has 8 comments on GitHub. Read the full discussion on GitHub ↗