# Sandfort

> Sandfort is an open-source MCP server for agent sandbox. Self-hosted sandbox API for running AI-generated code, with an MCP server for agent. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** API, CLI, Self-hosted, Linux
- **Website:** https://sandfort.dev
- **Repository:** https://github.com/malinele/sandfort
- **MCP Registry name:** io.github.malinele/sandfort
- **Categories:** [agent sandbox](https://ai-powered.com/categories/agent-sandbox)
- **Listing updated:** 2026-11-27

## About

Sandfort gives coding agents a place to execute the code they write. Each sandbox supports command execution, Python, JavaScript, TypeScript and bash runs, file transfer, git clone and commit, background processes, interactive terminals and snapshots, so an agent can stage a repository, run its tests and start again from a clean state.

The server runs on Docker hosts you control, with a choice of isolation per sandbox: a standard container, a gVisor user-space kernel, or a microVM where KVM is available. Access is governed by scoped API keys, roles, label-limited keys, per-organization quotas and a hash-chained audit log. The hosted beta is an invite-only evaluation instance with no SLA, and the project is pre-1.0.

The MCP server exposes sandbox creation, command and code execution, file transfer, snapshots and sandbox management to any MCP-compatible client. It suits platform teams and developers building coding agents who need execution that stays on their own infrastructure.

## Features

- **Command and code execution:** Runs shell commands and Python, JavaScript, TypeScript or bash code, returning exit codes and a stop reason when a run ends early.
- **Files and git inside sandboxes:** Uploads, downloads and lists files, and clones, commits, pushes and pulls repositories from within the sandbox.
- **Background processes and terminals:** Keeps long-running commands alive with logs and kill controls, offers a preview URL for dev servers and an interactive PTY.
- **Snapshots and resets:** Resets a sandbox to a fresh filesystem while keeping its id, or snapshots a prepared sandbox to start new ones from.
- **Selectable isolation tiers:** Chooses container, gVisor or microVM isolation per sandbox, with network blocking or an egress allowlist.
- **Audit, roles and quotas:** Records mutating calls in a hash-chained audit log, with admin, developer and viewer roles and per-organization quotas.

## Good for

- Run a coding agent's generated tests in an isolated sandbox and read the failure output back to the model
- Clone a repository into a sandbox, apply a patch and commit the result for review
- Evaluate many candidate solutions by resetting one sandbox between attempts
- Give an MCP-enabled assistant a controlled environment to execute code and manage files
- Keep agent-executed code on company hosts for security or compliance reasons

## Install

### Claude Code: Add with the CLI (Terminal)

```sh
claude mcp add sandfort --env SANDFORT_BASE_URL='<SANDFORT_BASE_URL>' --env SANDFORT_API_KEY='<SANDFORT_API_KEY>' -- uvx sandfort-mcp
```

Add --scope user to use it in every project, or --scope project to share it in .mcp.json.

### Claude Code: Or share it with your project (.mcp.json)

```json
{
  "mcpServers": {
    "sandfort": {
      "command": "uvx",
      "args": [
        "sandfort-mcp"
      ],
      "env": {
        "SANDFORT_BASE_URL": "<SANDFORT_BASE_URL>",
        "SANDFORT_API_KEY": "<SANDFORT_API_KEY>"
      }
    }
  }
}
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "sandfort": {
      "command": "uvx",
      "args": [
        "sandfort-mcp"
      ],
      "env": {
        "SANDFORT_BASE_URL": "<SANDFORT_BASE_URL>",
        "SANDFORT_API_KEY": "<SANDFORT_API_KEY>"
      }
    }
  }
}
```

Settings → Developer → Edit Config, then quit and reopen Claude Desktop.

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "sandfort": {
      "command": "uvx",
      "args": [
        "sandfort-mcp"
      ],
      "env": {
        "SANDFORT_BASE_URL": "<SANDFORT_BASE_URL>",
        "SANDFORT_API_KEY": "<SANDFORT_API_KEY>"
      }
    }
  }
}
```

Use .cursor/mcp.json in a project to share it with the project.

### VS Code (~/.copilot/mcp-config.json)

```json
{
  "mcpServers": {
    "sandfort": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "sandfort-mcp"
      ],
      "env": {
        "SANDFORT_BASE_URL": "<SANDFORT_BASE_URL>",
        "SANDFORT_API_KEY": "<SANDFORT_API_KEY>"
      }
    }
  }
}
```

Or put the same entry in .mcp.json at your workspace root to share it.

### Codex: Add with the CLI (Terminal)

```sh
codex mcp add sandfort --env SANDFORT_BASE_URL='<SANDFORT_BASE_URL>' --env SANDFORT_API_KEY='<SANDFORT_API_KEY>' -- uvx sandfort-mcp
```

### Codex: Or add to config.toml (~/.codex/config.toml)

```toml
[mcp_servers.sandfort]
command = "uvx"
args = ["sandfort-mcp"]
env = { SANDFORT_BASE_URL = "<SANDFORT_BASE_URL>", SANDFORT_API_KEY = "<SANDFORT_API_KEY>" }
```

### Gemini CLI and Antigravity: Gemini CLI (~/.gemini/settings.json)

```json
{
  "mcpServers": {
    "sandfort": {
      "command": "uvx",
      "args": [
        "sandfort-mcp"
      ],
      "env": {
        "SANDFORT_BASE_URL": "<SANDFORT_BASE_URL>",
        "SANDFORT_API_KEY": "<SANDFORT_API_KEY>"
      }
    }
  }
}
```

Or run: gemini mcp add -s user -e SANDFORT_BASE_URL='<SANDFORT_BASE_URL>' -e SANDFORT_API_KEY='<SANDFORT_API_KEY>' sandfort uvx -- sandfort-mcp

### Gemini CLI and Antigravity: Antigravity (~/.gemini/config/mcp_config.json)

```json
{
  "mcpServers": {
    "sandfort": {
      "command": "uvx",
      "args": [
        "sandfort-mcp"
      ],
      "env": {
        "SANDFORT_BASE_URL": "<SANDFORT_BASE_URL>",
        "SANDFORT_API_KEY": "<SANDFORT_API_KEY>"
      }
    }
  }
}
```

Use .agents/mcp_config.json to add it to one workspace only.

### Devin Desktop (~/.config/devin/mcp_config.json)

```json
{
  "mcpServers": {
    "sandfort": {
      "command": "uvx",
      "args": [
        "sandfort-mcp"
      ],
      "env": {
        "SANDFORT_BASE_URL": "<SANDFORT_BASE_URL>",
        "SANDFORT_API_KEY": "<SANDFORT_API_KEY>"
      }
    }
  }
}
```

On Windows the file is %APPDATA%\\devin\\mcp_config.json. Use .devin/mcp_config.json to share it with a project.

### Cline (cline_mcp_settings.json)

```json
{
  "mcpServers": {
    "sandfort": {
      "command": "uvx",
      "args": [
        "sandfort-mcp"
      ],
      "env": {
        "SANDFORT_BASE_URL": "<SANDFORT_BASE_URL>",
        "SANDFORT_API_KEY": "<SANDFORT_API_KEY>"
      }
    }
  }
}
```

Open it from the MCP Servers icon → Configure → Configure MCP Servers.

### Zed (Zed settings.json)

```json
{
  "context_servers": {
    "sandfort": {
      "command": "uvx",
      "args": [
        "sandfort-mcp"
      ],
      "env": {
        "SANDFORT_BASE_URL": "<SANDFORT_BASE_URL>",
        "SANDFORT_API_KEY": "<SANDFORT_API_KEY>"
      }
    }
  }
}
```

Open it with zed: open settings file. Merge context_servers into the settings you already have.

### JetBrains AI Assistant and Junie: AI Assistant (Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add)

```json
{
  "mcpServers": {
    "sandfort": {
      "command": "uvx",
      "args": [
        "sandfort-mcp"
      ],
      "env": {
        "SANDFORT_BASE_URL": "<SANDFORT_BASE_URL>",
        "SANDFORT_API_KEY": "<SANDFORT_API_KEY>"
      }
    }
  }
}
```

The AI Assistant docs only show command and args. If the env block is ignored, use Junie for this server.

### JetBrains AI Assistant and Junie: Junie (~/.junie/mcp/mcp.json)

```json
{
  "mcpServers": {
    "sandfort": {
      "command": "uvx",
      "args": [
        "sandfort-mcp"
      ],
      "env": {
        "SANDFORT_BASE_URL": "<SANDFORT_BASE_URL>",
        "SANDFORT_API_KEY": "<SANDFORT_API_KEY>"
      }
    }
  }
}
```

Use .junie/mcp/mcp.json to share it with a project.

### Kiro (~/.kiro/settings/mcp.json)

```json
{
  "mcpServers": {
    "sandfort": {
      "command": "uvx",
      "args": [
        "sandfort-mcp"
      ],
      "env": {
        "SANDFORT_BASE_URL": "<SANDFORT_BASE_URL>",
        "SANDFORT_API_KEY": "<SANDFORT_API_KEY>"
      }
    }
  }
}
```

Use .kiro/settings/mcp.json to add it to one workspace only.

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "sandfort": {
      "command": "uvx",
      "args": [
        "sandfort-mcp"
      ],
      "env": {
        "SANDFORT_BASE_URL": "<SANDFORT_BASE_URL>",
        "SANDFORT_API_KEY": "<SANDFORT_API_KEY>"
      }
    }
  }
}
```

## Tools

From the tool list in its README, going by the names, 1 of 8 tools deletes data and 5 change data. From the server's own tool labels and tool names; not verified by us.

- `create_sandbox` (name suggests: changes): Creates a sandbox, with optional timers, labels, network block, egress allowlist and isolation tier.
- `run_code` (name suggests: changes): Runs code in a sandbox.
- `run_command` (name suggests: changes): Runs a command in a sandbox.
- `create_snapshot` (name suggests: changes): Creates a snapshot of a sandbox.
- `upload_text_file` (name suggests: changes): Uploads a text file into a sandbox.
- `download_text_file` (name suggests: reads): Downloads a text file from a sandbox.
- `list_sandboxes` (name suggests: reads): Lists sandboxes.
- `delete_sandbox` (name suggests: deletes): Deletes a sandbox.

## FAQ

### Can Sandfort be self-hosted?

Yes. The server runs on a Linux Docker host, and production use is self-hosted. A hosted beta exists for evaluation only, without production secrets.

### What license does Sandfort use?

The server is source-available under FSL-1.1-Apache-2.0, which allows self-hosting and modification but not running a competing service. The Python SDK, TypeScript SDK and CLI are Apache-2.0.

### How is the MCP server configured?

It runs over stdio as a Python package and needs a base URL for the Sandfort server and an API key, supplied as environment variables.

### Which languages can the agent run?

Code runs support Python, JavaScript, TypeScript and bash, and command execution runs anything installed in the image.

### Is Sandfort free?

Yes. Sandfort is open source, so you can use and self-host it for free.

### How do I add Sandfort to Claude Code?

Run this command in your terminal: claude mcp add sandfort --env SANDFORT_BASE_URL='<SANDFORT_BASE_URL>' --env SANDFORT_API_KEY='<SANDFORT_API_KEY>' -- uvx sandfort-mcp

### What are the best alternatives to Sandfort?

The closest alternatives to Sandfort are Sandbox as a Service, Sandscale, Sandbox Env MCP, SandboxAPI and MCP Sandbox Computer VM for AI.

## Where this comes from

- Description: written from the project's README, the project's website and its MCP Registry entry.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [Sandbox as a Service](https://ai-powered.com/mcp/sandbox-as-a-service): Sandbox as a Service is an MCP server for developer tools.
- [Sandscale](https://ai-powered.com/mcp/sandscale): Sandscale is a freemium MCP server for agent sandbox.
- [Sandbox Env MCP](https://ai-powered.com/mcp/sandbox-env-mcp): Sandbox Env MCP is an open-source MCP server for developer tools.
- [SandboxAPI](https://ai-powered.com/mcp/sandboxapi): SandboxAPI is an MCP server for developer tools.
- [MCP Sandbox Computer VM for AI](https://ai-powered.com/mcp/mcp-sandbox-computer-vm-for-ai): MCP Sandbox Computer VM for AI is an MCP server for developer tools.
- [LumiCloud Sandboxes](https://ai-powered.com/mcp/lumicloud-sandboxes): LumiCloud Sandboxes is an MCP server for agent sandbox.
- [Prized Sandboxes](https://ai-powered.com/mcp/prized-sandboxes): Prized Sandboxes is an MCP server for agent tooling.
- [Sandboxer](https://ai-powered.com/mcp/sandboxer): Sandboxer is a paid MCP server for cloud and infrastructure.

---
Source: https://ai-powered.com/mcp/sandfort
