Home / MCP / Desktop Commander MCP Server

Desktop Commander MCP Server

Provides control over local filesystem, terminal, and code editing via Claude Desktop through MCP with audit logging and long-running command support.

javascript
Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
    "mcpServers": {
        "desktop_commander": {
            "command": "npx",
            "args": [
                "@wonderwhy-er/desktop-commander@latest",
                "setup"
            ]
        }
    }
}

Desktop Commander MCP lets Claude Desktop run terminal commands, manage processes, edit files, and interact with your local development tools through a dedicated MCP server. It enables end-to-end automation and in-memory code execution with thorough auditing and flexible installation options, so you can tailor a secure, persistent workspace that stays in sync across restarts.

How to use

You interact with the Desktop Commander MCP by installing the server as a local, stdio-based MCP client. After installation, restart Claude Desktop to load the new MCP server. You can then issue natural language requests like “Start a Node.js project and test this API” or “Analyze sales.csv and show top customers.” The MCP translates your requests into terminal commands, file operations, or code-edit actions, and streams results back into Claude’s chat.

How to install

Prerequisites you need before installation are Node.js installed on your machine. You also need Claude Desktop to be running where the MCP will be integrated.

Step 1: Install Desktop Commander MCP using the Node package runner to enable automatic updates and easy setup.

npx @wonderwhy-er/desktop-commander@latest setup

Step 2: If you want debugging during setup, run the setup command with the debug flag to enable the Node.js inspector.

npx @wonderwhy-er/desktop-commander@latest setup --debug

Step 3: To uninstall Desktop Commander MCP automatically, run the following uninstall command.

npx @wonderwhy-er/desktop-commander@latest remove

Additional installation options and notes

The project offers multiple methods for installation, but only the automated npx-based setup is described here as a straightforward, auto-updating option. If you prefer other installation paths, follow the corresponding steps for those methods and restart Claude Desktop after setup.

Configuration and usage notes

After installation, you can manage the MCP server configuration from Claude Desktop using the provided tooling. You can adjust settings related to the server’s behavior, onboarding prompts, and how the CLI interacts with terminal sessions. Keep in mind that terminal commands can still access files outside configured directories, so exercise caution with sensitive paths.

Security and maintenance

For production security, consider Docker installation to isolate the MCP server from your host system. Automatic updates are supported for the primary installation path, ensuring you stay on the latest version after each restart.

Examples and common tasks

Common tasks you can perform include:

  • Get and modify server configuration with get_config and set_config_value
  • Run long-running processes and manage sessions with start_process and list_sessions
  • Read and write files with read_file and write_file
  • Search and replace text across multiple files with edit_block
  • Analyze data in CSV/JSON files using in-memory code execution
  • Audit tool usage with get_usage_stats and get_recent_tool_calls

Available tools

get_config

Fetch the complete server configuration as JSON, including blocked commands, default shell, allowed directories, and telemetry settings.

set_config_value

Update a specific configuration value by key. Supported keys include blockedCommands, defaultShell, allowedDirectories, fileReadLineLimit, fileWriteLineLimit, telemetryEnabled.

start_process

Launch a program with smart readiness detection so Claude can interact with it when it’s ready for input.

interact_with_process

Send commands to a running process and receive responses to drive interactive sessions.

read_file

Read contents from local files or URLs with pagination and support for positive and negative offsets.

read_multiple_files

Read several files in parallel to gather data quickly.

write_file

Write file contents with options for rewrite or append mode, honoring line limits.

create_directory

Create a directory or ensure it exists before subsequent operations.

list_directory

Provide a recursive listing of files and directories with adjustable depth.

move_file

Move or rename files and directories within the filesystem.

start_search

Start a ripgrep-based search across files by name or content patterns and stream results.

get_more_search_results

Fetch subsequent pages of an active search session.

stop_search

Gracefully stop an active search session.

list_searches

List all active search sessions.

get_file_info

Retrieve detailed metadata for a given file or directory.

edit_block

Apply surgical or broad text edits with detailed diffs and multi-occurrence support.

get_usage_stats

Provide usage statistics for your own analysis and optimization.

get_recent_tool_calls

Display recent tool calls with arguments and outputs for debugging.

give_feedback_to_desktop_commander

Open a feedback form to send suggestions or report issues.