这是一个模型上下文协议(MCP)服务器,通过Claude Desktop执行终端命令。
git clone https://github.com/stat-guy/terminal.git
cd terminal
npm install
npm run build
创建或编辑你的Claude Desktop配置文件:
~/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]替换为你克隆的仓库的实际路径。
请求Claude执行终端命令,例如:
你能查看我当前目录的内容吗?
-> 执行:ls -la
你能告诉我当前目录是什么吗?
-> 执行:pwd
你能切换到Downloads文件夹吗?
-> 执行:cd ~/Downloads
npm run watch
src/中的源文件npm run build重新构建/
├── src/
│ └── index.ts # 主服务器实现
├── package.json # 项目配置和依赖项
├── tsconfig.json # TypeScript配置
└── README.md # 本文件
欢迎贡献!请随时提交Pull Request。
MIT许可证 </中文翻译>