[BUG]
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
- Configure Desktop Commander in Claude Desktop MCP settings with NPX
- Restart Claude Desktop completely
- Attempt any file system operation:
list_directory("/Users") - Attempt any process operation:
start_process("echo test", 5000) - 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
- Configure Desktop Commander in Claude Desktop MCP settings
- Restart Claude Desktop
- Attempt any file system operation:
list_directory("/Users") - Attempt any process operation:
start_process("echo test", 5000) - 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
- ✅ Added
-yflag to NPX command to prevent installation prompts - ✅ Restarted Claude Desktop completely
- ✅ Verified configuration syntax is correct
- ❌ 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(), orObject.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
- MCP Protocol Version Mismatch: Desktop Commander 0.2.6 may be incompatible with current Claude Desktop MCP implementation
- Parameter Serialization Issue: Objects not being properly serialized/deserialized in the MCP transport layer
- Configuration Issue: Despite correct syntax, parameters may not be properly structured for the current version
Suggested Investigation Areas
- Check parameter validation logic in Desktop Commander's MCP handler
- Verify object destructuring/property access in tool implementations
- Review MCP protocol compatibility between versions
- 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
This issue has 8 comments on GitHub. Read the full discussion on GitHub ↗