railway-sandbox-mcp
railway-sandbox-mcp
ChatGPT が Railway Sandbox を分離された開発・実行環境として操作できるようにする、小さな MCP ブリッジです。
アーキテクチャ
長時間稼働する 2 つの Railway サービスは、どちらも Railway の GitHub インテグレーションを通じて、この GitHub リポジトリからデプロイされます。
Railway サービス | GitHub ブランチ | Railway ルートディレクトリ | コードとしての設定ファイル | 用途 |
|
|
|
| Railway Sandbox SDK をバックエンドとする Node MCP サーバー |
|
|
|
| OpenAI Secure MCP Tunnel クライアント |
tunnel-client の Dockerfile は公式の ghcr.io/openai/tunnel-client:latest イメージを継承し、そのエントリポイントをラップしているだけなので、上流のヘルス/レディネスサーバーが Railway から注入された PORT にバインドされます。デプロイのライフサイクルは Railway が管理し、上流のイメージプロバイダーは OpenAI のままです。
ChatGPT
|
v
OpenAI Secure MCP Tunnel
^
| outbound HTTPS
|
tunnel-client (Railway)
|
| Railway private network
v
sandbox-mcp:8080/mcp (Railway)
|
v
Railway Sandbox SDK
|
v
Ephemeral isolated Linux sandboxes with outbound Internetどちらの Railway サービスもパブリックドメインは必要ありません。
Related MCP server: Railway MCP Server
コードとしての設定
デプロイ動作はこのリポジトリにコミットされています。
/railway.jsonは、MCP サービスのビルダー、監視パス、起動コマンド、ヘルスチェック、再起動ポリシーを定義します。/tunnel-client/railway.jsonは、tunnel-client の Docker ビルド、監視パス、レディネスチェック、再起動ポリシーを定義します。/tunnel-client/Dockerfileは、公式の OpenAI tunnel-client イメージを選択し、そのヘルスリスナーを Railway から注入されたPORTに適合させます。/.github/workflows/ci.ymlは、プッシュとプルリクエストの際に Node サービスと Railway 設定ファイルを検証し、tunnel-client イメージをビルドします。
コードとしてコミットされた Railway 設定は、各デプロイのダッシュボード上のビルド/デプロイ設定値よりも優先されます。
一度だけ行う Railway サービスの接続設定
ソースの関連付け、トリガーブランチ、カスタム設定ファイルのパスは、railway.json 内のフィールドではなく Railway サービスのメタデータであるため、これらは Railway で一度だけ設定します。
sandbox-mcp
ソースリポジトリ:
erwinkn/railway-sandbox-mcpブランチ:
mainルートディレクトリ:
/設定ファイルのパス:
/railway.jsonGitHub 自動デプロイ: 有効
CI 待機: 有効
tunnel-client
ソースリポジトリ:
erwinkn/railway-sandbox-mcpブランチ:
mainルートディレクトリ:
/tunnel-client設定ファイルのパス:
/tunnel-client/railway.jsonGitHub 自動デプロイ: 有効
CI 待機: 有効
カスタム起動コマンドなし。リポジトリの Dockerfile エントリポイントを継承
サービス固有の監視パスにより、MCP のみの変更ではトンネルクライアントは再ビルドされず、トンネルのみの変更では MCP サーバーは再ビルドされません。
必要な環境変数
sandbox-mcp
RAILWAY_API_TOKEN: Sandbox が有効な環境へのアクセス権を持つ Railway API トークン。RAILWAY_ENVIRONMENT_ID: Railway によって自動的に注入されます。
tunnel-client
MCP_SERVER_URL=http://sandbox-mcp.railway.internal:8080/mcpCONTROL_PLANE_TUNNEL_ID=tunnel_...CONTROL_PLANE_API_KEY=...: Tunnel Read + Use 権限を持つ制限付き OpenAI ランタイムキー。LOG_LEVEL=infoLOG_FORMAT=json
tunnel-client は /healthz、/readyz、/metrics を Railway から注入されたポートで公開します。Railway はデプロイのヘルスチェックとして /readyz を使用するため、tunnel-client のデプロイが成功すれば、トンネルの起動と下流の MCP のレディネスの両方が検証されたことになります。
デプロイの流れ
プッシュにより GitHub Actions が実行されます。Railway の Wait for CI を有効にすると、Railway は CI の成功を待ってから、変更されたファイルに一致する監視パターンを持つサービスのみを自動デプロイします。
MCP ツール
sandbox_createsandbox_listsandbox_getsandbox_execsandbox_read_filesandbox_list_filessandbox_write_filesandbox_write_filessandbox_checkpointsandbox_destroy
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
Develop, manage, and debug Railway projects, services, and deployments from within agents.
Linux VMs for AI agents: create VMs, run commands, edit files and open preview URLs.
Use your Mac, Windows or Linux computer from ChatGPT, Claude or Codex: files, commands, documents.
A persistent Linux computer for your AI: what it installs and writes survives the session.
Related MCP Servers
AlicenseNot gradedqualityDmaintenanceEnables spawning ephemeral Linux sandbox containers using Docker and executing commands through an interactive TTY interface. Supports collaborative terminal sessions where both AI clients and humans can simultaneously interact with the same container.27MIT- AlicenseAqualityDmaintenanceEnables AI systems like Claude and Cursor to directly manage Railway projects, deployments, services, environment variables, and monitor logs through natural language commands.9MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to operate a persistent Linux sandbox in the cloud, running commands, managing files, using Git, and publishing artifacts through a Streamable HTTP MCP endpoint.-
- AlicenseNot gradedqualityBmaintenanceEnables ChatGPT to execute shell commands and control Docker inside isolated, disposable sandbox microVMs without exposing the host shell or Docker daemon.9 npm2MIT