ssh-bridge-mcp
Provides SSH-based tools for operating remote Linux hosts: running shell commands, reading/writing files, uploading/downloading via SFTP, and managing background processes.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ssh-bridge-mcpShow me the disk space usage on dev01"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
ssh-bridge-mcp
让 Claude Code / Codex / Claude Desktop 通过 MCP 统一操作局域网 Linux 的 SSH 桥。本机常驻一个 MCP server(Node + @modelcontextprotocol/sdk + ssh2),把 SSH 封装成结构化工具;LLM 侧永远只看到工具与输出,看不到配置文件、看不到密码。
Claude Desktop / Claude Code / Codex
| MCP (stdio)
v
本机 Windows 上运行的 MCP server (Node + @modelcontextprotocol/sdk + ssh2)
| SSH(密码来自本地配置)
v
多台远程 Linux(配置文件里列出)快速开始
npm install复制
config.example.json为config.json并填写主机与密码(sudoPassword缺省同password){ "default": "dev01", "hosts": { "dev01": { "host": "<remote-host-ip>", "port": 22, "user": "<username>", "password": "<ssh-password>", "sudoPassword": "<sudo-password>" } } }启动:
npm start(或用SSH_BRIDGE_CONFIG=/path/to/config.json npm start指定配置路径)
配置文件默认在项目根目录 config.json,可用环境变量 SSH_BRIDGE_CONFIG 覆盖。配置文件内容在工具输出中永不出现。
Related MCP server: ssh-client-mcp-server
接入
Claude Desktop
在 claude_desktop_config.json 增加:
{
"mcpServers": {
"ssh-bridge": {
"command": "node",
"args": ["<path-to>/ssh-bridge-mcp/src/server.js"]
}
}
}Claude Code
claude mcp add ssh-bridge -- node <path-to>/ssh-bridge-mcp/src/server.js工具
工具 | 作用 |
| 列出可用主机名与地址(不含任何凭据) |
| 运行 shell 命令,返回 |
| 读远程文本文件(面向文本/小文件;大文件用 |
| 写远程文本文件,自动建目录(面向文本/小文件;大文件用 |
| 本机 -> Linux,SFTP 传文件(大文件/目录) |
| Linux -> 本机,SFTP 传文件(大文件/目录) |
| 启动长驻进程(dev server、训练任务),返回 |
| 读后台进程日志(增量,从上次读的位置起) |
| 终止后台进程 |
run_command 参数:host / command / cwd / timeout_ms / sudo / pty / env / input。host 可省略,缺省连配置的默认主机。
使用说明(面向 agent)
本 MCP 的所有能力通过以下约定使用,避免命令拼接错误:
1. 环境变量
env参数注入,不要手拼FOO=bar cmd或export FOO=bar && cmd。run_command(command: "npm test", env: { NODE_ENV: "test", DEBUG: "1" })
2. 多行命令
command传多行字符串即脚本,作为单个参数交给bash -c执行,支持 heredoc。注意外层 shell 不保留 cd —— 多条命令用&&串联。run_command(command: "cd /app && npm ci && npm run build")heredoc 通过
<<'EOF'避免变量展开:run_command(command: "cat > /tmp/x.sh <<'EOF'\necho keep_literal\nEOF\nbash /tmp/x.sh")
3. sudo 提权
需要 root 时设
sudo: true,server 自动喂密码。不要手写echo password | sudo。run_command(command: "apt-get update && apt-get install -y python3", sudo: true)
4. 命令失败与超时
命令非零退出不会抛异常,返回真实 exit code。检查
exitCode而不是捕获异常。超过
timeout_ms返回 timeout 状态,考虑拆短命令或改用start_background。
5. 文件操作
文本/小文件:
read_file/write_file(UTF-8,自动建目录)。大文件/二进制/整个目录:
upload/download(SFTP 流式,路径不经 shell,无转义问题)。本地路径是本机 Windows 路径,远程路径是目标 Linux 路径,勿混淆。
6. 长驻进程
dev server、训练等长驻任务用
start_background,返回task_id,用background_logs增量看日志,stop_background终止。后台进程池仅限当前客户端进程,Claude Desktop 起的进程 Codex 看不到。
7. 常用开发组合(示意)
跑测试:
run_command(command: "npm test", cwd: "/project")git 提交(多行消息):
run_command(command: "git commit -F -", input: "feat: 新增 X\n\n- a\n- b")查看日志:
run_command(command: "journalctl -u myapp --no-pager -n 50", sudo: true)构建并部署:
run_command(command: "npm ci && npm run build && ./deploy.sh")
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityCmaintenanceAn MCP server that gives AI agents SSH access to remote machines through your local OpenSSH client, enabling remote command execution, file transfer, persistent shell sessions, and port forwarding.175MIT
- Alicense-qualityAmaintenanceA local MCP server that enables LLMs to execute shell commands on remote hosts over SSH with multiple authentication methods.353MIT
- Alicense-qualityAmaintenanceMCP server enabling AI assistants to securely operate remote servers via persistent SSH sessions, with tools for command execution, file transfer, directory listing, and system monitoring.2MIT
- AlicenseAqualityDmaintenanceAn MCP server that enables large language models to connect to remote servers via SSH, execute commands, and transfer files securely.64Apache 2.0
Related MCP Connectors
Operate your Linux servers from your LLM. Every action runs through an auditable allowlist.
Personal assistant MCP server with search, execute, packages, jobs, secrets, and integrations.
MCP server for Pentest-Tools.com: run scans, manage findings and reports via your preffered LLM.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/berixoo/ssh-bridge-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server