Gives Claude structured access to remote servers through SSH and rsync instead of making it freestyle shell commands every time. You configure the target host, deploy path, restart command, and log locations once in YAML, then the AI can call tools like sync_to_remote, deploy, diagnose_failure, and compare_targets without rediscovering basic facts about your infrastructure. Built in Rust as a native binary. Useful when you want an AI to debug or deploy against a real server with operational context instead of guessing where logs live or how services restart on every interaction.
A safe, configurable MCP tool for giving AI agents reliable access to remote servers.
RemoteBridge is a Rust CLI and MCP server for AI-assisted remote workflows. It syncs local code with rsync, runs remote commands over SSH, gathers logs and diagnostics, compares environments, and exposes all of that through a compact tool surface your AI can use directly.
Use it when you want an AI agent in Claude Code, Cursor, Windsurf, Codex, or another MCP-enabled tool to work against a remote machine with real operational context, not just a shell prompt.
Instead of making the model guess how your server is set up, RemoteBridge gives it a configured operational interface.
When an AI is debugging or deploying on a remote machine, it needs more than "run this command".
It needs to understand things like:
RemoteBridge stores those recurring server facts in remotebridge.yaml and exposes the useful workflows as MCP tools.
That lets the AI work with a remote server as a system it can understand, not just a place where commands happen to run.
Without a structured tool layer, remote work from AI usually turns into a noisy sequence of shell steps:
RemoteBridge compresses that into a smaller set of reusable operations with clearer intent and better defaults.
Your AI can call:
sync_to_remotedeploypreflight_checkfetch_logsdiagnose_failurecompare_targetsThese tools are designed to help the AI inspect and reason about the remote system, not just execute commands on it.
For example, diagnose_failure can gather:
in one compact response.
Direct SSH from an AI tool is still useful when:
RemoteBridge is better when:
RemoteBridge is not better because it hides SSH. It is better because it turns repeated infrastructure reasoning into stable, reusable tool behavior.
Concrete differences from direct SSH:
remotebridge.yaml and reused on every call.deploy, diagnose_failure, and compare_targets as intent-level operations.This is why RemoteBridge is usually more useful than raw shell access inside an AI agent, even when the AI agent technically supports remote access already.
RemoteBridge is useful when it removes low-value conversation between the model and the server.
It saves tokens in a few concrete ways:
run_remote_command truncates combined stdout and stderr to a shared line budget, so the model gets the important tail instead of a full transcript.preflight_check gathers OS and runtime facts in one remote call instead of making the AI issue several separate shell commands.fetch_logs pulls configured log files in one structured response instead of the AI repeatedly asking where logs live and tailing each file manually.diagnose_failure gathers service state, listeners, disk, memory, runtime info, and recent logs in one pass, then summarizes likely causes.compare_targets turns "SSH into staging, SSH into prod, inspect both, diff mentally" into one semantic tool call.deploy and restart_service remove the need for the AI to restate shell glue like cd /path && ... every time.remote_path, restart_cmd, logs, allowed_commands, and blocked_patterns are stored once and reused on every call.The important point is not just "fewer SSH commands." It is:
Raw SSH gives the AI a lot of power, but very little structure.
RemoteBridge adds:
remotebridge.yaml.deploy, diagnose_failure, and compare_targets describe intent, not just shell syntax.That last point matters. A remote shell alone cannot see your local uncommitted code. RemoteBridge can sync exactly what the AI changed locally, then execute the remote step that depends on it.
RemoteBridge is not trying to beat SSH at being a shell.
It is trying to give AI agents a better abstraction than:
RemoteBridge could have been written in Node.js or Python. We chose Rust for practical reasons tied to the job this tool does.
Rust helps here because:
ssh, rsync, log streaming, and MCP stdio handlingFor this project specifically, that means:
ssh and rsyncNode.js or Python would have been workable. Rust is a better fit for a tool whose job is to be a reliable systems bridge between an AI client and remote infrastructure.
| Feature | Why it matters |
|---|---|
| Rsync Sync | Push local code to the server without re-uploading everything |
| SSH Multiplexing | Reuses OpenSSH control connections across repeated sync and command calls |
| Structured MCP Tools | Lets the AI call semantic actions instead of building shell strings each time |
| Output Truncation | Keeps command responses small enough to stay useful in model context |
| Preflight Check | Captures runtime facts in one step |
| Deploy Pipeline | Encodes sync → restart → failure-log flow as one operation |
| Failure Diagnosis | Pulls service state, runtime facts, listeners, disk, memory, and logs into one compact summary |
| Target Comparison | Surfaces config drift and runtime drift between environments |
| Safety Gates | Confirmation, hard blocks, and allowlists reduce destructive mistakes |
| Audit Log | Records what actually ran and how it exited |
| Watch Mode | Keeps a remote target in sync during an edit/test loop |
| Per-target SSH Config | Supports host/user/path/port/key per environment |
Without RemoteBridge, an AI debugging a broken deploy often does something like this:
pwd.ls.With RemoteBridge, the same request can be:
You: "The staging deploy is broken. Diagnose it."
The AI can call diagnose_failure and get back:
That is a much better use of context than a multi-turn shell transcript.
Prerequisites: Rust, rsync, and ssh available in PATH.
npm install -g remote-bridge-cli
claude mcp add remote-bridge --scope user -- remote-bridge mcp
See MCP Support below for other tools.
remote-bridge init --name my-app -H your-server.com --user ubuntu --path /var/www/app
That creates remotebridge.yaml, which becomes the shared source of truth for your AI workflows.
project_name: "my-app"
targets:
staging:
host: "13.234.xx.xx"
user: "ubuntu"
remote_path: "/var/www/html/app"
port: 22
ssh_key: "~/.ssh/id_rsa"
restart_cmd: "pm2 restart app"
logs:
- "/var/www/html/app/logs/error.log"
- "/var/log/nginx/error.log"
require_confirmation: false
exclude:
- "node_modules/"
- "*.log"
blocked_patterns:
- "rm -rf"
- "drop table"
allowed_commands:
- "npm"
- "pm2"
audit_log: "~/.remote-bridge-staging.log"
production:
host: "prod.example.com"
user: "ubuntu"
remote_path: "/opt/app"
ssh_key: "~/keys/prod.pem"
restart_cmd: "systemctl restart myapp"
logs:
- "/opt/app/logs/error.log"
require_confirmation: true
remotebridge.yaml MattersThis file is the reason the MCP tool is more useful than raw SSH.
It stores facts the AI should not have to rediscover:
Once that information is encoded once, every future tool call gets simpler and cheaper.
| Command | Description |
|---|---|
init | Create a new remotebridge.yaml |
sync | Sync local files to the remote server |
sync --dry-run | Preview rsync changes without touching the server |
run <cmd> | Execute one remote command |
preflight | Collect remote OS and runtime versions |
logs | Fetch recent configured logs |
logs --follow | Stream configured logs live |
restart | Restart the configured service |
deploy | Sync, restart, and fetch failure context if restart fails |
watch | Poll local files and auto-sync on change |
apply | Parse Markdown from AI output and apply file changes plus shell commands |
RemoteBridge is also pipe-friendly.
claude "Fix the database connection in src/db.ts and restart the app" --non-interactive \
| remote-bridge apply --target staging
gemini "Add rate limiting to the Express API" \
| remote-bridge apply --target staging
aider --message "Refactor the login logic" --apply \
| remote-bridge apply --target staging
RemoteBridge is a native MCP server. Any MCP-compatible AI IDE can use it.
| Tool | Practical value |
|---|---|
sync_to_remote | Push local code to the server from the same AI session |
run_remote_command | Run remote shell commands with bounded output |
preflight_check | Get runtime facts in one compact response |
fetch_logs | Pull configured logs without rediscovering paths |
restart_service | Reuse the configured restart command safely |
deploy | Run the standard remote deploy flow as one action |
diagnose_failure | Collect and summarize failure context instead of streaming raw shell debugging |
compare_targets | Compare environments using both config and live runtime facts |
diagnose_failure is the clearest example.
A raw SSH agent has to decide:
diagnose_failure bakes that investigation into one operation.
compare_targets is another example. SSH can inspect one server at a time. This tool compares:
That is not impossible with SSH. It is just expensive and repetitive for AI.
Inside an MCP-enabled IDE, you can say:
File: ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"remote-bridge": {
"command": "remote-bridge",
"args": ["mcp"]
}
}
}
File: ~/.cursor/mcp.json or .cursor/mcp.json
{
"mcpServers": {
"remote-bridge": {
"command": "remote-bridge",
"args": ["mcp"]
}
}
}
{
"servers": {
"remote-bridge": {
"type": "stdio",
"command": "remote-bridge",
"args": ["mcp"]
}
}
}
File: ~/.codex/config.json
{
"mcpServers": {
"remote-bridge": {
"command": "remote-bridge",
"args": ["mcp"]
}
}
}
Or inline:
codex --mcp-server "remote-bridge mcp" "Diagnose the staging deploy failure"
{
"command": "remote-bridge",
"args": ["mcp"],
"transport": "stdio"
}
RemoteBridge uses your existing SSH setup.
Copy your key to the server:
ssh-copy-id -i ~/.ssh/id_rsa.pub ubuntu@your-server.com
Or specify key and port in config:
targets:
staging:
host: "13.234.xx.xx"
user: "ubuntu"
port: 2222
ssh_key: "~/keys/staging.pem"
Or use ~/.ssh/config aliases:
Host staging-server
HostName 13.234.xx.xx
User ubuntu
IdentityFile ~/keys/my-key.pem
Port 22
Then point host at the alias:
targets:
staging:
host: "staging-server"
user: "ubuntu"
RemoteBridge is designed for AI-driven execution, so safety is not optional.
Commands containing risky patterns such as sudo, rm, drop, delete, shutdown, reboot, killall, curl | bash, and similar destructive sequences require confirmation before execution.
Anything in blocked_patterns is always rejected:
targets:
production:
blocked_patterns:
- "rm -rf"
- "drop table"
- "truncate"
If allowed_commands is set, only matching prefixes are allowed:
targets:
production:
allowed_commands:
- "npm"
- "pm2"
- "systemctl restart myapp"
Every command is logged automatically:
[1742660591] host=your-server.com path=/var/www/app exit=0 cmd=npm install
[1742660612] host=your-server.com path=/var/www/app exit=-2 cmd=rm -rf /var/data
Exit codes:
0+ actual process exit code-1 skipped by user-2 hard blocked-3 not allowlistedrequire_confirmation: true can force confirmation on every command for sensitive targets.sync --dry-run previews what will change before syncing.remotebridge.yaml.If you want a raw terminal, use SSH.
If you want an AI to reliably work with remote infrastructure without repeatedly wasting tokens on rediscovery, shell glue, and noisy output, use RemoteBridge.
That is the value proposition.
Contributions and issues are welcome at GitHub Issues.
MIT License.