Desktop Commander MCP Installation Methods: 6 Ways to Set Up
You can install Desktop Commander MCP via npx, bash script, Smithery, manual JSON config, local checkout, or Docker, with five of six methods supporting automatic updates.
Desktop Commander MCP provides six distinct installation paths to accommodate different environments and security preferences. Whether you need a quick one-line setup or a fully isolated container, the wonderwhy-er/DesktopCommanderMCP repository offers automated scripts and manual configuration options. All methods integrate with Claude Desktop except the local checkout, which requires manual update management.
Six Methods to Install Desktop Commander MCP
Option 1: Install via npx (Node.js Required)
The fastest way to get started uses the npx command to fetch and execute the latest package from the npm registry. This method automatically configures Claude Desktop and enables auto-updates through the package.json definition.
npx @wonderwhy-er/desktop-commander@latest setup
Add the --debug flag to enable inspector mode during installation. The entry point at src/index.ts orchestrates the configuration loading and tool registration during this process.
Option 2: Bash Script Installer (macOS/Linux)
For Unix-based systems, the repository provides install.sh, a curl-to-bash script that handles dependency detection and Claude Desktop configuration. If Node.js is missing, the script installs it automatically.
curl -fsSL https://raw.githubusercontent.com/wonderwhy-er/DesktopCommanderMCP/refs/heads/main/install.sh | bash
This approach mirrors the npx method but adds system-level dependency management through the automated installer.
Option 3: Install via Smithery (Node.js Required)
Smithery offers a graphical installation interface that generates the required secret key for Claude Desktop.
- Navigate to https://smithery.ai/server/@wonderwhy-er/desktop-commander
- Select your Claude Desktop client and click Install
- Restart Claude Desktop to load the new server
The Smithery UI injects configuration entries identical to those created by the npx setup command, referencing the same package.json metadata.
Option 4: Manual claude_desktop_config.json Entry (Node.js Required)
Advanced users can manually edit Claude Desktop's configuration file. Add the following JSON block to claude_desktop_config.json (location varies by OS: ~/Library/Application Support/Claude/ on macOS, %APPDATA%\Claude\ on Windows, or ~/.config/Claude/ on Linux):
{
"mcpServers": {
"desktop-commander": {
"command": "npx",
"args": [
"-y",
"@wonderwhy-er/desktop-commander@latest"
]
}
}
}
This method requires restarting Claude Desktop to load the new MCP server configuration.
Option 5: Local Checkout (Manual Updates)
For development or air-gapped environments, clone the repository and run the setup script locally. This method does not support auto-updates.
git clone https://github.com/wonderwhy-er/DesktopCommanderMCP.git
cd DesktopCommanderMCP
npm run setup
Update manually by running git pull && npm run setup when new versions are released, as the package.json version constraints will not automatically fetch updates.
Option 6: Docker Installation (No Node.js Required)
Docker provides complete isolation without requiring Node.js on the host system. The repository includes install-docker.sh for macOS/Linux and install-docker.ps1 for Windows.
macOS/Linux:
bash <(curl -fsSL https://raw.githubusercontent.com/wonderwhy-er/DesktopCommanderMCP/refs/heads/main/install-docker.sh)
Windows PowerShell:
iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/wonderwhy-er/DesktopCommanderMCP/refs/heads/main/install-docker.ps1'))
The Dockerfile defines the container image with the MCP server runtime, while the installer scripts mount persistent volumes for tools, configs, and caches. This method supports auto-updates through container recreation from the latest image.
Key Installation Source Files
The following files in the wonderwhy-er/DesktopCommanderMCP repository handle the installation logic:
install.sh– Bash installer for Option 2; handles Node.js detection and Claude Desktop configuration generationinstall-docker.sh– Docker installer for Unix systems (Option 6) that pulls the image and configures MCP settingsinstall-docker.ps1– PowerShell installer for Windows Docker setuppackage.json– Defines npm scripts and dependencies required for Node-based installations (Options 1-5)Dockerfile– Defines the container image used in Option 6 with tool dependencies and the server runtime
Programmatic Configuration Example
You can automate the JSON configuration using Node.js. This example updates the macOS Claude Desktop config:
const fs = require('fs');
const os = require('os');
const path = require('path');
function addMcpConfig() {
const cfgPath = path.join(os.homedir(), 'Library', 'Application Support', 'Claude', 'claude_desktop_config.json');
const config = JSON.parse(fs.readFileSync(cfgPath, 'utf8'));
config.mcpServers = config.mcpServers || {};
config.mcpServers['desktop-commander'] = {
command: 'npx',
args: ['-y', '@wonderwhy-er/desktop-commander@latest']
};
fs.writeFileSync(cfgPath, JSON.stringify(config, null, 2));
}
addMcpConfig();
To remove Desktop Commander MCP regardless of installation method, run:
npx @wonderwhy-er/desktop-commander@latest remove
Summary
- Six installation methods accommodate different technical requirements: npx, bash script, Smithery, manual JSON, local checkout, and Docker
- Five methods support auto-updates via the npm registry or Docker Hub; only local checkout requires manual
git pull - Node.js is optional when using the Docker installation, which provides full isolation through
install-docker.shorinstall-docker.ps1 - Uninstallation is unified through the
removecommand regardless of which installation method you originally chose
Frequently Asked Questions
Does Desktop Commander MCP require Node.js to run?
Node.js is required for all installation methods except Docker. Options 1, 3, 4, and 5 require Node.js on the host system, while Option 2 (bash script) will install Node.js automatically if it is missing. The Docker installation (Option 6) bundles Node.js inside the container and requires only Docker Engine on the host.
Which installation method supports automatic updates?
All methods except local checkout (Option 5) support automatic updates. The npx, bash script, Smithery, and manual JSON methods automatically pull the latest version from the npm registry on startup. The Docker method (Option 6) updates when you recreate the container from the latest image. Only the local checkout method requires manual git pull and npm run setup to update.
How do I uninstall Desktop Commander MCP?
Run the unified remove command regardless of your original installation method:
npx @wonderwhy-er/desktop-commander@latest remove
This command removes the configuration from claude_desktop_config.json and cleans up associated files. For Docker installations, you can also manually remove the container and image using standard Docker commands.
Can I install Desktop Commander MCP on Windows?
Yes. Windows users can install via npx (requires Node.js), Smithery, manual JSON configuration, or Docker using the install-docker.ps1 PowerShell script. The bash script installer (Option 2) is designed for macOS and Linux only, but Windows Subsystem for Linux (WSL) can run it if Node.js is managed within that environment.
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:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →