Desktop Commander

The Desktop Commander MCP server enables AI assistants like the Claude desktop app to execute terminal commands, manage processes, and perform file system operations through the Model Context Protocol (MCP).

It’s built on top of the MCP Filesystem Server and extends functionality to include advanced search and replace capabilities for code editing.

Features

    • πŸ–₯️ Execute terminal commands with output streaming
    • ⏱️ Command timeout and background execution support
    • πŸ”„ Process management (list and kill processes)
    • πŸ“ Full filesystem operations (read/write, create/list, move)
    • πŸ” Advanced code search using vscode-ripgrep
    • ✏️ Precise code editing with surgical text replacements
    • πŸ“Š Session management for long-running commands
    • πŸ”’ Configurable command blacklist for security

    Use Cases

      • Exploring and refactoring large, complex codebases across multiple projects simultaneously
      • Automating repetitive development tasks through custom terminal commands and scripts
      • Performing system-wide code searches and making precise, context-aware modifications
      • Managing long-running processes like build jobs or data processing tasks directly from Claude

      Installation

      1. Ensure you have the Claude Desktop app and npm installed.

      2. Choose one of the following installation methods:

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

        OR Add the following to your claude_desktop_config.json:

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

          Usage

          Terminal Tools:

            • execute_command: Run commands with configurable timeout
            • read_output: Get output from long-running commands
            • force_terminate: Stop running 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: File operations
              • create_directory/list_directory: Directory management
              • move_file: Move/rename files
              • search_files: Pattern-based file search
              • get_file_info: File metadata
              • code_search: Recursive ripgrep based text and code search

              Edit Tools:

                • edit_block: Apply surgical text replacements
                • write_file: Complete file rewrites

                For code editing, use the following format:

                filepath.ext
                <<<<<<< SEARCH
                existing code to replace
                =======
                new code to insert
                >>>>>>> REPLACE

                FAQS

                  Q: How does Desktop Commander MCP differ from IDE-specific tools like Cursor or Windsurf?
                  A: Desktop Commander MCP works across your entire operating system, not just within a specific IDE. It allows Claude to read entire files, work on multiple projects simultaneously, and execute changes in a single operation, providing a more holistic and efficient development experience.

                  Q: Do I need to pay for additional API credits to use Desktop Commander MCP?
                  A: No, Desktop Commander MCP works with the standard Claude Desktop Pro subscription ($20/month). You won’t incur any additional costs beyond the subscription fee.

                  Q: Can I use Desktop Commander MCP to interact with remote servers?
                  A: Currently, Desktop Commander MCP is designed for local use. However, support for SSH and remote server command execution is planned for future updates.

                  Q: How does the code search functionality work?
                  A: Desktop Commander MCP uses vscode-ripgrep for recursive code or text search in folders. This provides fast, context-aware results that can help you quickly navigate and understand large codebases.

                  Q: Is there a way to limit which commands or directories Desktop Commander MCP can access for security reasons?
                  A: Yes, Desktop Commander MCP includes a configurable command blacklist feature. Additionally, work is in progress to improve configurations for allowed paths, commands, and shell environments to enhance security and customization options.

                  Latest MCP Servers

                  Notion

                  Notion's official MCP Server allows you to interact with Notion workspaces through the Notion API.

                  Log Mcp

                  An MCP server that provides 7 tools for log analysis, including error fingerprinting, pattern comparison, and ML classification.

                  Apple

                  An MCP package that provides AI assistants with direct access to Notes, Messages, Mail, Contacts, Reminders, Calendar, and Maps via AppleScript and EventKit.

                  View More MCP Servers >>

                  Featured MCP Servers

                  Notion

                  Notion's official MCP Server allows you to interact with Notion workspaces through the Notion API.

                  Claude Peers

                  An MCP server that enables Claude Code instances to discover each other and exchange messages instantly via a local broker daemon with SQLite persistence.

                  Excalidraw

                  Excalidraw's official MCP server that streams interactive hand-drawn diagrams to Claude, ChatGPT, and VS Code with smooth camera control and fullscreen editing.

                  More Featured MCP Servers >>

                  FAQs

                  Q: What exactly is the Model Context Protocol (MCP)?

                  A: MCP is an open standard, like a common language, that lets AI applications (clients) and external data sources or tools (servers) talk to each other. It helps AI models get the context (data, instructions, tools) they need from outside systems to give more accurate and relevant responses. Think of it as a universal adapter for AI connections.

                  Q: How is MCP different from OpenAI's function calling or plugins?

                  A: While OpenAI's tools allow models to use specific external functions, MCP is a broader, open standard. It covers not just tool use, but also providing structured data (Resources) and instruction templates (Prompts) as context. Being an open standard means it's not tied to one company's models or platform. OpenAI has even started adopting MCP in its Agents SDK.

                  Q: Can I use MCP with frameworks like LangChain?

                  A: Yes, MCP is designed to complement frameworks like LangChain or LlamaIndex. Instead of relying solely on custom connectors within these frameworks, you can use MCP as a standardized bridge to connect to various tools and data sources. There's potential for interoperability, like converting MCP tools into LangChain tools.

                  Q: Why was MCP created? What problem does it solve?

                  A: It was created because large language models often lack real-time information and connecting them to external data/tools required custom, complex integrations for each pair. MCP solves this by providing a standard way to connect, reducing development time, complexity, and cost, and enabling better interoperability between different AI models and tools.

                  Q: Is MCP secure? What are the main risks?

                  A: Security is a major consideration. While MCP includes principles like user consent and control, risks exist. These include potential server compromises leading to token theft, indirect prompt injection attacks, excessive permissions, context data leakage, session hijacking, and vulnerabilities in server implementations. Implementing robust security measures like OAuth 2.1, TLS, strict permissions, and monitoring is crucial.

                  Q: Who is behind MCP?

                  A: MCP was initially developed and open-sourced by Anthropic. However, it's an open standard with active contributions from the community, including companies like Microsoft and VMware Tanzu who maintain official SDKs.

                  Get the latest & top AI tools sent directly to your email.

                  Subscribe now to explore the latest & top AI tools and resources, all in one convenient newsletter. No spam, we promise!