Skip to main content

SSH MCP Server

一个带 GUI 配置面板的 SSH MCP Server,支持多服务器管理,一键安装到主流 AI IDE。

功能

  • 多服务器管理 - 可配置多个 SSH 服务器连接
  • 认证方式 - 支持密码认证和密钥对认证
  • GUI 配置面板 - sshgui 一键启动,可视化管理服务器
  • 多选工作集 + 显式目标 - 保留单个 ssh MCP,GUI 可多选一组服务器,未指定目标时走已选集合首台
  • 一键安装 - GUI 内置安装到 Windsurf / Cursor / Claude Code / Codex
  • MCP 协议 - 通过 stdio 提供 MCP 工具,供 AI 助手调用
  • 并发更稳 - 长命令不会再阻塞其他 MCP 工具调用
  • 真实超时 - exec_command.timeout 现在按命令执行总时长生效

安装

# pip 安装(推荐)
pip install sshmcp-r

# 或 uv 安装
uv pip install sshmcp-r

安装后即可使用 sshmcp 命令。

命令一览

命令 说明
sshmcp 以 MCP Server 模式运行(IDE 自动调用)
sshgui 启动 GUI 配置面板
sshmcp-install 一键安装到所有 IDE
sshmcp-install-windsurf 安装到 Windsurf
sshmcp-install-cursor 安装到 Cursor
sshmcp-install-claudecode 安装到 Claude Code
sshmcp-install-codex 安装到 Codex

快速开始

# 1. 安装
pip install sshmcp-r

# 2. 一键安装到你的 IDE(自动写入 MCP 配置)
sshmcp-install-windsurf   # 或 cursor / claudecode / codex
sshmcp-install            # 安装到全部 IDE

# 3. 打开 GUI 管理 SSH 服务器
sshgui

# 4. 重启 IDE,即可在 AI 对话中使用 SSH 工具

一键安装到 IDE

命令行方式:

sshmcp-install              # 安装到所有 IDE
sshmcp-install-windsurf     # 仅安装到 Windsurf
sshmcp-install-cursor       # 仅安装到 Cursor
sshmcp-install-claudecode   # 仅安装到 Claude Code
sshmcp-install-codex        # 仅安装到 Codex

GUI 方式: 运行 sshgui,点击工具栏 「安装到 IDE ▾」 按钮,选择目标 IDE。

安装会自动写入 MCP 配置到对应文件:

  • Windsurf → ~/.codeium/windsurf/mcp_config.json
  • Cursor → ~/.cursor/mcp.json
  • Claude Code → ~/.claude.json
  • Codex → ~/.codex/config.toml

MCP Tools

Tool 说明
list_servers 列出 GUI 当前多选的服务器集合,并标记默认回退服务器/当前连接
connect 连接到指定服务器
disconnect 断开当前连接
get_status 获取当前连接状态
exec_command 在远程服务器执行命令,可选 server_id / server_name
upload_file 上传文件到远程服务器,可选 server_id / server_name
download_file 从远程服务器下载文件,可选 server_id / server_name
write_remote_file 将文本内容写入远程文件,可选 server_id / server_name
read_remote_file 读取远程文件内容,可选 server_id / server_name
list_remote_dir 列出远程目录内容,可选 server_id / server_name

多选服务器与迁移

  • GUI 中可多选一组服务器,list_servers 只返回这组,不返回全部已配置服务器。
  • 已选集合中的首台服务器会作为未显式传参时的默认回退目标。
  • 做迁移、比对、双机操作时,仍建议在工具调用中直接传 server_id 或 server_name,避免依赖回退顺序。

示例:

{
  "name": "exec_command",
  "arguments": {
    "server_name": "old-prod",
    "command": "cat /etc/nginx/nginx.conf"
  }
}
{
  "name": "upload_file",
  "arguments": {
    "server_name": "new-prod",
    "local_path": "D:\\temp\\nginx.conf",
    "remote_path": "/etc/nginx/nginx.conf"
  }
}

手动配置

也可手动添加到 IDE 的 MCP 配置文件:

{
  "mcpServers": {
    "ssh": {
      "command": "sshmcp"
    }
  }
}

打包为 exe

pip install pyinstaller
pyinstaller build.spec

Metadata

Release files for sshmcp-r 1.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sshmcp-r 1.0.6
File Size Uploaded Provenance Actions
sshmcp_r-1.0.6.tar.gz 19.7 kB Without provenance Details for sshmcp_r-1.0.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sshmcp-r 1.0.6
File Interpreter ABI Platform Actions
sshmcp_r-1.0.6-py3-none-any.whl Python 3 none any Details for sshmcp_r-1.0.6-py3-none-any.whl

Total release size: 39.9 kB

Release files / sshmcp_r-1.0.6.tar.gz

Download URL sshmcp_r-1.0.6.tar.gz
Size 19.7 kB
Tags Source
SHA-256 checksum
How to use checksums
59bdfb9f483143d2130a67624a8d0f166b22dec883fedd7e486ace4153684ddb
BLAKE2b-256 checksum
How to use checksums
b18dbcd86d95bfc082df364e7b6b199bceb1c315837a1b6f03897d36e0ee78f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.13

Release files / sshmcp_r-1.0.6-py3-none-any.whl

Download URL sshmcp_r-1.0.6-py3-none-any.whl
Size 20.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
19f276e1c85d9332b3c7aa76e9d2d99cf6d147ec0e68d1ae3e64c03efe111458
BLAKE2b-256 checksum
How to use checksums
2b6090a629fb6e681cbe5002985fefde926a1804dbfb45f06ffd4c28f487350f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.13

Security for sshmcp-r 1.0.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page