De

DesktopCommanderMCP

Enhanced file-system and search tools, commands and prompts specific for coding.

PublisherDesktopCommanderMCP
Submitted date4/13/2025

Desktop Commander MCP: Supercharge Claude with System-Level Control πŸš€

Unleash the full potential of Claude by granting it seamless access to your file system, terminal, and more. Elevate your AI-powered workflows with Desktop Commander MCP!

npm downloads smithery badge Buy Me A Coffee Discord Product Hunt

Key Capabilities: Execute terminal commands, perform diff-based file editing, leverage ripgrep for lightning-fast text search, and even read files directly from URLs.

Desktop Commander MCP Claude Desktop Commander MCP server

πŸ’‘ Overview

Desktop Commander MCP bridges the gap between Large Language Models (LLMs) and your local environment, empowering Claude to interact directly with your operating system. Built upon the Model Context Protocol (MCP), this server provides a secure and standardized interface for Claude to execute commands, manage files, and perform advanced code editing tasks. Imagine Claude as your intelligent co-pilot, capable of understanding and manipulating your system with precision and context.

🧭 Table of Contents

✨ Core Features

Desktop Commander MCP unlocks a suite of powerful capabilities for Claude:

  • Terminal Command Execution: Execute shell commands directly from Claude, with real-time output streaming. Configure command timeouts and run processes in the background for maximum flexibility.
  • Process Management: Gain complete control over your system processes. List running processes, terminate unresponsive applications, and manage command sessions with ease.
  • Comprehensive Filesystem Operations: Seamlessly interact with your file system. Read and write files, create and list directories, move files, search for specific files, and retrieve detailed file metadata.
  • Advanced Code Editing: Implement surgical code changes with precision. Perform targeted text replacements for minor adjustments or rewrite entire files for major refactoring. Supports multiple files and pattern-based replacements.
  • Blazing-Fast Code Search: Leverage the power of vscode-ripgrep for recursive code and text searches within folders. Quickly locate specific code snippets or patterns across your entire codebase.
  • URL Support: Read content directly from URLs, enabling Claude to analyze web pages, access remote data, and even display images directly within the interface.

πŸ› οΈ Installation Guide

Before you begin, ensure you have the Claude Desktop app installed and Node.js with npm properly configured.

Choose your preferred installation method:

Option 1: Streamlined Installation with npx

The quickest and easiest way to install Desktop Commander:

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

For debugging purposes (enables Node.js inspector):

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

Remember to restart Claude after installation.

Option 2: Automated Bash Script (macOS)

For macOS users, this script automates the entire process:

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

This script handles dependency checks, Node.js installation (if needed), and automatic configuration.

Option 3: Smithery Integration

Install Desktop Commander seamlessly using Smithery:

npx -y @smithery/cli install @wonderwhy-er/desktop-commander --client claude

Option 4: Manual Configuration

Add the following entry to your claude_desktop_config.json file:

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

Restart Claude after making changes to the configuration file.

Option 5: Local Checkout and Build

For advanced users who want to contribute or customize the code:

  1. Clone the repository:

    git clone https://github.com/wonderwhy-er/ClaudeComputerCommander.git cd ClaudeComputerCommander
  2. Run the setup script:

    npm run setup

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

πŸ”„ Updating Desktop Commander

When installed via npx or Smithery, Desktop Commander automatically updates to the latest version upon restarting Claude. For manual installations, simply rerun the setup command.

πŸš€ Harnessing the Power: Usage Examples

Desktop Commander provides a rich set of tools, categorized for easy access:

Terminal Tools

  • execute_command: Execute commands with configurable timeout.
  • read_output: Retrieve output from long-running commands.
  • force_terminate: Terminate active command sessions.
  • list_sessions: View active command sessions.
  • list_processes: View system processes.
  • kill_process: Terminate processes by PID.
  • block_command/unblock_command: Manage command blacklist.

Filesystem Tools

  • read_file/write_file: Read files from the local filesystem or URLs (supports viewing PNG, JPEG, GIF, and WebP images directly in Claude).
  • create_directory/list_directory: Manage directories.
  • move_file: Move or rename files and directories.
  • search_files: Perform pattern-based file searches.
  • get_file_info: Retrieve file metadata.
  • search_code: Execute recursive ripgrep-based text and code searches.

Edit Tools

  • edit_block: Apply surgical text replacements (ideal for changes affecting less than 20% of the file).
  • write_file: Rewrite entire files (best for large changes exceeding 20% or when edit_block fails).

Search/Replace Block Format:

filepath.ext
<<<<<<< SEARCH
content to find
=======
new content
>>>>>>> REPLACE

Example:

src/main.js
<<<<<<< SEARCH
console.log("old message");
=======
console.log("new message");
>>>>>>> REPLACE

URL Support

  • read_file can now fetch content from both local files and URLs.
  • Use the isUrl: true parameter with read_file to read from web resources.
  • Supports both text and image content from remote sources.
  • Images (local or from URLs) are displayed visually in Claude's interface.
  • Default 30-second timeout for URL requests.

βš™οΈ Mastering Long-Running Commands

For commands that require extended execution times:

  1. execute_command returns after the timeout with initial output.
  2. The command continues running in the background.
  3. Use read_output with the process ID (PID) to retrieve new output.
  4. Use force_terminate to stop the command if necessary.

πŸ› Debugging Strategies

To debug the server, install it in debug mode:

# Using npx npx @wonderwhy-er/desktop-commander@latest setup --debug # Or if installed locally npm run setup:debug

This configures Claude to use a separate "desktop-commander" server, enables the Node.js inspector protocol, and pauses execution until a debugger connects.

Connecting a Debugger:

  • Chrome: Visit chrome://inspect and locate the Node.js instance.
  • VS Code: Use the "Attach to Node Process" debug configuration.

Important Debugging Notes:

  • The server pauses on startup until a debugger connects.
  • Ensure you're connected to the correct Node.js process (port 9229).
  • The debug server is identified as "desktop-commander-debug" in Claude's MCP server list.

ζ·±ε…₯ Model Context Protocol Deep Dive

This project extends the MCP Filesystem Server to provide:

  • Local server support in Claude Desktop.
  • Full system command execution.
  • Process management.
  • File operations.
  • Code editing with search/replace blocks.

This project was created as part of exploring Claude MCPs: https://youtube.com/live/TlbjFDbl5Us

βœ… Recent Updates

  • 07-04-2025: Added URL support - read_file command can now fetch content from URLs.
  • 28-03-2025: Fixed "Watching /" JSON error - Implemented custom stdio transport to handle non-JSON messages and prevent server crashes.
  • 25-03-2025: Better code search - Enhanced code exploration with context-aware results (merged).

πŸ—ΊοΈ Roadmap: Future Enhancements

The following features are currently under development or planned:

  • Better configurations - Improved settings for allowed paths, commands, and shell environment (in progress).
  • Windows environment fixes - Resolving issues specific to Windows platforms (in progress).
  • Linux improvements - Enhancing compatibility with various Linux distributions (in progress).
  • Support for WSL - Windows Subsystem for Linux integration.
  • Support for SSH - Remote server command execution.
  • Installation troubleshooting guide - Comprehensive help for setup issues.

🌐 Explore the Ecosystem: Media & Community

πŸ—£οΈ Real-World Impact: Testimonials

It's a life saver! I paid Claude + Cursor currently which I always feel it's kind of duplicated. This solves the problem ultimately. I am so happy. Thanks so much. Plus today Claude has added the web search support. With this MCP + Internet search, it writes the code with the latest updates. It's so good when Cursor doesn't work sometimes or all the fast requests are used. https://www.youtube.com/watch?v=ly3bed99Dy8&lc=UgyyBt6_ShdDX_rIOad4AaABAg

This is the first comment I've ever left on a youtube video, THANK YOU! I've been struggling to update an old Flutter app in Cursor from an old pre null-safety version to a current version and implemented null-safety using Claude 3.7. I got most of the way but had critical BLE errors that I spent days trying to resolve with no luck. I tried Augment Code but it didn't get it either. I implemented your MCP in Claude desktop and was able to compare the old and new codebase fully, accounting for the updates in the code, and fix the issues in a couple of hours. A word of advice to people trying this, be sure to stage changes and commit when appropriate to be able to undo unwanted changes. Amazing! https://www.youtube.com/watch?v=ly3bed99Dy8&lc=UgztdHvDMqTb9jiqnf54AaABAg

Great! I just used Windsurf, bought license a week ago, for upgrading old fullstack socket project and it works many times good or ok but also many times runs away in cascade and have to revert all changes losing hundereds of cascade tokens. In just a week down to less than 100 tokens and do not want to buy only 300 tokens for 10$. This Claude MCP ,bought claude Pro finally needed but wanted very good reason to also have next to ChatGPT, and now can code as much as I want not worrying about token cost.
Also this is much more than code editing it is much more thank you for great video! https://www.youtube.com/watch?v=ly3bed99Dy8&lc=UgyQFTmYLJ4VBwIlmql4AaABAg

it is a great tool, thank you, I like using it, as it gives claude an ability to do surgical edits, making it more like a human developer. https://www.youtube.com/watch?v=ly3bed99Dy8&lc=Ugy4-exy166_Ma7TH-h4AaABAg

You sir are my hero. You've pretty much summed up and described my experiences of late, much better than I could have. Cursor and Windsurf both had me frustrated to the point where I was almost yelling at my computer screen. Out of whimsy, I thought to myself why not just ask Claude directly, and haven't looked back since.
Claude first to keep my sanity in check, then if necessary, engage with other IDEs, frameworks, etc. I thought I was the only one, glad to see I'm not lol.
33
1 https://medium.com/@pharmx/you-sir-are-my-hero-62cff5836a3e

❓ Frequently Asked Questions (FAQ)

For a comprehensive list of frequently asked questions, please refer to our detailed FAQ document.

Key FAQs:

  • What is Claude Desktop Commander? It's an MCP tool that empowers Claude Desktop to access your file system and terminal, transforming Claude into a versatile assistant for coding, automation, and codebase exploration.
  • How does it differ from Cursor/Windsurf? Unlike IDE-centric tools, Desktop Commander offers a solution-focused approach that integrates with your entire OS.
  • Do I need to pay for API credits? No, it works with Claude Desktop's standard Pro subscription.
  • Does Desktop Commander automatically update? Yes, when installed via npx or Smithery.
  • What are the most common use cases? Codebase exploration, diagram generation, task automation, and surgical code changes.
  • Where can I get help? Join our Discord server, check the GitHub issues, or review the full FAQ.

🀝 Contributing to the Project

We welcome contributions from the community! Please consider giving the project a ⭐ star on GitHub to help others discover it.

  • Found a bug? Open an issue at github.com/wonderwhy-er/ClaudeComputerCommander/issues.
  • Have a feature idea? Submit a feature request in the issues section.
  • Want to contribute code? Fork the repository, create a branch, and submit a pull request.
  • Questions or discussions? Start a discussion in the GitHub Discussions tab.

If you find this tool valuable, please consider supporting the project.

πŸ“Š Data Collection Practices

During installation and setup, Desktop Commander collects anonymous usage data to improve the tool. This includes:

  • Operating system information
  • Node.js and NPM versions
  • Installation method and shell environment
  • Error messages (if any occur during setup)

This data is collected using PostHog analytics and is associated with a machine-generated unique ID. No personal information is collected.

We are working on adding a built-in opt-out option. For now, you can block network connections to eu.i.posthog.com in your firewall settings.

Visit More

View All