Desktop Commander MCP 是一个基于模型上下文协议 (MCP) 的服务器工具,专为 Claude Desktop 应用程序设计。它通过 MCP 协议为 Claude 提供终端控制、文件系统搜索和差异化文件编辑功能,将 Claude 转变为一个强大的开发助手。
这个项目扩展了 MCP 文件系统服务器的功能,使开发者能够通过 Claude 直接操作本地系统,执行命令,管理文件,并进行代码编辑,超越了传统的 AI 编辑器的能力范围。
npx @wonderwhy-er/desktop-commander@latest setup
curl -fsSL https://raw.githubusercontent.com/wonderwhy-er/DesktopCommanderMCP/refs/heads/main/install.sh | bash
npx -y @smithery/cli install @wonderwhy-er/desktop-commander --client claude
git clone https://github.com/wonderwhy-er/DesktopCommanderMCP.git
cd DesktopCommanderMCP
npm run setup
get_config
: 获取完整服务器配置set_config_value
: 设置特定配置值execute_command
: 执行终端命令read_output
: 读取运行会话的新输出force_terminate
: 强制终止运行会话list_sessions
: 列出所有活动终端会话list_processes
: 列出所有运行进程kill_process
: 通过PID终止进程read_file
: 读取本地文件或URL内容read_multiple_files
: 同时读取多个文件write_file
: 完全替换文件内容create_directory
: 创建目录list_directory
: 获取目录详细列表move_file
: 移动或重命名文件和目录search_files
: 按名称查找文件search_code
: 在文件内容中搜索文本/代码模式get_file_info
: 获取文件或目录详细元数据edit_block
: 应用外科手术式文本替换