mcp-bridge
Bridges container-host gap by allowing AI agents inside Docker/DevContainer to execute predefined host commands securely via MCP tools.
Supports sandbox execution via seatbelt profiles on macOS, restricting command capabilities for enhanced security when executing host commands.
Provides a tool to run [swift](/mcp/servers/integrations/swift) build on the host, enabling macOS-specific Swift package builds from within containers.
Click on "Deploy 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., "@mcp-bridgebuild Swift package at /Users/me/MyPackage"
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.
mcp-bridge
YAML設定ファイル(tools.yaml)を読み込んで、定義されたコマンドを
MCP Toolとして自動公開するHTTP TransportのMCPサーバー。
ユースケース: DevContainerからホストのコマンドを安全に呼び出す
DevContainerやDockerコンテナ内で動くAIエージェント(Claude Code など)は、 デフォルトではホストOSのコマンドを実行できません。
mcp-bridgeをホスト側で起動し、コンテナ側のエージェントからHTTP経由でMCPサーバーに接続することで、
tools.yamlに列挙したコマンドだけをエージェントに許可できます。
┌─────────────────────────────────┐ ┌──────────────────────────┐
│ Host │ │ DevContainer │
│ │ │ │
│ mcp-bridge --sandbox sandbox.sb│◀─────▶│ AI Agent (Claude Code) │
│ (http://localhost:8000/mcp) │ MCP │ │
│ │ │ │
│ ホストのコマンドを制限付きで実行 │ │ tools.yaml の範囲でのみ │
│ │ │ ホストコマンドを呼べる │
└─────────────────────────────────┘ └──────────────────────────┘tools.yaml で公開するコマンドを絞り込み、--sandbox でsandbox-execによる
Seatbeltプロファイルを適用することで、意図しないコマンドの実行を防げます。
Related MCP server: Kilntainers
インストール
uv tool install git+https://github.com/appare45/mcp-bridge開発中に直接実行する場合
uv sync
uv run main.py起動
# サンドボックスなし
mcp-bridge --config /path/to/tools.yaml
# ポート指定
mcp-bridge --config /path/to/tools.yaml --port 9000
# Seatbeltサンドボックスあり (macOS)
mcp-bridge --config /path/to/tools.yaml --sandbox /path/to/sandbox.sbhttp://127.0.0.1:8000/mcp でリスンします。
ツールの追加方法
tools.yaml に以下の形式でエントリを追加するだけです。コード変更は不要。
tools:
- name: ツール名
description: ツールの説明(LLMに見せる説明文)
command: "実行するコマンド {param1} {param2}"
parameters:
- name: param1
type: string # string / integer / number / boolean
description: パラメータの説明
default: デフォルト値 # 省略すると必須パラメータになる
- name: param2
type: integer
default: 4command内の{param名}がパラメータの値に置換されます各値は
shlex.quoteでエスケープされ、コマンドに渡されますparametersを空配列[]にすれば引数なしのツールになります
サーバーを再起動すると新しいツールが反映されます。
例: import Darwin を使う Swift パッケージの開発
import Darwin など macOS 固有の API を使う Swift パッケージは、Linux コンテナ内ではビルドできません。
mcp-bridge をホストで動かすことで、コンテナ内のエージェントがホストの swift build を呼び出せます。
tools:
- name: swift_build
description: ホスト上の Swift パッケージをビルドする (import Darwin など macOS 専用 API を含む場合に使用)
command: "swift build --package-path {path}"
parameters:
- name: path
type: string
description: Package.swift があるディレクトリのパスクライアント設定例
ホスト側の起動(host.docker.internal を許可):
mcp-bridge --config /path/to/tools.yaml --allowed-hosts host.docker.internalプロジェクトルートの .mcp.json:
{
"mcpServers": {
"mcp-bridge": {
"type": "http",
"url": "http://host.docker.internal:8000/mcp"
}
}
}Linux の場合
host.docker.internalが解決できないことがあります。 その場合はdocker run --add-host=host-gateway:host-gatewayでホストのIPを注入するか、 ブリッジネットワークのゲートウェイIP(通常172.17.0.1)を直接指定してください。
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP server for Superserve sandboxes: create, exec, and manage Firecracker microVMs
Host your MCP tool over streamable HTTP in one command.
Self-hosted MCP server: 26 deterministic dev, security, and EVM tools.
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceTurns any shell command into an MCP server by defining command-line tools in simple YAML files. Enables AI agents to execute system commands, security scanners, DevOps tools, and CLI utilities directly from chat interfaces.4-

Kilntainersofficial
AlicenseAqualityFmaintenanceMCP server to give every agent an ephemeral Linux sandboxes for executing shell commands.151MIT- AlicenseNot gradedqualityAmaintenanceA passive MCP server that exposes a toolbox of executable tools (shell, network, HTTP, AI search, SSH, S3 file operations) to autonomous agents via Streamable HTTP, with strong security features including Docker sandboxing and WAF.2Apache 2.0
- AlicenseNot gradedqualityAmaintenanceTurns any CLI command into an MCP server via a declarative YAML config, enabling safe, typed tool execution with no shell injection.MIT