Capsule Bash Server
OfficialCapsule Bash MCP
AIエージェントが安全で永続的なサンドボックス環境でbashコマンドを実行できるようにするMCPサーバーです。
仕組み
各セッションはWebAssemblyサンドボックス内で実行されます。サンドボックスは以下を提供します:
永続的な状態: セッション内のコマンド間で、作業ディレクトリ(cwd)、環境変数、ファイルシステムの変更が保持されます
ファイルシステムの差分: すべての
runレスポンスには、ディスク上で何が変更されたかの差分が含まれます分離されたメモリ: 各セッションは独自のメモリアドレス空間を持ち、セッション間での漏洩はありません
ホストへのアクセス不可: サンドボックスはホストのファイルシステムやネットワークにアクセスできません
詳細は Capsule Bash を参照してください。
Related MCP server: execkit-mcp
ツール
ツール | 説明 |
| サンドボックス化されたセッションでbashコマンドを実行します。標準出力、標準エラー出力、終了コード、ファイルシステムの差分、および現在の状態(cwd + env)を返します。 |
| セッションのファイルシステムと状態(cwd、環境変数)を初期値にリセットします。 |
| すべてのアクティブなセッションを一覧表示します。 |
セッション
同じ session_id 内のコマンドは、呼び出し間でcwd、環境変数、ファイルシステムの状態を共有します。
例
AIエージェントに次のように尋ねてください:
「数値のリストの平均を計算するPythonスクリプトを書いてください。」
エージェントは run を順番に呼び出します:
{ "command": "mkdir -p /data && cd /data", "session_id": "custom_session" }
{ "command": "echo 'nums = [x for x in [1, 2, 3, []] if isinstance(x, int)]\nprint(sum(nums) / len(nums))' > avg.py", "session_id": "custom_session" }
{ "command": "python3 avg.py", "session_id": "custom_session" }各呼び出しは stdout、stderr、exitCode、ファイルシステムの diff、および更新された state を返し、コンテキストを充実させ、会話履歴にトレースを残します。
セットアップ
MCPクライアントの設定(Claude Desktop、Cursorなど)に追加してください:
{
"mcpServers": {
"bash": {
"command": "npx",
"args": ["-y", "@capsule-run/bash-mcp"]
}
}
}制限事項
すべてのbashコマンドとオプションが実装されているわけではありません。コマンドが不足している場合や予期しない動作をする場合は、お気軽に issueを作成 してください。
Available Tools
3 toolsresetA
Reset a session's filesystem and shell state (cwd, env vars) to their initial values. Useful to start fresh without creating a new session.
Inputs: session_id.
runB
Execute a Bash command in the sandboxed environment
Inputs: command (required), session_id.
sessionsA
List all active session IDs and their current state.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool has a unique, clear purpose: reset reverts state, run executes commands, and sessions lists active sessions. No ambiguity or overlap exists.
All tool names are single, imperative verbs (reset, run, sessions) following a consistent, simple pattern.
Three tools is well-scoped for a bash sandbox server, covering essential operations without superfluous or missing tools.
The set covers core actions (run, reset, list sessions) but lacks explicit session creation; likely sessions are created implicitly, leaving a minor gap.
Maintenance
Related MCP Connectors
Secure Linux sandboxes for AI agents, as MCP tools.
Cloud Linux VMs for your agent: run code, Docker, files and HTTPS previews in a Sandboxer microVM.
Linux machines for AI agents: create, run commands, snapshot, fork, sandbox. Alpha.
Autonomous agent guardrails, bash sandboxing, MCP rugpull diffing & prompt firewalls.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceA throwaway Docker sandbox for agents to run code and shell commands safely.8 npmMIT
- AlicenseAqualityBmaintenanceStateful, structured, safe shell sessions for AI agents, on real infrastructure.713Apache 2.0
- AlicenseAqualityBmaintenanceExposes persistent, stateful remote Bash sessions to AI agents via SSH, enabling command execution with preserved working directory and environment.772 npm1MIT
- AlicenseAqualityCmaintenanceSandboxed bash execution MCP server for AI agents, using an in-memory virtual filesystem overlay to prevent real filesystem damage, with configurable network access, timeouts, and optional Python/JS runtimes.984 npmApache 2.0