mcp-sandbox-server
mcp-sandbox-server
AIエージェントに対して、サンドボックスホストへの認証済みシェルアクセスとファイルアクセスを提供するリモートMCP(Model Context Protocol)サーバーです。さらに、フルアクセスを決して持たせてはならない本番ホストに対し、デプロイをトリガーする安全で限定的な経路も用意します。
機能
中核のMCPツール(
run_command、read_file、write_file、list_directory)をStreamable HTTPで公開し、エージェントがサンドボックス上で直接コードをビルド/テストできるようにします。最小構成のOAuth 2.0認可サーバーをゼロから実装。動的クライアント登録(RFC 7591)、単一の管理者認証情報で保護された認可エンドポイント、PKCE対応のトークンエンドポイントを備えます。MCPクライアント(claude.aiのコネクタUIなど)は、貼り付けられたベアラートークンではなく、完全なOAuthフローを期待するためです。したがって、管理者が1人だけのセットアップであっても、サーバー側はOAuthフローに対応する必要があります。
2つ目の、より機密性の高いホストへの制限付きゲートウェイ(
biscuit_status、biscuit_logs、biscuit_deployなど)。エージェントを境界内に留めることをツールコードだけに頼るのではなく、実際の境界はもう一段下のレイヤーにあります。対象ホストのauthorized_keysにおいて専用のSSHキーがcommand="..."により制限されており、そのキーでクライアントが何を送信しても、実行できるのは固定されたホワイトリスト登録済みスクリプトの1本だけです。ここでのツールコードは文字通りアクション文字列を組み立てるだけで、セキュリティ境界を担うのは強制コマンド(forced command)の方です。
Related MCP server: ssh-mcp
なぜこのような構成なのか
興味深い制約は、同じエージェントに2つのまったく異なる信頼レベルが必要だったことです。使い捨てのサンドボックスでは、フルで無制限のシェル。一方、本番サービスが稼働しているホスト上では、事前に承認された読み取り中心の限られた数件の操作のみ。エージェントの振る舞い(プロンプトやツールの説明など)をサンドボックス化しようとするのではなく、この設計では実際の境界を、エージェントが何を送信しようともOSが強制するレイヤーに押し下げています。すなわち、強制SSHコマンドと、パストラバーサルを検査するホワイトリストスクリプトです。
技術スタック
Node.js、Express、@modelcontextprotocol/sdk、Zod。データベースは不使用——認証状態はサーバーの隣に置かれた小さなJSONファイルに永続化されます。
注記
これは、実際に本番稼働しているサーバーから余計な部分を削り、識別子を取り除いたコピーです。実際のホスト名・IP・内部プロジェクト名はプレースホルダ(your-production-server-ip、project-a / project-b / project-c など)に置き換えられています。
This server cannot be deployed
Maintenance
Related MCP Connectors
- emisarOAuthdev.emisar
Let AI operate servers without SSH. Choose actions, approve risky changes, and audit every step.
Scoped, audited SSH exec, sessions, and SFTP on your saved servers without exposing credentials
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
Security gateway for AI agents: policy, approval, and audited execution, no secrets shared.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to securely execute commands on remote hosts via SSH and SFTP, with persistent shells, file transfers, screenshots, and an audit log.5MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to execute SSH commands and transfer files via SFTP through a centralized HTTP gateway with per-client authorization, layered command policies, audit logging, rate limiting, circuit breakers, and connection pooling.8MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to remotely execute shell commands and transfer files on SSH hosts, including jump-host tunneling, background tasks, resumable transfers, and optional approval of destructive commands, while SSH credentials remain in the local process. It runs over stdio or a streamable HTTP daemon and supports auditing, allow/deny lists, and multiple authentication methods.ISC
- AlicenseAqualityAmaintenanceEnables AI agents to inspect and manage remote hosts over SSH with tiered blast-radius containment that classifies and blocks destructive commands, plus forensic post-flight assertions that verify ports, processes, files, and HTTP health. It also provides long-running background task envelopes and atomic SFTP file editing with automatic backups, unified diffs, and one-click rollback.12MIT