mcpField
S
Spawner

Spawner

Local
spawner.runCloud & Infra0Updated 3w ago

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

  1. 01Create environments from Git worktrees
  2. 02Include uncommitted changes
  3. 03Run commands in services
  4. 04Read environment logs
  5. 05Manage environment lifecycle

Use cases

  1. 01Previewing a feature branch before review
  2. 02Testing worktree changes in an isolated environment
  3. 03Running a database command in a branch environment
  4. 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.

mcp.json · Universal config
{
"mcpServers": {
"flosk6-spawner": {
"command": "npx",
"args": [
"-y",
"spawner-cli"
],
"env": {
"SPAWNER_URL": "<SPAWNER_URL>",
"SPAWNER_TOKEN": "<SPAWNER_TOKEN>"
}
}
}
}
Run commandnpx -y spawner-cli
Environment variables to set
SPAWNER_URLAddress of your Spawner server's dashboard, such as https://spawner.preview.example.com. Without it, the server of spawner login
SPAWNER_TOKENSecretPersonal API token (spn_...), from spawner token create or the dashboard. Without it, the token of spawner login

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npmspawner-cli2.2.1

Tools

9

Saved tool list · updated 2w ago

ParameterTypeRequiredDescription
envstringNoEnvironment name; by default, the branch of the worktree (feat/login gives feat-login)
ttlstringNoLifetime, such as "24h"
pathstringNoAbsolute path of the worktree; by default, the first root the client shares, else the directory the MCP server runs in
refsobjectNoSources to take from git at a branch instead: { "front": "develop" }
waitbooleanNoWait until the environment is ready (default true)
freshbooleanNoDrop the data (volumes) and start from scratch
reseedbooleanNoReplay the seed steps of spawner.yaml
sourcesobjectNoOther repositories of spawner.yaml to send from local worktrees: { "front": "/path/to/front" }
timeout_secintegerNoHow long to wait (default 1200)

Details

From the project README

spawner-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

Source: github.com/Flosk6/Spawner. License: Apache-2.0.

Comments

Markdown supported

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.