> ## Documentation Index
> Fetch the complete documentation index at: https://docs.specpilot.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# specpilot serve

> Start the SpecPilot App and the local MCP endpoint for one or more projects.

```bash theme={null}
specpilot serve [folders...] [options]
```

## Options

| Option | What it does | Default |
| - | - | - |
| `-p, --port <number>` | The port to listen on | `4321` |
| `--poll <ms>` | How often to check spec files for changes, 250 or more | `1000` |
| `--read-only` | No task moves, no setup and no Home. The MCP endpoint offers only its read tools | Off |
| `--open` | Opens the App in your default browser | Off |
| `--no-mcp` | Doesn't serve the local MCP endpoint at `/mcp` | MCP on |
| `--stop` | Stops the App running on this machine. Takes only `--port` | |

Set `SPECPILOT_MCP_TOKEN` (32 or more visible characters) to keep the same MCP token across restarts. See [Keep the token](https://docs.specpilot.dev/mcp/on-off.md#keep-the-token).

## What it does

* Listens on 127.0.0.1 only.
* With no folder named, serves the current folder if it has `.specs/`. Otherwise it starts with no project open, and you open one from the App. With `--read-only` it exits instead.
* A named folder without `.specs/` is served so you can set it up from the App.
* Reopens your remembered projects after the named ones, up to 20 projects in all.
* Removes staging folders left by an interrupted setup.
* Prints the App's URL, each project's `.specs/` path, the MCP endpoint, and the line for Claude Code's `.mcp.json`. Under a project with Cursor's old rules file, `.cursor/rules/project.mdc`, it adds a line saying how to fix it (see [specpilot migrate](https://docs.specpilot.dev/reference/cli/migrate.md#the-old-cursor-rules-file)).

## What it writes

From the App: only `planning/tasks.md`, `planning/tasks-archive.md` and the `specpilot-*` command files, plus the new files of a setup and the fixes for Cursor's old rules file. It also remembers your projects in `~/.specpilot/projects.json`, and each project where you chose Keep both for Cursor's rules files in `~/.specpilot/cursor-rules.json`.

With `--read-only`, nothing.

## Stopping it

Press Ctrl+C in its terminal, or run `specpilot serve --stop` (add `--port` if it isn't on 4321). `--stop` exits with 1 when no App is found. An App started with `--read-only` stops only with Ctrl+C.

If the port is in use, `serve` says so and suggests the next one.

## Examples

```bash theme={null}
specpilot serve
specpilot serve ~/code/api ~/code/web --open
specpilot serve --read-only --no-mcp
```

See [Get started](https://docs.specpilot.dev/get-started.md) and [Turn it on or off](https://docs.specpilot.dev/mcp/on-off.md).

Checked against SpecPilot 2.22.0.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.