Remote Bridge

io.github.varaprasadreddy9676由 GitHub 帳號 varaprasadreddy9676 發布v0.1.5更新於 Oct 24, 2026

Sync code to remote servers via SSH/rsync and deploy from any AI IDE.

概覽

AI 產生的概覽

一個本機 MCP 伺服器,讓 AI 助理透過 rsync/SSH 將程式碼同步到遠端伺服器,並執行部署、重啟服務、取得日誌與故障診斷。

可以做什麼
將本機程式碼同步到已設定的遠端目標,並以受限輸出執行遠端 shell 指令,沿用現有 SSH 金鑰,可選用 SSH 連線重用。執行預檢,一次呼叫收集作業系統與執行環境資訊。取得已設定的日誌檔並重啟已設定的服務。執行部署流程(同步、重啟、失敗脈絡),並透過收集服務狀態、監聽埠、磁碟、記憶體與近期日誌來診斷故障。比較預發與生產目標在設定與執行環境上的差異。
適用情境
當希望由 AI 助理驅動可重複的遠端操作(部署、重啟、查看日誌、診斷部署失敗),且伺服器的主機、路徑、重啟指令與日誌位置只需設定一次時使用。一次性互動式探索仍可直接使用 SSH。
執行需求
以本機程序從 npm 安裝(remote-bridge-cli);README 列出 Rust、rsync 與 ssh 需在 PATH 中。需要 remotebridge.yaml 設定目標主機、使用者、路徑、可選埠與 SSH 金鑰、重啟指令及日誌路徑。使用現有 SSH 驗證;未宣告 API 金鑰或環境變數。
安裝前請注意
助理可執行遠端 shell 指令、同步檔案、重啟服務與部署,會變更遠端系統。安全機制(確認、封鎖樣式、允許清單、稽核日誌)存在,但依賴正確設定;生產目標應設定 require_confirmation 與 blocked_patterns。設定中引用的 SSH 金鑰用於存取伺服器,應限制其權限範圍。指令會記錄到稽核日誌。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Remote Bridge,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

RemoteBridge 🌉

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.

What RemoteBridge Helps The AI Understand

When an AI is debugging or deploying on a remote machine, it needs more than "run this command".

It needs to understand things like:

  • where the app is deployed
  • how the service is restarted
  • which log files matter
  • what runtimes are installed
  • whether the service is healthy
  • which ports are listening
  • whether disk or memory pressure is involved
  • how staging differs from production
  • which commands are allowed or dangerous

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.

What Problem This Actually Solves

Without a structured tool layer, remote work from AI usually turns into a noisy sequence of shell steps:

  • find the right host
  • find the deploy path
  • inspect the runtime
  • find the restart command
  • find the logs
  • tail too much output
  • ask more questions to recover context

RemoteBridge compresses that into a smaller set of reusable operations with clearer intent and better defaults.

Your AI can call:

  • sync_to_remote
  • deploy
  • preflight_check
  • fetch_logs
  • diagnose_failure
  • compare_targets

These 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:

  • runtime facts
  • service-manager state
  • recent logs
  • listeners
  • disk status
  • memory state
  • likely failure signatures

in one compact response.

Small Note On Direct SSH

Direct SSH from an AI tool is still useful when:

  • You want a fully interactive shell.
  • You already know the exact command.
  • You want one-off ad hoc exploration.
  • You are doing a one-off urgent command and want raw terminal behavior.

RemoteBridge is better when:

  • The AI is driving the workflow.
  • The same server facts keep getting rediscovered.
  • You want deploy, restart, diagnosis, and log workflows to be repeatable.
  • You need guardrails around destructive commands.
  • You want compact answers instead of full shell transcripts.
  • You want config-aware operations like "compare staging and production".

How RemoteBridge Is Practically Different

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:

  • The server path is configured once in remotebridge.yaml and reused on every call.
  • The restart command is configured once instead of being rediscovered or retyped.
  • The log files are configured once instead of the model hunting for them.
  • The model can call deploy, diagnose_failure, and compare_targets as intent-level operations.
  • The output is deliberately bounded so the model receives signal instead of log floods.
  • Dangerous commands can be confirmed, blocked, or allowlisted.
  • Local code changes and remote execution are part of one workflow instead of two disconnected steps.

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.

Why This Saves Tokens In Practice

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.
  • Config values such as 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:

  • less repeated reasoning around the same infrastructure facts
  • less output the model has to read
  • fewer follow-up prompts caused by noisy shell transcripts

Why This Is Better Than Letting AI Freestyle Shell

Raw SSH gives the AI a lot of power, but very little structure.

RemoteBridge adds:

  • Config awareness: target host, deploy path, restart command, and log paths live in remotebridge.yaml.
  • Operational semantics: tools like deploy, diagnose_failure, and compare_targets describe intent, not just shell syntax.
  • Safer defaults: dangerous commands can require confirmation, be blocked entirely, or be limited to allowlisted prefixes.
  • Better output discipline: the MCP surface returns compressed, useful output instead of dumping everything.
  • Local + remote coordination: syncing local files to a remote server is part of the same workflow instead of a separate manual step.

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.

Core Value

RemoteBridge is not trying to beat SSH at being a shell.

It is trying to give AI agents a better abstraction than:

  1. guess the host
  2. guess the path
  3. guess the service manager
  4. guess the logs
  5. dump too much output
  6. try again

Why We Built This In Rust

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:

  • it produces a single native binary with fast startup, which is useful for CLI and stdio MCP usage
  • it avoids requiring users to manage a Python runtime or a larger JS runtime stack at execution time
  • it is a good fit for process-heavy, I/O-heavy tooling such as ssh, rsync, log streaming, and MCP stdio handling
  • it gives strong compile-time guarantees around error handling and data flow, which matters for deployment and remote execution tooling
  • it tends to have predictable performance and low overhead for repeated tool calls

For this project specifically, that means:

  • faster startup for MCP clients launching the server
  • less packaging friction for a CLI that people want to install and use immediately
  • a native binary that is well suited to wrapping system tools like ssh and rsync
  • a smaller risk surface for runtime dependency issues compared with large script-runtime stacks

Node.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.

Features

FeatureWhy it matters
Rsync SyncPush local code to the server without re-uploading everything
SSH MultiplexingReuses OpenSSH control connections across repeated sync and command calls
Structured MCP ToolsLets the AI call semantic actions instead of building shell strings each time
Output TruncationKeeps command responses small enough to stay useful in model context
Preflight CheckCaptures runtime facts in one step
Deploy PipelineEncodes sync → restart → failure-log flow as one operation
Failure DiagnosisPulls service state, runtime facts, listeners, disk, memory, and logs into one compact summary
Target ComparisonSurfaces config drift and runtime drift between environments
Safety GatesConfirmation, hard blocks, and allowlists reduce destructive mistakes
Audit LogRecords what actually ran and how it exited
Watch ModeKeeps a remote target in sync during an edit/test loop
Per-target SSH ConfigSupports host/user/path/port/key per environment

A Practical Example

Without RemoteBridge, an AI debugging a broken deploy often does something like this:

  1. SSH in.
  2. Ask for pwd.
  3. Ask for ls.
  4. Try to find the app path.
  5. Guess how to restart the service.
  6. Ask for logs.
  7. Pull too much output.
  8. Ask follow-up questions because the output was noisy.

With RemoteBridge, the same request can be:

You: "The staging deploy is broken. Diagnose it."

The AI can call diagnose_failure and get back:

  • target identity
  • inferred service manager
  • service health
  • runtime versions
  • disk or memory pressure signals
  • relevant log excerpts
  • likely causes
  • next-step suggestions

That is a much better use of context than a multi-turn shell transcript.

Quick Start

1. Install

Prerequisites: Rust, rsync, and ssh available in PATH.

bash
npm install -g remote-bridge-cli

2. Add the MCP server to your AI tool

bash
claude mcp add remote-bridge --scope user -- remote-bridge mcp

See MCP Support below for other tools.

3. Initialize project config

bash
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.

Example Configuration

yaml
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

Why remotebridge.yaml Matters

This file is the reason the MCP tool is more useful than raw SSH.

It stores facts the AI should not have to rediscover:

  • where the app lives
  • how it restarts
  • which logs matter
  • which commands are safe
  • which environment needs stronger confirmation

Once that information is encoded once, every future tool call gets simpler and cheaper.

CLI Commands

CommandDescription
initCreate a new remotebridge.yaml
syncSync local files to the remote server
sync --dry-runPreview rsync changes without touching the server
run <cmd>Execute one remote command
preflightCollect remote OS and runtime versions
logsFetch recent configured logs
logs --followStream configured logs live
restartRestart the configured service
deploySync, restart, and fetch failure context if restart fails
watchPoll local files and auto-sync on change
applyParse Markdown from AI output and apply file changes plus shell commands

Integrating With AI CLIs

RemoteBridge is also pipe-friendly.

Claude Code

bash
claude "Fix the database connection in src/db.ts and restart the app" --non-interactive \  | remote-bridge apply --target staging

Gemini CLI

bash
gemini "Add rate limiting to the Express API" \  | remote-bridge apply --target staging

Aider

bash
aider --message "Refactor the login logic" --apply \  | remote-bridge apply --target staging

MCP Support

RemoteBridge is a native MCP server. Any MCP-compatible AI IDE can use it.

Available MCP Tools

ToolPractical value
sync_to_remotePush local code to the server from the same AI session
run_remote_commandRun remote shell commands with bounded output
preflight_checkGet runtime facts in one compact response
fetch_logsPull configured logs without rediscovering paths
restart_serviceReuse the configured restart command safely
deployRun the standard remote deploy flow as one action
diagnose_failureCollect and summarize failure context instead of streaming raw shell debugging
compare_targetsCompare environments using both config and live runtime facts

What These Tools Let AI Do Better Than Raw SSH

diagnose_failure is the clearest example.

A raw SSH agent has to decide:

  • which service manager exists
  • how to inspect it
  • which logs to read
  • how many lines to tail
  • whether disk, memory, or port state might be relevant
  • which lines are likely signal versus noise

diagnose_failure bakes that investigation into one operation.

compare_targets is another example. SSH can inspect one server at a time. This tool compares:

  • host/path/config differences
  • confirmation-policy drift
  • service-manager differences
  • runtime version differences
  • high-level compatibility risks

That is not impossible with SSH. It is just expensive and repetitive for AI.

Example Requests

Inside an MCP-enabled IDE, you can say:

  • "Sync my current project to staging."
  • "Deploy the latest local changes to staging."
  • "Check what runtimes are installed on production."
  • "The app failed after deploy. Diagnose staging."
  • "Compare staging and production and tell me if runtime drift could explain the bug."
  • "Show me the last 100 log lines for production."

MCP Configuration Examples

Claude Desktop

File: ~/Library/Application Support/Claude/claude_desktop_config.json

json
{  "mcpServers": {    "remote-bridge": {      "command": "remote-bridge",      "args": ["mcp"]    }  }}

Cursor

File: ~/.cursor/mcp.json or .cursor/mcp.json

json
{  "mcpServers": {    "remote-bridge": {      "command": "remote-bridge",      "args": ["mcp"]    }  }}

VS Code / Cline / Continue / Copilot-compatible MCP clients

json
{  "servers": {    "remote-bridge": {      "type": "stdio",      "command": "remote-bridge",      "args": ["mcp"]    }  }}

Codex CLI

File: ~/.codex/config.json

json
{  "mcpServers": {    "remote-bridge": {      "command": "remote-bridge",      "args": ["mcp"]    }  }}

Or inline:

bash
codex --mcp-server "remote-bridge mcp" "Diagnose the staging deploy failure"

Generic MCP Pattern

json
{  "command": "remote-bridge",  "args": ["mcp"],  "transport": "stdio"}

SSH Authentication

RemoteBridge uses your existing SSH setup.

  1. Copy your key to the server:

    bash
    ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected]
  2. Or specify key and port in config:

    yaml
    targets:  staging:    host: "13.234.xx.xx"    user: "ubuntu"    port: 2222    ssh_key: "~/keys/staging.pem"
  3. Or use ~/.ssh/config aliases:

    text
    Host staging-server    HostName 13.234.xx.xx    User ubuntu    IdentityFile ~/keys/my-key.pem    Port 22

    Then point host at the alias:

    yaml
    targets:  staging:    host: "staging-server"    user: "ubuntu"

Safety Model

RemoteBridge is designed for AI-driven execution, so safety is not optional.

Confirmation Gate

Commands containing risky patterns such as sudo, rm, drop, delete, shutdown, reboot, killall, curl | bash, and similar destructive sequences require confirmation before execution.

Hard Block

Anything in blocked_patterns is always rejected:

yaml
targets:  production:    blocked_patterns:      - "rm -rf"      - "drop table"      - "truncate"

Allowlist

If allowed_commands is set, only matching prefixes are allowed:

yaml
targets:  production:    allowed_commands:      - "npm"      - "pm2"      - "systemctl restart myapp"

Audit Log

Every command is logged automatically:

text
[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 allowlisted

Other Protections

  • require_confirmation: true can force confirmation on every command for sensitive targets.
  • sync --dry-run previews what will change before syncing.
  • No passwords are stored by RemoteBridge.
  • No secrets need to live in remotebridge.yaml.
  • MCP output stays bounded so one noisy command does not flood model context.

Honest Tradeoff

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.

Contributing

Contributions and issues are welcome at GitHub Issues.

License

MIT License.

來源:README.md,提交 44ffe16

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.1.5最新Sep 16, 2026

評分

已滿足適用檢查項的 40%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

    請在儲存庫或註冊中心條目中宣告授權條款。