Desktop Commander
Расширьте возможности десктопного приложения Claude с Desktop Commander! Выполняйте терминальные команды, управляйте файлами, редактируйте код и легко интегрируйтесь с MCP. Получите больше контроля уже сегодня!
Desktop Commander расширяет возможности десктопного приложения Claude, предоставляя выполнение команд терминала с потоковым выводом, управление процессами и полноценные операции с файловой системой. Он позволяет выполнять точечные замены текста и полные перезаписи файлов, поддерживая множественные файлы и замены по шаблону. Построенный на основе MCP Filesystem Server, он обеспечивает бесшовную интеграцию с Claude, предлагая расширенное редактирование кода и управление на уровне системы.
Ключевые возможности
Сценарии использования
Short version. Two key things. Terminal commands and diff based file editing.
- Features
- Installation
- Usage
- Handling Long-Running Commands
- Work in Progress and TODOs
- Media links
- Testimonials
- Contributing
- License
This is server that allows Claude desktop app to execute long-running terminal commands on your computer and manage processes through Model Context Protocol (MCP) + Built on top of MCP Filesystem Server to provide additional search and replace file editing capabilities .
- Execute terminal commands with output streaming
- Command timeout and background execution support
- Process management (list and kill processes)
- Session management for long-running commands
- Full filesystem operations:
- Read/write files
- Create/list directories
- Move files/directories
- Search files
- Get file metadata
- Code editing capabilities:
- Surgical text replacements for small changes
- Full file rewrites for major changes
- Multiple file support
- Pattern-based replacements
- vscode-ripgrep based recursive code or text search in folders
First, ensure you've downloaded and installed the Claude Desktop app and you have npm installed.
To install Desktop Commander for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @wonderwhy-er/desktop-commander --client claudeJust run this in terminal
npx @wonderwhy-er/desktop-commander setup
Restart Claude if running
Add this entry to your claude_desktop_config.json (on Mac, found at ~/Library/Application\ Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"desktop-commander": {
"command": "npx",
"args": [
"-y",
"@wonderwhy-er/desktop-commander"
]
}
}
}Restart Claude if running
- Clone and build:
git clone https://github.com/wonderwhy-er/ClaudeComputerCommander.git
cd ClaudeComputerCommander
npm run setupRestart Claude if running
The setup command will:
- Install dependencies
- Build the server
- Configure Claude's desktop app
- Add MCP servers to Claude's config if needed
The server provides these tool categories:
execute_command: Run commands with configurable timeoutread_output: Get output from long-running commandsforce_terminate: Stop running command sessionslist_sessions: View active command sessionslist_processes: View system processeskill_process: Terminate processes by PIDblock_command/unblock_command: Manage command blacklist
read_file/write_file: File operationscreate_directory/list_directory: Directory managementmove_file: Move/rename filessearch_files: Pattern-based file searchget_file_info: File metadatacode_search: Recursive ripgrep based text and code search
edit_block: Apply surgical text replacements (best for changes <20% of file size)write_file: Complete file rewrites (best for large changes >20% or when edit_block fails)
Search/Replace Block Format:
filepath.ext
<<<<<<< SEARCH
existing code to replace
=======
new code to insert
>>>>>>> REPLACE
Example:
src/main.js
<<<<<<< SEARCH
console.log("old message");
=======
console.log("new message");
>>>>>>> REPLACE
For commands that may take a while:
execute_commandreturns after timeout with initial output- Command continues in background
- Use
read_outputwith PID to get new output - Use
force_terminateto stop if needed
This project extends the MCP Filesystem Server to enable:
- Local server support in Claude Desktop
- Full system command execution
- Process management
- File operations
- Code editing with search/replace blocks
Created as part of exploring Claude MCPs: https://youtube.com/live/TlbjFDbl5Us
- 25-03-2025 Better code search (merged) - Enhanced code exploration with context-aware results
The following features are currently being developed or planned:
- Better configurations (in progress) - Improved settings for allowed paths, commands and shell environment
- Windows environment fixes (in progress) - Resolving issues specific to Windows platforms
- Linux improvements (in progress) - Enhancing compatibility with various Linux distributions
- Support for WSL - Windows Subsystem for Linux integration
- Support for SSH - Remote server command execution
- Installation troubleshooting guide - Comprehensive help for setup issues
Visit our official website at https://desktopcommander.app/ for the latest information, documentation, and updates.
Learn more about this project through these resources:
Claude with MCPs replaced Cursor & Windsurf. How did that happen? - A detailed exploration of how Claude with Model Context Protocol capabilities is changing developer workflows.
Claude Desktop Commander Video Tutorial - Watch how to set up and use the Commander effectively.
Join our Discord server to get help, share feedback, and connect with other users.
https://www.youtube.com/watch?v=ly3bed99Dy8&lc=UgyyBt6_ShdDX_rIOad4AaABAg
https://www.youtube.com/watch?v=ly3bed99Dy8&lc=UgztdHvDMqTb9jiqnf54AaABAg
https://www.youtube.com/watch?v=ly3bed99Dy8&lc=UgyQFTmYLJ4VBwIlmql4AaABAg
https://www.youtube.com/watch?v=ly3bed99Dy8&lc=Ugy4-exy166_Ma7TH-h4AaABAg
https://medium.com/@pharmx/you-sir-are-my-hero-62cff5836a3e
If you find this project useful, please consider giving it a ⭐ star on GitHub! This helps others discover the project and encourages further development.
We welcome contributions from the community! Whether you've found a bug, have a feature request, or want to contribute code, here's how you can help:
- Found a bug? Open an issue at github.com/wonderwhy-er/ClaudeComputerCommander/issues
- Have a feature idea? Submit a feature request in the issues section
- Want to contribute code? Fork the repository, create a branch, and submit a pull request
- Questions or discussions? Start a discussion in the GitHub Discussions tab
All contributions, big or small, are greatly appreciated!
If you find this tool valuable for your workflow, please consider supporting the project.
MIT
Desktop Commander MCP
@wonderwhy-er/desktop-commander — MCP-сервер для Claude Desktop, который позволяет выполнять длительные команды в терминале, управлять процессами и редактировать файлы. Основан на MCP Filesystem Server и дополнен возможностью поиска/замены прямо в файлах (diff-based editing), а также поиском кода через ripgrep.
Возможности
- Выполнение команд в терминале с потоковым выводом, таймаутом и фоновым режимом.
- Управление процессами: просмотр списка процессов (
list_processes), принудительное завершение (kill_process,force_terminate). - Управление сессиями для долгих команд: создание, чтение вывода, завершение.
- Операции с файловой системой: чтение/запись файлов, создание/просмотр директорий, перемещение, поиск файлов, получение метаданных.
- Редактирование кода: хирургическая замена фрагментов (до 20% файла) или полная перезапись файла для крупных изменений.
- Поиск кода по папкам на основе ripgrep (vscode-ripgrep).
Установка
Перед установкой убедитесь, что у вас установлены Claude Desktop и npm.
Способ 1: Через Smithery (автоматически)
npx -y @smithery/cli install @wonderwhy-er/desktop-commander --client claude
Способ 2: Через npx
Запустите в терминале:
npx @wonderwhy-er/desktop-commander setup
После этого перезапустите Claude.
Способ 3: Ручная настройка claude_desktop_config.json
Добавьте в claude_desktop_config.json (на Mac путь: ~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"desktop-commander": {
"command": "npx",
"args": ["-y", "@wonderwhy-er/desktop-commander"]
}
}
}
Перезапустите Claude.
Способ 4: Клонирование репозитория
git clone https://github.com/wonderwhy-er/ClaudeComputerCommander.git
cd ClaudeComputerCommander
npm run setup
Скрипт установки автоматически соберёт сервер, установит зависимости и пропишет его в конфигурацию Claude. Перезапустите Claude.
Использование
Сервер предоставляет три группы инструментов:
Терминальные инструменты
execute_command— запуск команды с настраиваемым таймаутом.read_output— получение вывода от фоновой команды.force_terminate— остановка сессии.list_sessions— список активных сессий.list_processes— список системных процессов.kill_process— завершение процесса по PID.block_command/unblock_command— управление чёрным списком команд.
Файловые инструменты
read_file/write_file— чтение/запись.create_directory/list_directory— управление папками.move_file— перемещение/переименование.search_files— поиск файлов по паттерну.get_file_info— метаданные файла.code_search— рекурсивный поиск текста и кода (ripgrep).
Инструменты редактирования
edit_block— замена заданного фрагмента (подходит для изменений менее 20% файла). Формат блока:
путь/к/файлу.ext
<<<<<<< SEARCH
старый код
=======
новый код
>>>>>>> REPLACE
write_file— полная перезапись файла (для изменений >20% или еслиedit_blockне сработал).
Пример edit_block:
src/main.js
<<<<<<< SEARCH
console.log("old message");
=======
console.log("new message");
>>>>>>> REPLACE
Работа с долгими командами
Если команда выполняется дольше таймаута:
execute_commandвозвращает начальный вывод после таймаута.- Команда продолжает работать в фоне.
- Вызовите
read_outputс PID, чтобы получить новый вывод. - При необходимости используйте
force_terminateдля остановки.
Что уже сделано (на 25.03.2025)
- Улучшенный поиск кода с контекстными результатами.
В разработке / планы
- Гибкие настройки разрешённых путей, команд и окружения (in progress).
- Исправления для Windows и Linux.
- Поддержка WSL и SSH.
- Подробное руководство по устранению неполадок.
Полезные ссылки
- Официальный сайт: desktopcommander.app
- Статья на Medium: «Claude with MCPs replaced Cursor & Windsurf»
- Видео-туториал: YouTube
- Discord-сообщество: присоединиться
- Поддержать проект: Buy Me a Coffee
Лицензия
MIT.
Что такое Model Context Protocol (MCP) и как Desktop Commander его использует?
MCP позволяет Claude взаимодействовать с внешними инструментами и серверами. Desktop Commander использует MCP, чтобы дать Claude возможность выполнять команды, управлять файлами и редактировать код на вашем компьютере, расширяя его возможности за пределы простого текстового взаимодействия.
Каковы варианты использования Desktop Commander?
Desktop Commander полезен для разработчиков, которые хотят использовать Claude для таких задач, как автоматизация скриптов, управление серверными процессами, редактирование кода, поиск конкретных файлов или фрагментов кода, а также выполнение сложных задач системного администрирования непосредственно из интерфейса Claude.
Что такое Desktop Commander?
Desktop Commander расширяет возможности десктопного приложения Claude, позволяя ему выполнять терминальные команды, управлять процессами, выполнять операции с файлами и редактировать код непосредственно в вашей системе с помощью Model Context Protocol (MCP).
Как установить Desktop Commander?
Вы можете установить Desktop Commander с помощью Smithery, npm, ручной настройки `claude_desktop_config.json` или клонировав репозиторий GitHub и запустив скрипт установки. Подробные инструкции доступны в README.
Какие функции предлагает Desktop Commander?
Ключевые функции включают выполнение терминальных команд с потоковым выводом, управление процессами (список и завершение), полный набор операций с файлами (чтение, запись, создание, перемещение, поиск) и возможности редактирования кода с хирургической заменой текста или полной перезаписью файлов.
Get Config
Get the complete server configuration as JSON. Config includes fields for: - blockedCommands (array of blocked shell commands) ...
Set Config Value
Set a specific configuration value by key. WARNING: Should be used in a separate chat from file operations and ...
Parameters
2keystringvalueanyRead File
Read the contents of a file from the file system or a URL with optional offset and length parameters. Prefer this over 'execut...
Parameters
4pathstringisUrlbooleanlengthnumberoffsetnumberRead Multiple Files
Read the contents of multiple files simultaneously. Each file's content is returned with its path as a reference. ...
Parameters
1pathsarrayWrite File
Write or append to file contents. CHUNKING IS STANDARD PRACTICE: Always write files in chunks of 25-30 lines maximum. This is...
Parameters
3pathstringcontentstringCreate Directory
Create a new directory or ensure a directory exists. Can create multiple nested directories in one operation. ...
Parameters
1pathstringList Directory
Get a detailed listing of all files and directories in a specified path. Use this instead of 'execute_command' with ls/dir com...
Parameters
2pathstringdepthnumberMove File
Move or rename files and directories. Can move files between directories and rename them in a single operation. ...
Parameters
2sourcestringdestinationstringStart Search
Start a streaming search that can return results progressively. SEARCH STRATEGY GUIDE: Choose the righ...
Parameters
11pathstringpatternstringignoreCasebooleanmaxResultsnumberGet More Search Results
Get more results from an active search with offset-based pagination. Supports partial result reading with: ...
Parameters
3lengthnumberoffsetnumbersessionIdstringStop Search
Stop an active search. Stops the background search process gracefully. Use this when you've found what...
Parameters
1sessionIdstringList Searches
List all active searches. Shows search IDs, search types, patterns, status, and runtime. Similar to li...
Get File Info
Retrieve detailed metadata about a file or directory including: - size - creation time - last modified ...
Parameters
1pathstringEdit Block
Apply surgical text replacements to files. BEST PRACTICE: Make multiple small, focused edits rather than one large edit. ...
Parameters
4file_pathstringnew_stringstringold_stringstringexpected_replacementsnumberStart Process
Start a new terminal process with intelligent state detection. PRIMARY TOOL FOR FILE ANALYSIS AND DATA PROCESSING ...
Parameters
4shellstringcommandstringtimeout_msnumberverbose_timingbooleanRead Process Output
Read output from a running process with intelligent completion detection. Automatically detects when process is ready for more...
Parameters
3pidnumbertimeout_msnumberverbose_timingbooleanInteract With Process
Send input to a running process and automatically receive the response. CRITICAL: THIS IS THE PRIMARY TOOL FOR ALL LOCAL FILE ...
Parameters
5pidnumberinputstringtimeout_msnumberverbose_timingbooleanwait_for_promptbooleanForce Terminate
Force terminate a running terminal session. This command can be referenced as "DC: ..." or "use Desktop Commander to ..." in y...
Parameters
1pidnumberList Sessions
List all active terminal sessions. Shows session status including: - PID: Process identifier ...
List Processes
List all running processes. Returns process information including PID, command name, CPU usage, and memory usage. ...
Kill Process
Terminate a running process by PID. Use with caution as this will forcefully terminate the specified process. ...
Parameters
1pidnumberGet Usage Stats
Get usage statistics for debugging and analysis. Returns summary of tool usage, success/failure rates, and performance metrics...
Get Recent Tool Calls
Get recent tool call history with their arguments and outputs. Returns chronological list of tool calls made during this session. ...
Parameters
3sincestringtoolNamestringmaxResultsnumberGive Feedback To Desktop Commander
Open feedback form in browser to provide feedback about Desktop Commander. IMPORTANT: This tool simply opens the feedback form...
Get Prompts
Browse and retrieve curated Desktop Commander prompts for various tasks and workflows. IMPORTANT: When displaying prompt lists...
Parameters
3categorystringpromptIdstring
Комментарии
Комментариев пока нет. Будьте первым.