Turn Claude into your command-line co-pilot — no coding required.


What You'll Learn

By the end of this guide, you'll have Claude Cowork (Claude Desktop) controlling your terminal like a boss. That means:

  • Running Claude Code commands automatically
  • Executing terminal operations hands-free
  • Managing files, searching your system, and editing code — all through natural conversation

What is Desktop Commander?

Desktop Commander is an MCP (Model Context Protocol) server that gives Claude Desktop superpowers:

  • Terminal control — run any command
  • File system search — find files instantly
  • Diff-based editing — make precise code changes
  • Process management — start, stop, and monitor programs

Think of it as giving Claude hands to actually do things on your computer, not just talk about them.

🔗 GitHub Repo: wonderwhy-er/DesktopCommanderMCP


Prerequisites

Before we start, make sure you have:

Quick Check

Open your terminal and run:

node --version

If you see a version number (like v20.x.x), you're good to go.


Step-by-Step Setup

Step 1: Install Desktop Commander

The easiest way is using the automated setup. Open your terminal and run:

npx @anthropic/desktop-commander-mcp setup

Or install directly via npm:

npx @anthropic-ai/desktop-commander-mcp
💡 Tip: This method auto-updates, so you'll always have the latest features.

Step 2: Configure Claude Desktop

Locate your Claude Desktop config file:

Mac:

~/Library/Application Support/Claude/claude_desktop_config.json

Windows:

%APPDATA%\Claude\claude_desktop_config.json

Add Desktop Commander to your MCP servers:

{
  "mcpServers": {
    "desktop-commander": {
      "command": "npx",
      "args": ["-y", "@anthropic-ai/desktop-commander-mcp"]
    }
  }
}

Step 3: Restart Claude Desktop

Completely quit Claude Desktop and reopen it. This loads the new MCP server configuration.


Step 4: Verify It's Working

  1. Open Claude Desktop
  2. Look for the "+" icon (Add files, connectors, and more)
  3. Hover over "Connectors"
  4. You should see desktop-commander listed

If you see it — congrats! Claude is now your terminal boss. 🎉


Using Claude to Control Claude Code

Now for the magic. With Desktop Commander active, you can tell Claude things like:

Start Claude Code

"Open Claude Code in my project folder"

Run Commands

"Run 'claude --help' in the terminal"

Execute Code Tasks

"Use Claude Code to refactor the main.py file"

Monitor Processes

"Show me what's running in the terminal"

Claude will execute these commands and report back the results — all through natural conversation.


Example Workflow: The Boss Setup

Here's a real workflow where Claude Cowork controls Claude Code:

  1. You: "Navigate to my /projects/app folder"
  2. Claude: Changes directory, confirms location
  3. You: "Start Claude Code and ask it to add error handling to server.js"
  4. Claude: Launches Claude Code, passes the instruction
  5. You: "Show me the diff of what changed"
  6. Claude: Displays the code changes
  7. You: "Commit these changes with message 'Added error handling'"
  8. Claude: Runs git commit

You're literally bossing an AI that bosses another AI. Welcome to the future. 🚀


Troubleshooting

Server not showing up?

  • Make sure Node.js is installed
  • Double-check your config file path and JSON syntax
  • Fully restart Claude Desktop (not just close the window)

Permission issues?

  • Desktop Commander needs access to your terminal
  • On Mac, you may need to grant Terminal permissions in System Settings → Privacy & Security

Commands failing?

  • Check that the command works in your normal terminal first
  • Some commands may need full paths

Safety Notes

With great power comes great responsibility.

Desktop Commander gives Claude real control over your system. Be mindful of:

  • Reviewing commands before Claude executes them
  • Not running destructive commands on important files
  • Understanding what each command does

Claude will typically ask for confirmation on risky operations, but stay alert.


What's Next?

Now that you've got Claude as your terminal boss, try these:

  • Automate repetitive tasks — "Every time I say 'deploy', run these 5 commands"
  • Pair program — Let Claude Code write, while Claude Cowork manages your project
  • System maintenance — "Clean up my downloads folder" or "Find large files"

Resources