Skip to main content
Glama
CSOAI-ORG

Code Executor MCP Server

by CSOAI-ORG

MEOK AI Labs 提供 — すべての人のためのソブリンAIツール。

Code Executor MCP Server

AIエージェント向けのサンドボックス環境でのコード実行機能です。包括的な安全ガード、出力キャプチャ、タイムアウト保護、ファイルアクセス制限を備え、Python、JavaScript、シェルコマンドを実行できます。破壊的なパターンのブロックや設定可能な制限により、本番環境での利用を想定して構築されています。

ツール

ツール

説明

execute_code

安全チェックと出力キャプチャを行い、PythonまたはJavaScriptコードを実行

run_command

破壊的なパターンをブロックしてシェルコマンドを実行

run_tests

テストスイート(pytest、jestなど)を実行し、成功/失敗の概要を表示

read_file

許可されたディレクトリ内のファイルを読み込む

list_sandbox_files

実行サンドボックス内のファイルを一覧表示

get_safety_rules

現在のブロックパターンと安全設定を表示

安全機能

  • 破壊的なシェルコマンドのブロック: rm -rf /、フォーク爆弾、パイプからシェルへの実行など

  • 危険なPythonコードのブロック: os.systemsubprocesseval(input)、生のソケット通信など

  • 危険なJavaScriptコードのブロック: child_processrequire('fs')eval()など

  • ファイルアクセスをデスクトップ、ドキュメント、ダウンロード、/tmpに制限

  • すべての実行は隔離された一時ディレクトリで実施

  • 60秒のハードタイムアウト制限

  • メモリ問題を防止するため、出力を10KBで切り捨て

インストール

pip install mcp

JavaScriptサポートのためのオプション:

brew install node  # or: apt install nodejs

使用方法

サーバーの実行

python server.py

Claude Desktopの設定

{
  "mcpServers": {
    "code-executor": {
      "command": "python",
      "args": ["/path/to/code-executor-mcp/server.py"]
    }
  }
}

呼び出し例

Pythonの実行:

Tool: execute_code
Input: {"code": "import math\nprint(f'Pi = {math.pi:.10f}')\nprint(f'e = {math.e:.10f}')", "language": "python"}
Output: {"output": "Pi = 3.1415926536\ne = 2.7182818285\n", "exit_code": 0, "elapsed_seconds": 0.045}

シェルコマンドの実行:

Tool: run_command
Input: {"command": "ls -la /tmp | head -20"}
Output: {"output": "total 128\ndrwxrwxrwt ...", "exit_code": 0, "elapsed_seconds": 0.012}

テストの実行:

Tool: run_tests
Input: {"test_command": "python -m pytest tests/ -v", "working_dir": "/path/to/project"}
Output: {"passed": true, "summary": "12 passed in 1.34s", "exit_code": 0}

ブロックされたコマンドの例:

Tool: run_command
Input: {"command": "rm -rf /"}
Output: {"error": "Command blocked by safety filter (matches: rm\\s+-rf\\s+/)"}

料金

プラン

制限

価格

Free

1日50回実行、30秒タイムアウト

$0

Pro

無制限、120秒タイムアウト、Docker隔離

$9/月

Enterprise

カスタム + ネットワークアクセス + GPU実行

お問い合わせ

ライセンス

MIT

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

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/CSOAI-ORG/code-executor-mcp'

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