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
: 應用外科手術式文本替換