Home / MCP / 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.
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.
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.
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 setupStep 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 --debugStep 3: To uninstall Desktop Commander MCP automatically, run the following uninstall command.
npx @wonderwhy-er/desktop-commander@latest removeThe 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.
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.
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.
Common tasks you can perform include:
Fetch the complete server configuration as JSON, including blocked commands, default shell, allowed directories, and telemetry settings.
Update a specific configuration value by key. Supported keys include blockedCommands, defaultShell, allowedDirectories, fileReadLineLimit, fileWriteLineLimit, telemetryEnabled.
Launch a program with smart readiness detection so Claude can interact with it when it’s ready for input.
Send commands to a running process and receive responses to drive interactive sessions.
Read contents from local files or URLs with pagination and support for positive and negative offsets.
Read several files in parallel to gather data quickly.
Write file contents with options for rewrite or append mode, honoring line limits.
Create a directory or ensure it exists before subsequent operations.
Provide a recursive listing of files and directories with adjustable depth.
Move or rename files and directories within the filesystem.
Start a ripgrep-based search across files by name or content patterns and stream results.
Fetch subsequent pages of an active search session.
Gracefully stop an active search session.
List all active search sessions.
Retrieve detailed metadata for a given file or directory.
Apply surgical or broad text edits with detailed diffs and multi-occurrence support.
Provide usage statistics for your own analysis and optimization.
Display recent tool calls with arguments and outputs for debugging.
Open a feedback form to send suggestions or report issues.