从您的 Windows 计算机使用自然语言管理您的 Ubuntu/Linux 服务器!此 MCP(模型上下文协议)服务器允许您通过 Claude Desktop 或 Cursor IDE 建立 SSH 连接来对话控制远程服务器。
TR: Windows 计算机上管理 Ubuntu/Linux 服务器!此 MCP(模型上下文协议)服务器允许您通过 Claude Desktop 或 Cursor IDE 建立 SSH 连接来对话控制远程服务器。
与传统的 SSH 管理相比,您可以简单地告诉您的 AI 助手“连接到我的 Ubuntu 服务器并显示磁盘使用情况”。借助 MCP 协议,AI 会为您执行 SSH 命令,并实时呈现结果。
Windows:
.msi 文件node --versionmacOS:
# 使用 Homebrew
brew install node
# 或者从官方站点下载
Linux (Ubuntu/Debian):
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejs
只需在配置文件中添加以下内容:
{
"mcpServers": {
"ssh": {
"command": "npx",
"args": [
"-y",
"git+https://github.com/mertcankaraoglu/ssh-mcp.git#main"
]
}
}
}
要求:
git clone https://github.com/mertcankaraoglu/ssh-mcp.git
cd ssh-mcp
npm install
根据您使用的应用程序,遵循以下步骤:
Windows:
打开 %APPDATA%\Claude\claude_desktop_config.json 并添加:
{
"mcpServers": {
"ssh": {
"command": "node",
"args": ["C:\\Users\\KULLANICI_ADINIZ\\ssh-mcp\\index.js"]
}
}
}
macOS/Linux:
打开 ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"ssh": {
"command": "node",
"args": ["/tam/yol/ssh-mcp/index.js"]
}
}
}
Windows:
打开 %APPDATA%\Cursor\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json:
{
"mcpServers": {
"ssh": {
"command": "node",
"args": ["C:\\Users\\KULLANICI_ADINIZ\\ssh-mcp\\index.js"]
}
}
}
macOS/Linux:
~/Library/Application Support/Cursor/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json:
{
"mcpServers": {
"ssh": {
"command": "node",
"args": ["/tam/yol/ssh-mcp/index.js"]
}
}
}
关闭并重新打开 Claude Desktop 或 Cursor。MCP 服务器将自动启动。
在 Claude Desktop 中尝试以下命令:
"测试 SSH 连接 - 连接到 IP 地址为 192.168.1.100 的服务器"
如果 MCP 服务器正在运行,Claude 将询问您 SSH 连接参数。
| 工具 | 描述 |
|---|---|
ssh_connect | 建立到服务器的 SSH 连接 |
ssh_exec | 在远程服务器上执行命令 |
ssh_disconnect | 关闭 SSH 连接 |
连接:
您: "连接到我位于 192.168.1.100 的 Ubuntu 服务器。用户名:ubuntu,密码:mypassword"
Claude: [使用 ssh_connect 工具连接]
执行命令:
您: "显示磁盘使用情况"
Claude: [通过 ssh_exec 执行 'df -h' 命令]
您: "显示最后 10 条系统日志"
Claude: [通过 ssh_exec 执行 'tail -n 10 /var/log/syslog']
您: "列出 Docker 容器"
Claude: [通过 ssh_exec 执行 'docker ps']
断开连接:
您: "关闭 SSH 连接"
Claude: [使用 ssh_disconnect 工具]
┌─────────────────┐
│ Claude/Cursor │
│ (AI 客户端) │
└────────┬────────┘
│ MCP 协议
│ (stdio)
┌────────▼────────┐
│ MCP SSH 服务器 │
│ (本项目) │
└────────┬────────┘
│ SSH2
│
┌────────▼────────┐
│ Ubuntu 服务器 │
└─────────────────┘
我们欢迎您的贡献!请随意发送拉取请求。
git checkout -b feature/amazing)git commit -m 'feat: 添加精彩功能')git push origin feature/amazing)MIT 许可证 - 查看LICENSE文件获取详情。
⭐ 如果您喜欢这个项目,请不要忘记给它点赞!