Execute untrusted Python/JavaScript code in isolated WebAssembly sandboxes with resource limits and retries.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent โ or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag โ we're steadily working through the catalog.
๐ก Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Inspect callable tools, capabilities, and parameters exposed to AI agents by MCP Server.
Capsule is a runtime for executing untrusted code in isolated environments. Each task runs inside its own WebAssembly sandbox, providing:
Simply annotate your Python functions with the @task decorator:
Use the task() wrapper function with full access to the npm ecosystem:
[!NOTE] The runtime requires a task named
"main"as the entry point. Python will create one automatically if none is defined, but it's recommended to set it explicitly.
When you run capsule run main.py (or main.ts), your code is compiled into a WebAssembly module and executed in isolated sandboxes.
Each task operates within its own sandbox with configurable resource limits, ensuring that failures are contained and don't cascade to other parts of your workflow. The host system controls every aspect of execution, from CPU allocation via Wasm fuel metering to memory constraints and timeout enforcement.
Create hello.py:
Run it:
Create hello.ts:
Run it:
[!TIP] Add
--verboseto see real-time task execution details.
The run() function lets you execute tasks programmatically from your code instead of using the CLI. The args are automatically forwarded as parameters to the main task.
Create sandbox.py:
[!IMPORTANT] You need
@capsule-run/cliin your dependencies to use the runner functions in TypeScript.
Create sandbox.ts:
[!TIP] If you're looking for a pre-configured, ready-to-use solution, check out the Python adapter or TypeScript adapter.
Configure your tasks with these parameters:
| Parameter | Description | Type | Default | Example |
|---|---|---|---|---|
name | Task identifier | str | function name (Python) / required (TS) | "process_data" |
compute | CPU allocation level: "LOW", "MEDIUM", or "HIGH" | str | "MEDIUM" | "HIGH" |
ram | Memory limit for the task | str | unlimited | "512MB", "2GB" |
timeout | Maximum execution time | str | unlimited | "30s", "5m", "1h" |
max_retries / maxRetries | Number of retry attempts on failure | int | 0 | 3 |
allowed_files / allowedFiles | Folders accessible in the sandbox (with optional access mode) | list | [] | ["./data"], [{"path": "./data", "mode": "ro"}] |
allowed_hosts / allowedHosts | Domains accessible in the sandbox | list | [] | ["api.openai.com", "*.anthropic.com"] |
env_variables / envVariables | Environment variables accessible in the sandbox | list | [] | ["API_KEY"] |
Capsule controls CPU usage through WebAssembly's fuel mechanism, which meters instruction execution. The compute level determines how much fuel your task receives.
compute="1000000") for precise control over execution limits.Every task returns a structured JSON envelope containing both the result and execution metadata:
Response fields:
success โ Boolean indicating whether the task completed successfullyresult โ The actual return value from your task (json, string, null on failure etc.)error โ Error details if the task failed ({ error_type: string, message: string })execution โ Performance metrics:
task_name โ Name of the executed taskduration_ms โ Execution time in millisecondsretries โ Number of retry attempts that occurredfuel_consumed โ CPU resources used (see Compute Levels)ram_used โ Peak memory used in byteshost_requests โ List of host requests made by the taskTasks can make HTTP requests to domains specified in allowed_hosts. By default, no outbound requests are allowed ([]). Provide an allowlist of domains to grant access, or use ["*"] to allow all domains.
Tasks can read and write files within directories specified in allowed_files. Any attempt to access files outside these directories is not possible.
[!NOTE]
allowed_filessupports directory paths only, not individual files.
Each entry can be a plain path (read-write by default) or a structured object with an explicit mode:
"read-only" (or "ro")"read-write" (or "rw")Python's standard file operations work normally. Use open(), os, pathlib, or any file manipulation library.
Plain strings are still accepted: allowed_files=["./output"] defaults to read-write.
Common Node.js built-ins are available. Use the standard fs module:
Plain strings are still accepted: allowedFiles: ["./output"] defaults to read-write.
--mount)The --mount flag (CLI) or mounts parameter (SDK) mount a host directory into the sandbox under an alias. Mounts propagate to sub-tasks and add access to new paths, they don't change the access mode of paths already declared in allowed_files.
Format: HOST_PATH[::GUEST_PATH][:ro|:rw]
Factual signals from GitHub, npm, and our automated checks โ not a rating.
No reviews yet โ be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/mavdol-capsule-mcp-server)<a href="https://allmcps.com/mcp/mavdol-capsule-mcp-server"><img src="https://allmcps.com/api/badge/mavdol-capsule-mcp-server?style=directory" alt="MCP Server on AllMCPs" /></a>