SSH MCP服务器是 KinoThe-Kafkaesque 开发的 MCP 服务器:一个基于模型上下文协议(MCP)的SSH服务器实现,提供安全的远程访问和执行能力。接入两步走:npx -y @smithery/cli install @KinoThe-Kafkaesque/ssh-mcp-server --client claude,再把下文配置粘进客户端 mcpServers 段重启即可。
它是干什么的
先把话说清楚:SSH MCP服务器不是又一个大模型,而是一个标准的 MCP 服务器。装好之后,你的 AI 客户端多出一组新工具,模型可以按需调用。一个基于模型上下文协议(MCP)的SSH服务器实现,提供安全的远程访问和执行能力
| 项目 | 数据 |
|---|---|
| 开发者 | KinoThe-Kafkaesque |
| Star | 10 |
| 收藏 | 0 |
| 质量等级 | A |
| 平台分类 | 开发效率 |
| 部署标签 | 本地部署、SSH服务器、远程执行 |
| 仓库 | ssh-mcp-server |
核心能力
- SSH server implementation using MCP protocol
- SQLite database integration for data persistence
- TypeScript implementation for type safety and better development experience
适合谁用
两类人最该装:一是天天在 Claude Desktop、Cursor 里写代码,想让 AI 直接帮你跑命令、改仓库、读文件的人;二是已经在用 MCP 生态、想按需拼装能力的折腾型用户。反过来,如果你只需要偶尔手动用它背后的服务,直接开网页就行,不必上 MCP。
完整安装配置步骤
动手前确认环境齐了:
- Node.js 18 或更高版本(旧版 npx 跑不动一部分新版 MCP 包)。
- git。
- 一个支持 MCP 的客户端:Claude Desktop、Cursor、Cline、Windsurf 任选其一。
第 1 步:安装SSH MCP服务器
终端里任选一条(不同安装方式,效果等价):
npx -y @smithery/cli install @KinoThe-Kafkaesque/ssh-mcp-server --client claude
git clone <repository-url>第 2 步:写入 MCP 配置
Claude Desktop 的配置文件路径:macOS 在 ~/Library/Application Support/Claude/claude_desktop_config.json,Windows 在 %APPDATA%\Claude\claude_desktop_config.json;Cursor 则是 ~/.cursor/mcp.json(或项目级 .cursor/mcp.json)。把下面这段并进 mcpServers 段(注意是并进外层大括号,别整个文件替换):
Usage
Configuration
The server uses a SQLite database (ssh.db) to store SSH credentials. The database file will be created automatically when the server starts.
Tools
The server stores named credentials, then every remote action refers to a credentialName. privateKeyPath must point to an existing private key.
add_credential: save{ "name", "host", "username", "privateKeyPath" }.list_credentials: list stored credential records.remove_credential: delete{ "name" }.ssh_exec: run a shell command with{ "credentialName", "command", "timeout" }.ssh_exec_raw: run an argv-style command array, for example{ "credentialName": "prod", "command": ["grep", "-E", "foo|bar", "/var/log/app.log"] }.scp_copy: copy one file over SFTP with{ "credentialName", "localPath", "remotePath", "direction" }.rsync_copy: copy directories or larger trees with rsync and the same transfer shape.ssh_session_start,ssh_session_send,ssh_session_read,ssh_session_end,ssh_session_list: manage interactive SSH sessions.ssh_tunnel_start,ssh_tunnel_list,ssh_tunnel_stop: manage local or remote port-forwarding tunnels.
Example:
改完保存。Windows 用户注意:如果 `command` 写 `npx` 起不来,换成 `npx.cmd` 再试。
### 第 3 步:重启并验证
完全退出客户端再打开(是托盘里真正退出,不是关窗口)。工具列表里出现SSH MCP服务器的工具即接入成功;调用报错的话,先查下面的坑点清单。容易踩的坑
- 改了配置没反应:客户端只重启了窗口没退进程。macOS 按 Cmd+Q,Windows 检查托盘。
- JSON 报错打不开客户端:多半是最后多个逗号。粘进任何 JSON 校验器里查一遍再保存。
常见问题
SSH MCP服务器免费吗?
代码在 GitHub(https://github.com/KinoThe-Kafkaesque/ssh-mcp-server)开放获取。个别功能依赖第三方服务时费用另算,看仓库 LICENSE 和定价页。
SSH MCP服务器能用在 Cursor / Cline 吗?
能。MCP 是通用协议,同一份 mcpServers 配置在这些客户端之间基本通用,只是配置文件位置不同。
需要外网或代理吗?
拉包和调用官方 API 需要能访问 GitHub 与对应服务域名,内网环境先测 git ls-remote 和接口连通性。
