Purgatory (p7y) — Claude Code MCP server: how to install
Connects AI agents to isolated Docker sandboxes on your server. Runs compose stacks and puts idle environments to sleep.
Open on GitHubWhat Purgatory (p7y) does
This MCP server connects AI agents to self-hosted sandbox environments. Each workspace runs an independent Docker daemon, exposes HTTP routes for web apps, and provides direct TLS endpoints for databases. Inactive sandboxes pause automatically to preserve system memory, waking up whenever an incoming HTTP call arrives.
Under the hood, the system coordinates Docker-in-Docker, Traefik, frp, and Sablier. Deploying the host requires Docker Engine with the compose plugin along with available ports 80 and 443. Development is in an early stage prior to version 1.0. Breaking changes between minor releases are expected.
Running untrusted code from strangers on this setup is risky without sysbox. Sandboxes default to privileged dind containers, so hostile payloads could compromise the host.
What it helps with
- spin up isolated Docker containers using an AI agent
- assign public web URLs and TLS endpoints to agent builds
- suspend inactive sandboxes to free up host memory
- restrict agent permissions to a single sandbox token
Example prompts for the agent
- Create a new Purgatory sandbox and deploy the services from docker-compose.yml
- Check the sandbox status and return the public URL for the running app
- Shut down the sandbox and archive its volume data
How to install Purgatory (p7y)
1Template address
The server address is a template: replace {…} or […] with your own values
2Platform CLI: remote server
claude mcp add --transport http purgatory-p7y https://p7y.{domain}/mcp1Template address
The server address is a template: replace {…} or […] with your own values
2Platform CLI: remote server
codex mcp add purgatory-p7y --url https://p7y.{domain}/mcp1Template address
The server address is a template: replace {…} or […] with your own values
2Config file
{
"mcpServers": {
"purgatory-p7y": {
"url": "https://p7y.{domain}/mcp"
}
}
}1Template address
The server address is a template: replace {…} or […] with your own values
2Config file
{
"servers": {
"purgatory-p7y": {
"type": "http",
"url": "https://p7y.{domain}/mcp"
}
}
}1Template address
The server address is a template: replace {…} or […] with your own values
2Platform CLI: remote server
gemini mcp add -t http purgatory-p7y https://p7y.{domain}/mcpStep by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Purgatory (p7y)
How to install Purgatory (p7y) in Claude Code?
Run claude mcp add --transport http purgatory-p7y https://p7y.{domain}/mcp, substituting {domain} with your deployed Purgatory host domain.
What does the Purgatory MCP server do?
It allows agents to provision private Docker sandboxes, deploy compose configurations, and retrieve assigned application URLs via HTTP JSON-RPC.
Can Purgatory safely run untrusted code?
Default setups rely on privileged dind, which is suitable only for trusted team members. For hostile code, you need sysbox installed or microVM alternatives like E2B.