About Spawner
Spawner is an open-source, self-hosted preview environment manager and CLI for development teams and coding agents. It creates a separate copy of an app for each Git branch, with its own URLs, database, and logs.
Key features
- 01Create environments from Git worktrees
- 02Include uncommitted changes
- 03Run commands in services
- 04Read environment logs
- 05Manage environment lifecycle
Use cases
- 01Previewing a feature branch before review
- 02Testing worktree changes in an isolated environment
- 03Running a database command in a branch environment
- 04Checking logs while debugging a preview
MCP support
The `spawner mcp` command runs a stdio MCP server with the CLI user's login and permissions. Its nine tools manage environments, inspect status and logs, run commands, and share URLs.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
npx -y spawner-cliSPAWNER_URLAddress of your Spawner server's dashboard, such as https://spawner.preview.example.com. Without it, the server of spawner loginSPAWNER_TOKENSecretPersonal API token (spn_...), from spawner token create or the dashboard. Without it, the token of spawner loginLocal servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.
Tools
9Saved tool list · updated 2w ago
| Parameter | Type | Required | Description |
|---|---|---|---|
| env | string | No | Environment name; by default, the branch of the worktree (feat/login gives feat-login) |
| ttl | string | No | Lifetime, such as "24h" |
| path | string | No | Absolute path of the worktree; by default, the first root the client shares, else the directory the MCP server runs in |
| refs | object | No | Sources to take from git at a branch instead: { "front": "develop" } |
| wait | boolean | No | Wait until the environment is ready (default true) |
| fresh | boolean | No | Drop the data (volumes) and start from scratch |
| reseed | boolean | No | Replay the seed steps of spawner.yaml |
| sources | object | No | Other repositories of spawner.yaml to send from local worktrees: { "front": "/path/to/front" } |
| timeout_sec | integer | No | How long to wait (default 1200) |
Details
From the project READMEspawner-cli
The command line and MCP server of Spawner. Spawner is an open source, self-hosted preview environment manager: a copy of your app for each git branch, on your own server, with its own URLs, database and logs, for teams and their coding agents.
With spawner, developers and coding agents create, update and delete environments from a worktree, uncommitted changes included, run commands in them and read their logs.
Install
npm install -g spawner-cli
It needs Node.js 20 or later, and a Spawner server: install one with a single command. Every server also serves the CLI of its own version at /api/v1/cli/spawner.
Log in
spawner login https://spawner.preview.example.com
Type the code it shows in the dashboard and approve the login: the CLI stores a personal token. In CI or a container, SPAWNER_URL and SPAWNER_TOKEN replace the login.
Commands
# write .spawner/, and offer to add the instructions for coding agents
spawner init
# the environment of the current branch, from this worktree
spawner up --wait
# run a command in a service
spawner exec feat-login db -- psql -U app -c "select * from users"
# only the error lines, stack traces kept whole
spawner logs feat-login api --errors
# a link for someone without an account
spawner share feat-login
spawner down feat-login
Before the first spawner up of a project, an admin adds the project in the dashboard (Projects, New project). The other commands: status, ls, stats, capacity, url, shell, stop, start, sleep, wake, extend, token, whoami and logout.
Commands print JSON with --json and exit with stable codes: 4 when the environment failed, 6 when the quota or the server's capacity is reached, 7 when .spawner/ was refused.
MCP server
spawner mcp is an MCP server on stdio, with the login and the rights of the CLI. In Claude Code:
claude mcp add spawner -- spawner mcp
In a project's .mcp.json, or Cursor's .cursor/mcp.json:
{
"mcpServers": {
"spawner": { "command": "spawner", "args": ["mcp"] }
}
}
It has nine tools: spawner_up, spawner_status, spawner_list, spawner_logs, spawner_exec, spawner_stats, spawner_url, spawner_share and spawner_down. spawner_exec and spawner_down are marked destructive: whether a client asks before running them depends on the client and its permission settings.
Documentation
- The CLI and the MCP server: every command, JSON outputs, exit codes
- Coding agents: Claude Code, Codex, Cursor, and the instructions
spawner initadds - Quick start: from a fresh server to the first environment
Source: github.com/Flosk6/Spawner. License: Apache-2.0.
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.