CLI (Computer Commander) MCP server

Integrates terminal and filesystem capabilities for executing system commands, managing processes, and performing advanced file operations on the local system.
Back to servers
Provider
Eduard Ruzga
Release date
Jan 08, 2025
Language
TypeScript
Stats
3.0K stars

Desktop Commander MCP is a powerful tool that enables Claude to access your file system and terminal, transforming it into a versatile AI assistant for executing commands, managing processes, working with files, and automating tasks - all without additional API token costs.

Installation

Option 1: Install through npx

Run this command in your terminal:

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

For debugging mode:

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

Option 2: Using bash script installer (macOS)

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

Option 3: Installing via Smithery

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

Option 4: Add to claude_desktop_config manually

Add this entry to your claude_desktop_config.json file located at:

  • 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"
      ]
    }
  }
}

Option 5: Checkout locally

git clone https://github.com/wonderwhy-er/DesktopCommanderMCP.git
cd DesktopCommanderMCP
npm run setup

Updating Desktop Commander

When installed through npx or Smithery, Desktop Commander automatically updates to the latest version when you restart Claude.

Usage

Available Tools

Desktop Commander provides tools in several categories:

Configuration Tools:

  • get_config: View current configuration
  • set_config_value: Update configuration settings

Terminal Tools:

  • execute_command: Run terminal commands
  • read_output: Get output from running commands
  • force_terminate: End a terminal session
  • list_sessions: View active sessions
  • list_processes: See running processes
  • kill_process: Terminate a process by PID

Filesystem Tools:

  • read_file: View file contents (local or URL)
  • read_multiple_files: Open several files at once
  • write_file: Create or update files
  • create_directory: Make new folders
  • list_directory: View folder contents
  • move_file: Rename or relocate files
  • search_files: Find files by name
  • search_code: Look for text patterns in files
  • get_file_info: View file metadata

Text Editing Tools:

  • edit_block: Make precise text replacements

Text Editing with Search/Replace Block

For making targeted changes to files, use this format:

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

Example:

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

Configuration Management

Security Warnings

  1. Always change configuration in a separate chat window from your work.
  2. The allowedDirectories setting only restricts filesystem operations, not terminal commands.

Managing Configuration

// View current config
get_config({})

// Change shell preference
set_config_value({ "key": "defaultShell", "value": "/bin/zsh" })

// Set allowed directories
set_config_value({ "key": "allowedDirectories", "value": ["/Users/username/projects"] })

Using Different Shells

// Default shell
execute_command({ "command": "echo $SHELL" })

// Specific shell
execute_command({ "command": "echo $SHELL", "shell": "/bin/zsh" })

Handling Long-Running Commands

  1. Use execute_command with appropriate timeout
  2. Get the PID from the response
  3. Use read_output with that PID to check progress
  4. Use force_terminate if needed

URL Support

The read_file tool can fetch content from both local files and URLs by setting the isUrl parameter to true.

Audit Logging

All tool calls are automatically logged with timestamps and arguments to:

  • macOS/Linux: ~/.claude-server-commander/claude_tool_call.log
  • Windows: %USERPROFILE%\.claude-server-commander\claude_tool_call.log

Privacy and Telemetry

Desktop Commander collects limited anonymous telemetry data by default. To opt out, simply ask in chat:

Disable telemetry

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later