Desktop Commander MCP: Terminal & File Control for AI
Desktop Commander MCP server is a Model Context Protocol server that hands Claude — and any MCP-compatible client — control of your terminal, filesystem, and code edits. It runs commands, searches and edits files with surgical diffs, and can execute Python, Node, or R in memory, all driven from a chat window instead of a separate editor.
Reach for Desktop Commander if you want your AI chat to actually run commands and edit files on your machine — build, test, refactor, analyze a CSV — without paying per-token API costs, since per the README it rides your existing Claude subscription. Skip it if you're uneasy giving an AI shell access to your real filesystem, or you'd rather stay inside a purpose-built editor like Cursor than drive everything from a chat window.
The problem it solves
Most AI coding help lives behind a copy-paste wall: the model suggests a command or a diff, and you're the one who runs it, pastes the output back, and repeats. That round-trip is slow, and API-based agents also meter every token. Desktop Commander closes the loop by giving the model direct terminal and file access through MCP, so it can run the command, read the result, and edit the file itself.
What is it?
Desktop Commander MCP server is an open-source (MIT) MCP server, written in TypeScript, that gives an AI client terminal control, filesystem search, and diff-based file editing. It's built on top of the official MCP Filesystem Server and adds command execution, process management, in-memory code running, and document handling. Because it works over the Model Context Protocol, it plugs into Claude Desktop, Claude Code, Cursor, VS Code, and other MCP clients, and per the README it uses the host client's subscription rather than a paid API key.
Why it's getting attention
With 7,661 stars, Desktop Commander sits in the fast-growing MCP-server space. Its pitch — run terminal commands and edit files from your existing Claude subscription instead of metered API tokens — resonates with people who want agent-style automation without a per-token bill. The README also promotes a newer Desktop Commander app and a Remote MCP mode that reaches ChatGPT and Claude web, widening where the same tooling runs.
Key features
- ✓Terminal command execution with output streaming, timeouts, and background/long-running process support
- ✓Diff-based file editing — surgical text replacements for small changes, full rewrites for big ones, plus ripgrep-powered code search
- ✓In-memory code execution for Python, Node.js, and R without saving a script first
- ✓Native reading and editing of Excel, PDF, and DOCX files, plus instant CSV/JSON analysis
- ✓Interaction with running processes — SSH sessions, databases, and dev servers — with session management
- ✓Security hardening: symlink-traversal prevention, a command blocklist, audit logging, and optional Docker sandboxing
- ✓Remote MCP mode to use it from ChatGPT, Claude web, and other services, not just a local desktop app
Best use cases
- •Letting Claude build a project, run tests, and fix errors without copy-pasting terminal output back and forth
- •Analyzing a CSV, JSON, or Excel file by asking the AI to load and crunch it in memory
- •Editing existing PDFs or Word documents, or generating new ones from markdown
- •Debugging against a live process — an SSH session, a database shell, or a running dev server
- •Running an AI dev workflow on your Claude subscription instead of paying metered API costs
How to install / try
Install it into Claude Desktop with one command: `npx @wonderwhy-er/desktop-commander@latest setup`, then restart Claude. The README documents several other paths — a macOS bash installer, Smithery, a manual `claude_desktop_config.json` entry, a local `git clone` + `npm run setup`, and a Docker option that needs no Node.js. For Claude Code, run `claude mcp add --scope user desktop-commander -- npx -y @wonderwhy-er/desktop-commander@latest`. Uninstall with `npx @wonderwhy-er/desktop-commander@latest remove`.
How to use
Once installed, you talk to your AI client normally and it calls Desktop Commander's tools as needed — running a terminal command, searching a folder, or editing a file with a diff. The README shows config snippets for many clients (Cursor, Windsurf, VS Code/Copilot, Cline, Gemini CLI, Codex, and more), all using the same `npx -y @wonderwhy-er/desktop-commander@latest` command. Long-running commands stream output and can run in the background, and output pagination keeps large results from overflowing the model's context.
Strengths
- ✓Uses your existing Claude (or other client) subscription instead of metered API tokens, per the README
- ✓One MCP server covers terminal, filesystem, code execution, and Office/PDF documents — fewer separate tools
- ✓Works across many clients (Claude Desktop, Claude Code, Cursor, VS Code, Gemini CLI) through the same config
- ✓Open source under MIT, with audit logging and a command blocklist you can inspect
- ✓Multiple install paths, including a Docker option that sandboxes it and needs no local Node.js
Limitations & risks
- △Giving an AI direct shell and filesystem access is inherently risky; the blocklist and symlink guards help, but you're trusting the model with real commands on your machine
- △Most install paths require Node.js, and the smoothest updates depend on the npx or Docker options — the local git checkout needs manual `git pull` updates
- △It's a terminal/file layer, not a polished editor UI; the richer visual experience (live file previews, any-model support) is pushed toward the separate Desktop Commander app
- △Behavior depends on the host AI client and model — Desktop Commander exposes the tools, but how well a task goes still rides on the model driving them
Alternatives
Who should try it — and who should skip
Developers who live in Claude Desktop or Claude Code and want the AI to actually execute commands and edit files — not just suggest them — will get the most out of Desktop Commander, especially to avoid per-token API costs. If you're not comfortable granting shell access to your filesystem, or you prefer a dedicated editor like Cursor over driving work from a chat window, it's a weaker fit.
Frequently asked questions
Desktop Commander is an open-source MCP server that gives Claude and other AI clients terminal control, filesystem search, and diff-based file editing. It runs commands, edits files, and can execute Python, Node, or R code in memory, all from a chat interface.
The tool is free and open source under MIT. Per the README, it runs on your host client's subscription (like Claude Desktop) rather than a paid API key, so you're not billed per token for its actions.
Any MCP-compatible client. The README lists setups for Claude Desktop, Claude Code, Cursor, Windsurf, VS Code/Copilot, Cline, Gemini CLI, and Codex, plus a Remote MCP mode for ChatGPT and Claude web.
There's real risk. Desktop Commander adds symlink-traversal prevention, a command blocklist with bypass protection, audit logging, and an optional Docker sandbox, but you're still trusting the model with commands on your machine, so scope and review matter.
The quickest path is `npx @wonderwhy-er/desktop-commander@latest setup` for Claude Desktop, then restart Claude. Other options include a bash installer, Smithery, Docker, and `claude mcp add` for Claude Code.