终端 MCP 服务器是一个借助 Claude Desktop 来执行终端命令的模型上下文协议(MCP)服务器。它能让用户在特定环境下方便地执行各类终端操作,提升工作效率。
git clone https://github.com/stat-guy/terminal.git
cd terminal
npm install
npm run build
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\\Claude\\claude_desktop_config.json添加以下配置:
{
"mcpServers": {
"terminal": {
"command": "node",
"args": [
"[PATH_TO_REPO]/dist/index.js"
],
"env": {
"PERMISSION_REQUIRED": "true"
}
}
}
}
将 [PATH_TO_REPO] 替换为您实际克隆的仓库路径。
npm run watch
src/ 中的源文件npm run build 重建让 Claude 执行终端命令,例如:
你能检查我的当前目录中有何文件吗?
-> 执行:ls -la
你能告诉我当前目录是什么?
-> 执行:pwd
你能切换到下载文件夹吗?
-> 执行:cd ~/Downloads