šŸ”Œ

DesktopCommanderMCP

Desktop Automation•⭐ 6,858

MCP server that gives Claude terminal control, file system search, and diff file editing capabilities.

Claude DesktopCursorClaude Code

Overview

MCP server that gives Claude terminal control, file system search, and diff file editing capabilities.

Setup

Run with npx:

npx -y @wonderwhy-er/desktop-commander

Configuration

Add to claude_desktop_config.json mcpServers configuration

Documentation

DesktopCommanderMCP: Terminal Control for Claude

Overview

DesktopCommanderMCP (6,858 stars) is an MCP server that gives Claude desktop-level control: terminal command execution, file system search, and diff-based file editing. Built in TypeScript by wonderwhy-er, it bridges the gap between Claude's native capabilities and full desktop automation, enabling Claude Desktop users to interact with their local environment in ways previously only available to Claude Code.

Features

  • Terminal control: Execute arbitrary shell commands with full output capture and streaming
  • File system search: Recursive glob and regex search across the entire file system
  • Diff-based editing: Intelligent file editing with preview, rollback, and conflict detection
  • TypeScript implementation: Fast, typed, well-documented codebase that's easy to extend
  • Claude Desktop integration: Seamless setup with Claude Desktop's MCP configuration

Installation

Add to your claude_desktop_config.json:

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

Available Tools

ToolDescription
execute_commandRun a shell command and capture output
search_filesRecursively search files using glob or regex patterns
edit_fileApply diff-based edits to files with preview
read_fileRead file contents with line range support
list_directoryList directory contents with metadata

Usage Examples

Terminal Control

Execute: "npm run build" in the project directory
→ DesktopCommanderMCP runs the command and streams output back to Claude

File Search

Find all TypeScript files containing "TODO" in the src directory
→ DesktopCommanderMCP performs a recursive regex search

File Editing

Add error handling to the login function
→ DesktopCommanderMCP reads the file, applies diff edits, and shows the result

Why It Matters

DesktopCommanderMCP addresses a critical gap: Claude's limited access to the local environment. While Claude Code has built-in terminal access, Claude Desktop (and other GUI-based Claude clients) lack it. DesktopCommanderMCP provides that missing capability, enabling Claude to:

  • Manage files and directories
  • Run scripts and build commands
  • Interact with the operating system
  • Edit code with intelligent diff-based changes

The project's rapid growth (+349 stars today) confirms that this is a widely needed capability.

Pros

  • āœ… Gives Claude Desktop the terminal access it was missing
  • āœ… Intelligent diff-based editing with rollback support
  • āœ… TypeScript implementation for reliability and extensibility
  • āœ… Easy setup with standard MCP configuration

Cons

  • āŒ Requires npx/node.js runtime
  • āŒ Full terminal access has security implications
  • āŒ Windows compatibility may vary for some commands

Resources