Linux Command MCP 是一个基于 Model Context Protocol (MCP) 构建的远程命令执行系统,它能够支持安全且标准化地执行 Linux 命令,为用户提供了便捷、高效的命令执行解决方案。
使用本系统前,需要确保满足以下条件:
git clone
cd linux-command-mcp
cd server
npm install
npm run build
cd ../client
npm install
npm run build
cd server
node dist/index.js
要在 Claude Desktop 中使用此 MCP 服务器,请参考相关文档。
MCP 服务器在 claude_desktop_config.json 文件中进行配置,通常位于 ~/.config/Claude/claude_desktop_config.json。
"mcpServers": {
"server-name": {
"command": "node|npx|uvx",
"args": ["服务器特定参数"],
"env": {
"OPTIONAL_ENVIRONMENT_VARIABLES": "值"
}
}
}
"linux-command": {
"command": "node",
"args": [
"/full/path/to/linux-command-mcp/server/dist/index.js"
]
}
"command":指定执行器(node、npx、uvx)"args":服务器可执行文件的完整路径index.js 的绝对路径⚠️ 重要提示
- 始终使用完整的绝对路径
- 验证文件权限
- 确保指定文件可执行
MCP 代理将在 localhost:3000 启动,并支持以下操作:
curl http://localhost:3000/mcp/currentdir
curl -X POST "http://localhost:3000/mcp/command" -H "Content-Type: application/json" -d '{"command":"ls"}'
如需更详细的使用说明,请参考相关文档。
文档中未提及相关许可证信息。