Desktop Commander MCP
by luffy666code
README.md
<div align="center">
# ๐ฅ๏ธ Desktop Commander MCP
### Portable, general-purpose filesystem + terminal tools for MCP clients
[](https://github.com/luffy666code/desktop-commander-mcp/actions/workflows/ci.yml)
[](LICENSE)
[](https://nodejs.org/)
[](https://modelcontextprotocol.io/)
**Search files ยท edit documents ยท run commands ยท manage processes ยท inspect the local workspace**
**English** ยท [็ฎไฝไธญๆ](README_zh-CN.md)
</div>
> A community-maintained portable adaptation of [Desktop Commander MCP](https://github.com/wonderwhy-er/DesktopCommanderMCP).
> It is designed for standard **stdio-compatible MCP clients** and does not depend on any vendor-specific deployment platform.
---
## โจ Highlights
| Capability | What it gives your AI client |
|---|---|
| ๐ Filesystem | Read, write, move, list, search, and inspect files and directories |
| ๐ Fast search | Recursive content search powered by ripgrep |
| ๐ป Terminal | Run shell commands, stream output, and handle long-running processes |
| โ๏ธ Process control | List, inspect, and terminate processes |
| ๐ Editing | Targeted text replacement and larger file rewrites |
| ๐ Documents | Excel, PDF, DOCX, Markdown, text, and binary-aware file handling |
| ๐งฐ Configuration | Runtime configuration plus a conservative default command blocklist |
| ๐ Cross-platform | Windows, Linux, and macOS source installs with runtime ripgrep resolution |
## ๐ Quick start
### 1. Clone
```bash
git clone https://github.com/luffy666code/desktop-commander-mcp.git
cd desktop-commander-mcp
```
### 2. Install and build
```bash
npm install
npm run build
```
Requirements: **Node.js 18+** and npm.
### 3. Verify the search engine
```bash
npm run verify:rg
```
### 4. Add it to your MCP client
Use the standard stdio configuration pattern:
```json
{
"mcpServers": {
"desktop-commander": {
"command": "node",
"args": ["/absolute/path/to/desktop-commander-mcp/dist/index.js"]
}
}
}
```
Replace the path with the real absolute path on your machine. See **[Client setup](docs/CLIENT_SETUP.md)** for Windows path examples and Inspector usage.
## ๐งญ How it works
```text
MCP client
โ
โ stdio / MCP requests
โผ
dist/index.js
โ
โผ
server + tool handlers
โ
โโโ filesystem operations
โโโ terminal / process manager
โโโ document utilities
โโโ search manager
โ
โผ
ripgrep
```
The ripgrep resolver first checks the platform-correct binary in `@vscode/ripgrep`, then falls back to the package export, the system `PATH`, and common installation locations. On Unix-like systems it also verifies executable permission.
## ๐ Safety defaults
`config.json` ships with a conservative blocklist for destructive or privilege-escalating commands such as `format`, `mkfs`, `fdisk`, `dd`, `sudo`, and user-management commands.
```json
{
"blockedCommands": [
"format", "mount", "umount", "mkfs", "fdisk", "dd",
"sudo", "su", "passwd", "adduser", "useradd", "usermod", "groupadd"
]
}
```
This is a guardrail, **not a sandbox**. Review [SECURITY.md](SECURITY.md) before using command execution against important data or production machines.
## ๐ ๏ธ Development
```bash
# TypeScript watch mode
npm run watch
# Run from TypeScript during development
npm run dev
# Compile
npm run build
# Start compiled server
npm start
# Open MCP Inspector
npm run inspector
```
### Project layout
```text
src/
โโโ index.ts # process entry point
โโโ server.ts # MCP server and tool registration
โโโ handlers/ # request handlers
โโโ tools/ # filesystem, edit, process, PDF and other tools
โโโ search-manager.ts # search orchestration
โโโ terminal-manager.ts # command/session management
โโโ utils/
โโโ ripgrep-resolver.ts # cross-platform ripgrep discovery
```
## ๐ Portability notes
For normal use, run `npm install` on the **same OS/architecture where the MCP server will run** so native dependencies are installed correctly.
The repository also contains an optional Linux x86-64 ripgrep binary under `tools/Linux/rg` for custom portable packaging workflows. It is **not required** for ordinary source installs. See [tools/README.md](tools/README.md).
## ๐ค Upstream & attribution
This repository is derived from **Desktop Commander MCP** by Eduard Ruzga and contributors:
- Upstream: https://github.com/wonderwhy-er/DesktopCommanderMCP
- License: MIT
Portable packaging and ripgrep-resolution adjustments in this fork are maintained separately. Upstream trademarks, services, and release channels are not implied to endorse this fork.
See [LICENSE](LICENSE) and [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).
## ๐ License
MIT License. See [LICENSE](LICENSE).
---
<div align="center">
Built for developers who want a straightforward, local-first MCP tool server.
</div>
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo issues