Skip to main content
Glama

Code Sandbox MCP

MIT License
69
  • Linux
  • Apple

コードサンドボックス MCP 🐳

Dockerコンテナ内でコードを実行するための安全なサンドボックス環境。このMCPサーバーは、コンテナ化によってセキュリティを維持しながら、AIアプリケーションに安全で隔離されたコード実行環境を提供します。

🌟 特徴

  • 柔軟なコンテナ管理: コード実行用の分離された Docker コンテナを作成および管理します。
  • カスタム環境のサポート: 任意の Docker イメージを実行環境として使用できます
  • ファイル操作: ホストとコンテナ間のファイルとディレクトリの簡単な転送
  • コマンド実行: コンテナ化された環境内で任意のシェルコマンドを実行します。
  • リアルタイムログ:コンテナのログとコマンド出力をリアルタイムでストリーミング
  • 自動更新: 組み込みの更新チェックと自動バイナリ更新
  • マルチプラットフォーム: Linux、macOS、Windowsをサポート

🚀 インストール

前提条件

クイックインストール

Linux、MacOS
curl -fsSL https://raw.githubusercontent.com/Automata-Labs-team/code-sandbox-mcp/main/install.sh | bash
ウィンドウズ
# Run in PowerShell irm https://raw.githubusercontent.com/Automata-Labs-team/code-sandbox-mcp/main/install.ps1 | iex

インストーラーは次のことを実行します。

  1. Dockerのインストールを確認する
  2. システムに適したバイナリをダウンロードしてください
  3. 必要な設定ファイルを作成する

手動インストール

  1. リリースページから、お使いのプラットフォームの最新リリースをダウンロードしてください。
  2. バイナリをPATH内のディレクトリに配置する
  3. 実行可能にする (Unix 系システムのみ):
    chmod +x code-sandbox-mcp

🛠️ 利用可能なツール

sandbox_initialize

コード実行用の新しいコンピューティング環境を初期化します。指定された Docker イメージに基づいてコンテナを作成します。

パラメータ:

  • image (文字列、オプション): ベース環境として使用する Docker イメージ
    • デフォルト: 'python:3.12-slim-bookworm'

戻り値:

  • この環境と対話するために他のツールで使用できるcontainer_id
copy_project

ディレクトリをサンドボックス化されたファイルシステムにコピーします。

パラメータ:

  • container_id (文字列、必須): 初期化呼び出しから返されたコンテナのID
  • local_src_dir (文字列、必須): ローカルファイルシステム内のディレクトリへのパス
  • dest_dir (文字列、オプション): サンドボックス環境の src ディレクトリを保存するパス
write_file

サンドボックス化されたファイルシステムにファイルを書き込みます。

パラメータ:

  • container_id (文字列、必須): 初期化呼び出しから返されたコンテナのID
  • file_name (文字列、必須): 作成するファイルの名前
  • file_contents (文字列、必須): ファイルに書き込む内容
  • dest_dir (文字列、オプション): ファイルを作成するディレクトリ (デフォルト: ${WORKDIR})
sandbox_exec

サンドボックス環境でコマンドを実行します。

パラメータ:

  • container_id (文字列、必須): 初期化呼び出しから返されたコンテナのID
  • commands (配列、必須): サンドボックス環境で実行するコマンドのリスト
    • 例: ["apt-get update", "pip install numpy", "python script.py"]
copy_file

サンドボックス化されたファイルシステムに単一のファイルをコピーします。

パラメータ:

  • container_id (文字列、必須): 初期化呼び出しから返されたコンテナのID
  • local_src_file (文字列、必須): ローカルファイルシステム内のファイルへのパス
  • dest_path (文字列、オプション): サンドボックス環境でファイルを保存するパス
sandbox_stop

実行中のコンテナ サンドボックスを停止して削除します。

パラメータ:

  • container_id (文字列、必須): 停止して削除するコンテナのID

**説明:**指定されたコンテナを 10 秒のタイムアウトで正常に停止し、ボリュームとともに削除します。

コンテナログリソース

コンテナ ログへのアクセスを提供する動的リソース。

リソースパス: containers://{id}/logs
MIMEタイプ: text/plain
**説明:**指定されたコンテナからのすべてのコンテナ ログを単一のテキスト リソースとして返します。

🔐 セキュリティ機能

  • Dockerコンテナを使用した分離された実行環境
  • Dockerコンテナの制約によるリソース制限
  • stdout と stderr ストリームを分離する

🔧 構成

クロードデスクトップ

インストーラーは自動的に設定ファイルを作成します。手動で設定する必要がある場合は、以下の手順に従ってください。

リナックス
// ~/.config/Claude/claude_desktop_config.json { "mcpServers": { "code-sandbox-mcp": { "command": "/path/to/code-sandbox-mcp", "args": [], "env": {} } } }
macOS
// ~/Library/Application Support/Claude/claude_desktop_config.json { "mcpServers": { "code-sandbox-mcp": { "command": "/path/to/code-sandbox-mcp", "args": [], "env": {} } } }
ウィンドウズ
// %APPDATA%\Claude\claude_desktop_config.json { "mcpServers": { "code-sandbox-mcp": { "command": "C:\\path\\to\\code-sandbox-mcp.exe", "args": [], "env": {} } } }

その他のAIアプリケーション

MCP サーバーをサポートするその他の AI アプリケーションの場合は、コード実行バックエンドとしてcode-sandbox-mcpバイナリを使用するように構成します。

🛠️ 開発

プロジェクトをローカルでビルドしたり、開発に貢献したりしたい場合は、 DEVELOPMENT.md を参照してください。

📝 ライセンス

このプロジェクトは MIT ライセンスに基づいてライセンスされています - 詳細についてはLICENSEファイルを参照してください。

-
security - not tested
A
license - permissive license
-
quality - not tested

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

Docker コンテナ内でコードを実行するための安全なコード サンドボックス環境を作成する MCP サーバー。

  1. 🌟 特徴
    1. 🚀 インストール
      1. 前提条件
      2. クイックインストール
      3. 手動インストール
    2. 🛠️ 利用可能なツール
      1. sandbox_initialize
      2. copy_project
      3. write_file
      4. sandbox_exec
      5. copy_file
      6. sandbox_stop
      7. コンテナログリソース
    3. 🔐 セキュリティ機能
      1. 🔧 構成
        1. クロードデスクトップ
        2. その他のAIアプリケーション
      2. 🛠️ 開発
        1. 📝 ライセンス

          Related MCP Servers

          • -
            security
            A
            license
            -
            quality
            An MCP server that allows managing Docker containers through natural language, enabling users to compose, introspect, and debug containers without running commands themselves.
            Last updated -
            468
            Python
            GPL 3.0
            • Apple
          • -
            security
            A
            license
            -
            quality
            A secure, container-based implementation of the Model Context Protocol (MCP) that provides sandboxed environments for AI systems to safely execute code, run commands, access files, and perform web operations.
            Last updated -
            4
            Python
            Apache 2.0
            • Linux
          • -
            security
            A
            license
            -
            quality
            An MCP server that enables secure execution of shell commands across Windows, macOS, and Linux with built-in whitelisting and approval mechanisms for enhanced security.
            Last updated -
            13
            JavaScript
            MIT License
            • Linux
            • Apple
          • -
            security
            F
            license
            -
            quality
            A secure MCP server that provides controlled ShellJS access for LLMs, enabling AI systems to safely execute shell commands and interact with the filesystem within a configurable security sandbox.
            Last updated -
            JavaScript

          View all related MCP servers

          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/Automata-Labs-team/code-sandbox-mcp'

          If you have feedback or need assistance with the MCP directory API, please join our Discord server