Skip to main content

forkd MCP server

An MCP server that exposes forkd microVM sandboxes as tools to any MCP-aware client — Claude Desktop, Claude Code, Cursor, Cline, etc.

What it lets the agent do

Once registered, the agent can:

Tool What
list_snapshots See available parent templates
create_snapshot Build a new snapshot from kernel + rootfs (v0.2.0+)
spawn_sandboxes Fork N children from a template. Accepts prewarm: bool (v0.2.0+)
branch_sandbox Branch a running sandbox into a new tag (v0.2.0+). Accepts diff: bool for v0.3's 6-15× source-pause reduction on typical agent workloads (143× ceiling).
list_sandboxes List live sandboxes
get_sandbox Inspect one sandbox by id
exec_command Run a shell command in a sandbox
eval_code Evaluate Python against the warmed PID-1
wait_for_text Poll a file in the guest for a marker string (v0.2.0+)
ping_sandbox Health-check a sandbox
kill_sandbox Terminate one sandbox

The killer one is branch_sandbox: pause a running agent sandbox, snapshot, fan out N children that inherit the source's exact state and diverge under copy-on-write. Modal does this as their proprietary moat; forkd is the open-source equivalent. See bench/pause-window/RESULTS-v0.3.md for the measured numbers.

Each tool maps 1:1 onto a forkd-controller REST endpoint (docs/API.md). The server is stateless; the controller owns sandbox lifecycle.

Install

pip install forkd-mcp
# or from source:
pip install -e .

Requires the forkd-controller daemon running locally (README) and reachable on http://127.0.0.1:8889 by default.

Configure

Environment variables:

Var Default Purpose
FORKD_URL http://127.0.0.1:8889 Controller base URL
FORKD_TOKEN unset Bearer token, required when daemon is started with --token-file
FORKD_HTTP_TIMEOUT 60 Per-request timeout (seconds)

Register with Claude Desktop

Add to your claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "forkd": {
      "command": "forkd-mcp",
      "env": {
        "FORKD_URL": "http://127.0.0.1:8889",
        "FORKD_TOKEN": "<contents-of-/etc/forkd/token>"
      }
    }
  }
}

Restart Claude Desktop. The eight tools above will appear in the "hammer" menu.

Register with Claude Code

claude mcp add forkd --env FORKD_URL=http://127.0.0.1:8889 \
                     --env FORKD_TOKEN=$(sudo cat /etc/forkd/token) \
                     -- forkd-mcp

Verify with claude mcp list.

Register with Cursor

Add to ~/.cursor/mcp.json (or per-workspace .cursor/mcp.json):

{
  "mcpServers": {
    "forkd": {
      "command": "forkd-mcp",
      "env": {
        "FORKD_URL": "http://127.0.0.1:8889",
        "FORKD_TOKEN": "<contents-of-/etc/forkd/token>"
      }
    }
  }
}

Restart Cursor (or hit "Refresh" on the MCP settings page).

Register with Cline

In the Cline extension settings, open "MCP Servers" → "Edit MCP Settings" and add:

{
  "mcpServers": {
    "forkd": {
      "command": "forkd-mcp",
      "env": {
        "FORKD_URL": "http://127.0.0.1:8889",
        "FORKD_TOKEN": "<contents-of-/etc/forkd/token>"
      },
      "disabled": false,
      "autoApprove": ["list_snapshots", "list_sandboxes", "get_sandbox", "ping_sandbox"]
    }
  }
}

The autoApprove list is read-only tools that don't need per-call confirmation. Mutating tools (spawn_sandboxes, branch_sandbox, exec_command, kill_sandbox, create_snapshot) always prompt by default.

Smoke test

# In one shell, start the controller:
sudo systemctl start forkd-controller

# In another, run the MCP server stand-alone (stdio transport):
FORKD_TOKEN=$(sudo cat /etc/forkd/token) forkd-mcp
# The server will block on stdin waiting for an MCP client.

To exercise the server without an MCP client, point any MCP debugger at it (e.g. npx @modelcontextprotocol/inspector forkd-mcp).

What this is and isn't

Is — a thin wrapper that lets MCP clients drive forkd. The agent plans, the MCP server forwards, the controller actually forks VMs.

Isn't — a sandbox itself. forkd-controller must be running, and the host needs KVM + a registered snapshot. See recipes/ for ready-to-fork parent images.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

forkd_mcp-0.2.1.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

forkd_mcp-0.2.1-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file forkd_mcp-0.2.1.tar.gz.

File metadata

  • Download URL: forkd_mcp-0.2.1.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for forkd_mcp-0.2.1.tar.gz
Algorithm Hash digest
SHA256 c79cb2bad44733adfe97bad1b5b2a91f8454bda19d4f92b22dbfed260fb79961
MD5 85392c0156423b85e6945242ea94e094
BLAKE2b-256 35d9f240d68468d8c434c2c7bb5396f9f4b5df98da1d08312f75cf7656b5f2b2

See more details on using hashes here.

Provenance

The following attestation bundles were made for forkd_mcp-0.2.1.tar.gz:

Publisher: publish-pypi-mcp.yml on deeplethe/forkd

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file forkd_mcp-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: forkd_mcp-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for forkd_mcp-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4688ec7a78748c2060c95938a39d59a1351525aa54ad159ae0ba890c75f79539
MD5 093e2a4a0e7800603ac477a17d8e4fce
BLAKE2b-256 23c83b78a2e0be3388b68d30f6e1aca210f01d31fe7bed0a9bc04e5cb3811deb

See more details on using hashes here.

Provenance

The following attestation bundles were made for forkd_mcp-0.2.1-py3-none-any.whl:

Publisher: publish-pypi-mcp.yml on deeplethe/forkd

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 files

0.2.0

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page