MCPcopy Index your code
hub / github.com/wonderwhy-er/DesktopCommanderMCP

github.com/wonderwhy-er/DesktopCommanderMCP @v0.2.43 sqlite

repository ↗ · DeepWiki ↗ · release v0.2.43 ↗
1,407 symbols 4,279 edges 184 files 411 documented · 29%
README

Desktop Commander MCP

Search, update, manage files and run terminal commands with AI

npm downloads AgentAudit Verified Trust Score smithery badge Buy Me A Coffee

Discord

Work with code and text, run processes, and automate tasks, going far beyond other AI editors - while using host client subscriptions instead of API token costs.

Desktop Commander MCP

🖥️ Try the Desktop Commander App (Beta)

Want a better experience? The Desktop Commander App gives you everything the MCP server does, plus:

  • Use any AI model — Claude, GPT-4.5, Gemini 2.5, or any model you prefer
  • See file changes live — visual file previews as AI edits your files
  • Add custom MCPs and context — extend with your own tools, no config files
  • Coming soon — skills system, dictation, background scheduled tasks, and more

👉 Download the App (macOS & Windows)

The MCP server below still works great with Claude Desktop and other MCP clients — the app is for those who want a dedicated, polished experience.

Table of Contents

All of your AI development tools in one place. Desktop Commander puts all dev tools in one chat. Execute long-running terminal commands on your computer and manage processes through Model Context Protocol (MCP). Built on top of MCP Filesystem Server to provide additional search and replace file editing capabilities.

Features

  • Remote AI Control - Use Desktop Commander from ChatGPT, Claude web, and other AI services via Remote MCP
  • File Preview UI - Visual file previews in Claude Desktop with rendered markdown, inline images, expandable content, built-in markdown editor, and quick "Open in folder" access
  • Enhanced terminal commands with interactive process control
  • Execute code in memory (Python, Node.js, R) without saving files
  • Instant data analysis - just ask to analyze CSV/JSON/Excel files
  • Native Excel file support - Read, write, edit, and search Excel files (.xlsx, .xls, .xlsm) without external tools
  • PDF support - Read PDFs with text extraction, create new PDFs from markdown, modify existing PDFs
  • DOCX support - Read, create, edit, and search Word documents (.docx) with surgical XML editing and markdown-to-DOCX conversion
  • Interact with running processes (SSH, databases, development servers)
  • Execute terminal commands with output streaming
  • Command timeout and background execution support
  • Process management (list and kill processes)
  • Session management for long-running commands
  • Process output pagination - Read terminal output with offset/length controls to prevent context overflow
  • Server configuration management:
  • Get/set configuration values
  • Update multiple settings at once
  • Dynamic configuration changes without server restart
  • Full filesystem operations:
  • Read/write files (text, Excel, PDF, DOCX)
  • Create/list directories
  • Recursive directory listing with configurable depth and context overflow protection for large folders
  • Move files/directories
  • Search files and content (including Excel content)
  • Get file metadata
  • Negative offset file reading: Read from end of files using negative offset values (like Unix tail)
  • Code editing capabilities:
  • Surgical text replacements for small changes
  • Full file rewrites for major changes
  • Multiple file support
  • Pattern-based replacements
  • vscode-ripgrep based recursive code or text search in folders
  • Comprehensive audit logging:
  • All tool calls are automatically logged
  • Log rotation with 10MB size limit
  • Detailed timestamps and arguments
  • Security hardening:
  • Symlink traversal prevention on file operations
  • Command blocklist with bypass protection
  • Docker isolation for full sandboxing
  • See SECURITY.md for details

How to install

Install in Claude Desktop

Desktop Commander offers multiple installation methods for Claude Desktop.

📋 Update & Uninstall Information: Options 1, 2, 3, 4, and 6 have automatic updates. Option 5 requires manual updates. See below for details.

Option 1: Install through npx ⭐ Auto-Updates (Requires Node.js)

Just run this in terminal:

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

For debugging mode (allows Node.js inspector connection):

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

Command line options during setup: - --debug: Enable debugging mode for Node.js inspector - --no-onboarding: Disable onboarding prompts for new users

Restart Claude if running.

✅ Auto-Updates: Yes - automatically updates when you restart Claude
🔄 Manual Update: Run the setup command again
🗑️ Uninstall: Run npx @wonderwhy-er/desktop-commander@latest remove

Option 2: Using bash script installer (macOS) ⭐ Auto-Updates (Installs Node.js if needed)

curl -fsSL https://raw.githubusercontent.com/wonderwhy-er/DesktopCommanderMCP/refs/heads/main/install.sh | bash

This script handles all dependencies and configuration automatically.

✅ Auto-Updates: Yes
🔄 Manual Update: Re-run the bash installer command above
🗑️ Uninstall: Run npx @wonderwhy-er/desktop-commander@latest remove

Option 3: Installing via Smithery ⭐ Auto-Updates (Requires Node.js)

  1. Visit: https://smithery.ai/server/@wonderwhy-er/desktop-commander
  2. Login to Smithery if you haven't already
  3. Select your client (Claude Desktop) on the right side
  4. Install with the provided key that appears after selecting your client
  5. Restart Claude Desktop

✅ Auto-Updates: Yes - automatically updates when you restart Claude
🔄 Manual Update: Visit the Smithery page and reinstall

Option 4: Add to claude_desktop_config manually ⭐ Auto-Updates (Requires Node.js)

Add this entry to your claude_desktop_config.json:

  • On Mac: ~/Library/Application Support/Claude/claude_desktop_config.json
  • On Windows: %APPDATA%\Claude\claude_desktop_config.json
  • On Linux: ~/.config/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "desktop-commander": {
      "command": "npx",
      "args": [
        "-y",
        "@wonderwhy-er/desktop-commander@latest"
      ]
    }
  }
}

Restart Claude if running.

✅ Auto-Updates: Yes - automatically updates when you restart Claude
🔄 Manual Update: Run the setup command again
🗑️ Uninstall: Run npx @wonderwhy-er/desktop-commander@latest remove or remove the entry from your claude_desktop_config.json

Option 5: Checkout locally ❌ Manual Updates (Requires Node.js)

git clone https://github.com/wonderwhy-er/DesktopCommanderMCP.git
cd DesktopCommanderMCP
npm run setup

Restart Claude if running.

The setup command will install dependencies, build the server, and configure Claude's desktop app.

❌ Auto-Updates: No - requires manual git updates
🔄 Manual Update: cd DesktopCommanderMCP && git pull && npm run setup
🗑️ Uninstall: Run npx @wonderwhy-er/desktop-commander@latest remove or remove the cloned directory and MCP server entry from Claude config

Option 6: Docker Installation 🐳 ⭐ Auto-Updates (No Node.js Required)

Perfect for users who want isolation or don't have Node.js installed. Runs in a sandboxed Docker container with a persistent work environment.

Prerequisites: Docker Desktop installed and running, Claude Desktop app installed.

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'))

The installer will check Docker, pull the image, prompt for folder mounting, and configure Claude Desktop.

Docker persistence: Your tools, configs, work files, and package caches all survive restarts.

Manual Docker Configuration

Basic setup (no file access):

{
  "mcpServers": {
    "desktop-commander-in-docker": {
      "command": "docker",
      "args": ["run", "-i", "--rm", "mcp/desktop-commander:latest"]
    }
  }
}

With folder mounting:

{
  "mcpServers": {
    "desktop-commander-in-docker": {
      "command": "docker",
      "args": [
        "run", "-i", "--rm",
        "-v", "/Users/username/Desktop:/mnt/desktop",
        "-v", "/Users/username/Documents:/mnt/documents",
        "mcp/desktop-commander:latest"
      ]
    }
  }
}

Advanced folder mounting:

{
  "mcpServers": {
    "desktop-commander-in-docker": {
      "command": "docker",
      "args": [
        "run", "-i", "--rm",
        "-v", "dc-system:/usr",
        "-v", "dc-home:/root", 
        "-v", "dc-workspace:/workspace",
        "-v", "dc-packages:/var",
        "-v", "/Users/username/Projects:/mnt/Projects",
        "-v", "/Users/username/Downloads:/mnt/Downloads",
        "mcp/desktop-commander:latest"
      ]
    }
  }
}

Docker Management Commands

macOS/Linux:

# Check status
bash <(curl -fsSL https://raw.githubusercontent.com/wonderwhy-er/DesktopCommanderMCP/refs/heads/main/install-docker.sh) --status

# Reset all persistent data
bash <(curl -fsSL https://raw.githubusercontent.com/wonderwhy-er/DesktopCommanderMCP/refs/heads/main/install-docker.sh) --reset

Windows PowerShell:

# Check status
$script = (New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/wonderwhy-er/DesktopCommanderMCP/refs/heads/main/install-docker.ps1'); & ([ScriptBlock]::Create("$script")) -Status

# Reset all data
$script = (New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/wonderwhy-er/DesktopCommanderMCP/refs/heads/main/install-docker.ps1'); & ([ScriptBlock]::Create("$script")) -Reset

# Show help
$script = (New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/wonderwhy-er/DesktopCommanderMCP/refs/heads/main/install-docker.ps1'); & ([ScriptBlock]::Create("$script")) -Help

Troubleshooting: Reset and reinstall from scratch:

bash <(curl -fsSL https://raw.githubusercontent.com/wonderwhy-er/DesktopCommanderMCP/refs/heads/main/install-docker.sh) --reset && bash <(curl -fsSL https://raw.githubusercontent.com/wonderwhy-er/DesktopCommanderMCP/refs/heads/main/install-docker.sh)

✅ Auto-Updates: Yes - latest tag automatically gets newer versions
🔄 Manual Update: docker pull mcp/desktop-commander:latest then restart Claude

Install in Other Clients

Desktop Commander works with any MCP-compatible client. The standard JSON configuration is:

{
  "mcpServers": {
    "desktop-commander": {
      "command": "npx",
      "args": ["-y", "@wonderwhy-er/desktop-commander@latest"]
    }
  }
}

Add this to your client's MCP configuration file at the locations below:

Cursor

Install MCP Server

View MCP Server in Directory

Or add manually to ~/.cursor/mcp.json (global) or .cursor/mcp.json in your project folder (project-specific).

See Cursor MCP docs for more info.

Windsurf

Add to ~/.codeium/windsurf/mcp_config.json. See Windsurf MCP docs for more info.

VS Code / GitHub Copilot

Add to .vscode/mcp.json in your project or VS Code User Settings (JSON). Make sure MCP is enabled under Chat > MCP. Works in Agent mode.

See

Extension points exported contracts — how you extend this code

FileHandler (Interface)
(no doc) [9 implementers]
src/utils/files/base.ts
WidgetStateStorage (Interface)
(no doc) [6 implementers]
src/ui/shared/widget-state.ts
ShellSpawnConfig (Interface)
* Configuration for spawning a shell with appropriate flags
src/terminal-manager.ts
ServerConfig (Interface)
(no doc)
src/config-manager.ts
LogNotification (Interface)
(no doc)
src/custom-stdio.ts
SearchResult (Interface)
(no doc)
src/search-manager.ts
ProcessInfo (Interface)
(no doc)
src/types.ts
Prompt (Interface)
(no doc)
src/tools/prompts.ts

Core symbols most depended-on inside this repo

log
called by 1248
src/utils/fuzzySearchLogger.ts
assert
called by 104
test/test-search-code.js
on
called by 83
test/test-remote-channel-reconnect.js
capture
called by 67
src/utils/capture.ts
setValue
called by 54
src/config-manager.ts
logToFile
called by 52
uninstall-claude-server.js
getConfig
called by 45
src/config-manager.ts
get
called by 41
src/utils/feature-flags.ts

Shape

Function 1,027
Method 223
Interface 113
Class 44

Languages

TypeScript100%

Modules by API surface

src/ui/file-preview/src/markdown/editor.ts60 symbols
src/ui/file-preview/src/markdown/controller.ts52 symbols
src/ui/config-editor/src/app.ts40 symbols
test/integration/edit-block-performance.js31 symbols
src/tools/filesystem.ts31 symbols
src/search-manager.ts28 symbols
src/utils/usageTracker.ts27 symbols
test/test-remote-channel-reconnect.js26 symbols
test/test-markdown-editor-roundtrip.js26 symbols
src/remote-device/remote-channel.ts25 symbols
src/utils/files/docx.ts24 symbols
scripts/publish-release.cjs24 symbols

Dependencies from manifests, versioned

@anthropic-ai/mcpb1.2.0 · 1×
@modelcontextprotocol/ext-apps1.0.1 · 1×
@modelcontextprotocol/sdk1.9.0 · 1×
@opendocsg/pdf2md0.2.2 · 1×
@tiptap/core3.22.3 · 1×
@tiptap/extension-image3.22.3 · 1×
@tiptap/extension-table3.22.4 · 1×
@tiptap/extension-table-cell3.22.4 · 1×
@tiptap/extension-table-header3.22.4 · 1×
@tiptap/extension-table-row3.22.4 · 1×
@tiptap/pm3.22.3 · 1×

For agents

$ claude mcp add DesktopCommanderMCP \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact