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 "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., "@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: MCP-Ables
インストール
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 installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
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/appare45/mcp-bridge'
If you have feedback or need assistance with the MCP directory API, please join our Discord server