Desktop Commander MCP is a powerful tool that enables Claude to search, update, manage files, and run terminal commands on your computer. It integrates with your Claude Desktop app and extends its capabilities to interact with your file system and terminal.
Several installation methods are available depending on your preferences:
Simply run this command in your terminal:
npx @wonderwhy-er/desktop-commander@latest setup
For debugging mode:
npx @wonderwhy-er/desktop-commander@latest setup --debug
Command options:
--debug: Enable debugging mode--no-onboarding: Disable onboarding promptsFor macOS users, this script checks Node.js requirements and installs if needed:
curl -fsSL https://raw.githubusercontent.com/wonderwhy-er/DesktopCommanderMCP/refs/heads/main/install.sh | bash
Add this entry to your claude_desktop_config.json file (location varies by OS):
{
"mcpServers": {
"desktop-commander": {
"command": "npx",
"args": [
"-y",
"@wonderwhy-er/desktop-commander@latest"
]
}
}
}
Clone and build from source:
git clone https://github.com/wonderwhy-er/DesktopCommanderMCP.git
cd DesktopCommanderMCP
npm run setup
For complete isolation or users without Node.js:
macOS/Linux:
bash <(curl -fsSL https://raw.githubusercontent.com/wonderwhy-er/DesktopCommanderMCP/refs/heads/main/install-docker.sh)
Windows PowerShell:
iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/wonderwhy-er/DesktopCommanderMCP/refs/heads/main/install-docker.ps1'))
To completely remove Desktop Commander:
npx @wonderwhy-er/desktop-commander@latest remove
Once installed, restart Claude Desktop to start using Desktop Commander. It provides various tools for interacting with your system:
get_config: Get the complete server configurationset_config_value: Set specific configuration valuesstart_process: Start programs with smart detectioninteract_with_process: Send commands to running programsread_process_output: Read output from running processesforce_terminate: Force terminate a running terminal sessionlist_sessions: List all active terminal sessionslist_processes: List running processes with detailskill_process: Terminate a process by PIDread_file: Read contents from local files or URLsread_multiple_files: Read multiple files simultaneouslywrite_file: Write file contents (rewrite or append)create_directory: Create a new directorylist_directory: Get detailed directory listingmove_file: Move or rename files and directoriesstart_search: Search for files by name or contentget_more_search_results: Get paginated search resultsstop_search: Stop an active searchlist_searches: List all active search sessionsget_file_info: Get file metadataedit_block: Apply targeted text replacementsget_usage_stats: Get usage statisticsget_recent_tool_calls: View recent tool call historygive_feedback_to_desktop_commander: Provide feedbackFor search and replace operations, use this format:
filepath.ext
<<<<<<< SEARCH
content to find
=======
new content
>>>>>>> REPLACE
Specify which shell to use for command execution:
// Using bash specifically
execute_command({ "command": "echo $SHELL", "shell": "/bin/bash" })
For commands that take time:
read_output with PID to get new outputforce_terminate to stop if neededYou can manage server configuration using these tools:
// Get the entire config
get_config({})
// Set a specific config value
set_config_value({ "key": "defaultShell", "value": "/bin/zsh" })
The fileWriteLineLimit setting (default: 50 lines) controls how many lines can be written in a single operation. This encourages efficiency and prevents token waste.
When exact file matches fail, Desktop Commander performs fuzzy search with detailed feedback and logs for analysis. Logs include similarity scores, execution time, and character differences.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "desktop-commander" '{"command":"npx","args":["-y","@wonderwhy-er/desktop-commander"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:
{
"mcpServers": {
"desktop-commander": {
"command": "npx",
"args": [
"-y",
"@wonderwhy-er/desktop-commander"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.json~/.config/Claude/claude_desktop_config.json2. Add this to your configuration file:
{
"mcpServers": {
"desktop-commander": {
"command": "npx",
"args": [
"-y",
"@wonderwhy-er/desktop-commander"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect