Get the FREE Ultimate OpenClaw Setup Guide →

DesktopCommanderMCP

This is MCP server for Claude that gives it terminal control, file system search and diff file editing capabilities

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio wonderwhy-er-desktopcommandermcp npx -y @wonderwhy-er/desktop-commander@latest

How to use

Desktop Commander MCP exposes a workspace that lets you search, edit, and manage files on your machine while running terminal commands through AI. It integrates with host environments to provide in-memory code execution, file previews, and advanced file operations across plain text, PDFs, Word and Excel documents, and more. You can interact with long-running processes, start and monitor background tasks, and perform dynamic configuration changes without restarting the server. In practice, you can ask the AI to locate specific files, edit documents, execute terminal commands with streaming output, or analyze data in CSV/JSON/Excel formats, all while maintaining a detailed audit trail of tool usage.

The server supports remote AI control via MCP clients, including Claude Desktop and Claude-based workflows, and offers features like process management, recursive directory listing, content search inside files (including Excel content), and secure file I/O with safeguards against symlink traversal and restricted command sets. Use the tools to search file contents, edit or rewrite documents, run scripts in memory, and extract or transform data without leaving the conversation context.

How to install

Prerequisites:

  • Node.js (LTS) and npm installed on the host system
  • Access to run npx from the command line

Installation steps:

  1. Ensure Node.js and npm are installed. Verify with: node -v npm -v

  2. Install the Desktop Commander MCP server via npx (this will fetch the package and set up the MCP server client access): npx @wonderwhy-er/desktop-commander@latest setup

  3. If you prefer a manual setup path, you can install the MCP client without triggering auto-updates by running the same npx command with the desired arguments, or use the provided install scripts in the README from the project page.

  4. Start using the MCP server with your preferred MCP client (Claude Desktop, Claude Web, etc.). Ensure the client is configured to connect to the server name "desktop-commander" as defined in the MCP config.

  5. If you want to run the server in an alternative environment (e.g., via npm script or direct Node.js invocation), refer to the npm package page for additional run instructions and environment considerations.

Additional notes

Tips and considerations:

  • The MCP server is designed to work with various MCP clients; ensure the client is configured to point at the same server name (desktop-commander).
  • Environment variables can be used to control feature flags, paths, or authentication in your hosting environment; add them under the env object if you need to pass placeholders, e.g., {"ENV_VAR": "description"}.
  • For long-running commands, leverage the server’s session and background execution features to avoid timeouts and keep streaming output available.
  • If you encounter path or permission issues, verify the host user permissions and ensure the MCP service has the necessary access rights to read/write files.
  • When updating, you can re-run the setup command to pull the latest version; the server supports dynamic configuration changes without a restart in many cases.

Related MCP Servers

Sponsor this space

Reach thousands of developers