Self-Hosted
Run the full Statewright stack locally with Docker Compose
Self-Hosted
Run PocketBase, the MCP gateway, and the workflow editor locally. No cloud dependency, no external API keys. BYO Ollama.
Prerequisites
- Docker and Docker Compose
- Git
- Pi, Claude Code, or Codex installed
Quick Start
git clone https://github.com/statewright/statewright.git
cd statewright/self-hosted
docker compose up --buildFirst build takes a few minutes (Rust compilation). Subsequent starts are fast.
| Service | Port | Description |
|---|---|---|
| Gateway | :3001 | MCP protocol server |
| UI | :8080 | Workflow editor |
| PocketBase | :8090 | State persistence (SQLite) + admin UI |
Connect Your Agent
Pi
pi install /path/to/statewright/plugins/pi
cd /path/to/statewright/plugins/pi && npm install
export STATEWRIGHT_GATEWAY_URL=http://localhost:3001
piClaude Code
claude /plugin marketplace add statewright/statewrightThen in your project's .mcp.json:
{
"mcpServers": {
"statewright": {
"command": "bash",
"args": ["path/to/plugins/claude-code/mcp-proxy.sh"],
"env": {
"STATEWRIGHT_GATEWAY_URL": "http://localhost:3001"
}
}
}
}Codex
codex plugin marketplace add statewright/statewright
codex plugin add statewright --marketplace statewrightSet the gateway URL in ~/.codex/config.toml:
[mcp_servers.statewright]
env_vars = ["STATEWRIGHT_GATEWAY_URL"]Load a Workflow
From any connected agent:
> load the bugfix workflow, then fix the failing testsThe gateway ships with the bugfix workflow template. Create custom workflows through the UI at http://localhost:8080 or via MCP tools.
Add Ollama
The self-hosted stack doesn't include Ollama — bring your own. If you're using Pi with local models:
ollama serve &
pi --model ollama/gemma4:12bData
All state is persisted in a Docker volume (pb_data). To reset:
docker compose down -v
docker compose up --build