How to Integrate Desktop Commander MCP with Claude Desktop and ChatGPT for Remote AI Control

Desktop Commander MCP is an MCP (Model Context Protocol) server that exposes file-system and terminal tools to AI clients, enabling both local control via Claude Desktop and remote control via ChatGPT through a cloud-hosted relay service.

Desktop Commander MCP, developed by wonderwhy-er, bridges the gap between AI assistants and your local machine by implementing the Model Context Protocol. When you integrate Desktop Commander MCP with Claude Desktop and ChatGPT, you grant these AI systems the ability to read files, execute terminal commands, and manage processes directly on your host. The repository provides both local MCP server configuration for native desktop clients and a remote device mode for browser-based AI interactions.

Understanding the Desktop Commander MCP Architecture

Desktop Commander MCP operates as a Node.js process that listens for JSON-encoded tool calls from MCP-compatible clients. According to the wonderwhy-er/DesktopCommanderMCP source code, the server implementation in src/version.ts exposes version metadata for client compatibility checks, while src/utils/logger.ts maintains a centralized audit log of every tool invocation. The architecture isolates command execution to your controlled host, using src/utils/withTimeout.ts to enforce timeouts on long-running operations and prevent hanging processes.

The server configuration resides in server.json, which defines blocked commands, allowed directories, and shell settings. When a client initiates a connection, it references the metadata declared in plugin.yaml and plugin.json to discover available tools and their schemas.

Local Integration with Claude Desktop

For local AI control, Claude Desktop connects directly to a running MCP server instance on your machine.

Configuring claude_desktop_config.json

To enable the integration, add the Desktop Commander MCP server entry to Claude Desktop's configuration file. On macOS, this file is located at ~/Library/Application Support/Claude/claude_desktop_config.json; Windows and Linux use equivalent paths.

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

After saving the configuration, restart Claude Desktop. The client will spawn the server process using the npx command specified in package.json, which executes the setup script and initializes the tool registry.

How Local Tool Execution Works

When you request a file listing or command execution, Claude Desktop sends an RPC call such as list_directory or start_process to the local MCP server. The server validates the request against server.json security policies, executes the command on the host, and streams the output back to Claude's UI. For resource-intensive operations, the server applies timeouts via the withTimeout utility to ensure responsiveness.

Remote AI Control with ChatGPT and Claude Web

Remote integration allows browser-based AI services like ChatGPT or Claude Web to control your desktop without installing a native client.

Setting Up the Remote Device

The remote device acts as a lightweight bridge between your local machine and the cloud-hosted Remote MCP service at mcp.desktopcommander.app. To activate this mode, run the installation script with the --remote flag.

On Linux or macOS:

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

On Windows PowerShell:

iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/wonderwhy-er/DesktopCommanderMCP/refs/heads/main/install-docker.ps1')) -Remote

These scripts, defined in install-docker.sh and the PowerShell equivalent, register your device with the remote service and output a connection link. Paste this link into ChatGPT or Claude Web to establish the session.

The Remote MCP Relay Architecture

In remote mode, AI services send tool calls to mcp.desktopcommander.app, which forwards the requests to your local remote device. The device then communicates with the local MCP server to execute commands, read files, or spawn processes. OAuth-based authentication secures the connection, while src/utils/logger.ts records every interaction for auditability. This design enables remote AI control without exposing your machine directly to the internet or requiring firewall modifications.

Configuring Other MCP Clients

Desktop Commander MCP supports any MCP-compatible IDE or editor. For Cursor, place the following configuration in ~/.cursor/mcp.json or a project-specific .cursor/mcp.json file:

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

The plugin.yaml file in the repository root declares the server metadata that IDEs consume for tool discovery and integration.

Available Tools and Execution Flow

Desktop Commander MCP exposes a comprehensive toolset including read_file, write_file, list_directory, start_process, and execute_command. A typical interaction follows this sequence:

  1. The AI client sends a JSON-RPC request containing the tool name and arguments, such as:

    {
      "tool": "list_directory",
      "arguments": {
        "path": "/Users/you/Downloads",
        "depth": 2
      }
    }
  2. The MCP server receives the request through the local socket (Claude Desktop) or the remote relay (ChatGPT).

  3. The server validates permissions against server.json, executes the operation, and captures output.

  4. Results stream back to the AI client, where Claude Desktop renders file previews (markdown, images, PDFs) in its native widgets or ChatGPT displays the text response.

Summary

  • Desktop Commander MCP implements the Model Context Protocol to expose file-system and terminal tools to AI clients.
  • Local integration requires adding an npx-based server configuration to claude_desktop_config.json for Claude Desktop, or similar files for other IDEs like Cursor.
  • Remote control uses a dedicated device process that registers with mcp.desktopcommander.app, enabling ChatGPT and Claude Web to execute commands on your machine via OAuth-secured relay.
  • Security features include command blocklists in server.json, timeout enforcement in src/utils/withTimeout.ts, and comprehensive audit logging in src/utils/logger.ts.
  • The server runs as a Node.js process installable via npx @wonderwhy-er/desktop-commander@latest or Docker containers defined in the repository's installation scripts.

Frequently Asked Questions

What is Desktop Commander MCP?

Desktop Commander MCP is an open-source Model Context Protocol server developed by wonderwhy-er that allows AI assistants to interact with your local file system and terminal. It exposes tools for reading files, executing commands, and managing processes, acting as a bridge between AI clients like Claude Desktop and your operating system.

Is it safe to allow AI access to my file system?

The server implements multiple security layers: server.json allows you to define blocked commands and restricted directories, src/utils/logger.ts records every tool call for audit trails, and the remote mode uses OAuth authentication. However, you should only grant access to directories you are comfortable exposing, and review the blocked commands list to prevent destructive operations.

Can I use Desktop Commander MCP with ChatGPT on mobile?

Yes, through the Remote MCP feature. By running the remote device on your computer (using install-docker.sh --remote or the PowerShell equivalent), you can connect mobile ChatGPT sessions to your desktop. The AI communicates via the cloud relay at mcp.desktopcommander.app, allowing you to manage files and run commands from your phone while the actual execution happens on your host machine.

How do I block specific commands or directories?

Edit the server.json configuration file to specify blocked commands and allowed directory patterns. The server validates every tool call against these rules before execution, preventing access to sensitive system paths or execution of dangerous shell commands. Changes take effect immediately without requiring a server restart.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →