Spacelift MCP Server
Published
At a glance
- Category
- Cloud & DevOps
- GitHub repository
- spacelift-io/spacectl
- Watch out for
- The spacectl server runs only as a local stdio process. The hosted /mcp endpoint is separate and exposes a different, GraphQL-based tool set (discover, query, mutate, intent and policy tools).
Spacelift offers two MCP options. Its hosted server lives at the /mcp path of your account, for example https://<account-name>.app.spacelift.io/mcp, and uses browser OAuth. This guide also covers the local option, a subcommand of spacectl, the official Spacelift CLI, which Spacelift maintains and recommends installing through Homebrew, winget, asdf or its GitHub Action. Running spacectl mcp server starts a local stdio server that talks to your Spacelift account.
Authentication is the same as the CLI. You can log in with a stored profile, or pass SPACELIFT_API_TOKEN, or use an API key through SPACELIFT_API_KEY_ENDPOINT, SPACELIFT_API_KEY_ID and SPACELIFT_API_KEY_SECRET. A Docker image at ghcr.io/spacelift-io/spacectl runs the same command if you would rather not install the binary.
The tools fall into three groups: stack and run management, the private module registry, and introspection of the Spacelift GraphQL API. That last group is handy when an agent needs to write its own queries against the API rather than relying only on the packaged tools.
How it connects
Your AI app
An assistant or agent that supports MCP
Spacelift MCP Server
Runs as
- Docker
- Remote (HTTP)
Gives the agent
- Stacks and runs
- Logs and changes
- Run control
- Local preview and resources
- Module registry
- GraphQL schema
Spacelift
The data or system the tools act on
What it can do
- Stacks and runs
- list_stacks, list_stack_runs, list_stack_proposed_runs and get_stack_run let an agent find stacks and inspect tracked or preview runs.
- Logs and changes
- get_stack_run_logs pages through run logs and get_stack_run_changes shows the infrastructure changes a run produced.
- Run control
- trigger_stack_run starts PROPOSED or TRACKED runs, confirm_stack_run approves runs waiting for confirmation and discard_stack_run cancels pending or running ones.
- Local preview and resources
- local_preview creates a preview run from files in your local workspace, and list_resources shows resources managed by stacks.
- Module registry
- list_modules, get_module, list_module_versions, get_module_version and search_modules browse the private registry, including inputs, outputs and consumers.
- GraphQL schema
- introspect_graphql_schema, get_graphql_type_details, search_graphql_schema_fields and get_authentication_guide help an agent work with the Spacelift API directly.
Setting it up
Install spacectl first, for example with brew install spacelift-io/spacelift/spacectl on macOS or Linux, or winget install spacectl on Windows, and authenticate with any of the CLI's methods such as spacectl profile login. Then open your AI tool's MCP configuration file and add a server named spacelift under mcpServers with command spacectl and args ["mcp", "server"]. If you prefer Docker, use command docker with args run -i --rm -e SPACELIFT_API_TOKEN=your-api-token-here ghcr.io/spacelift-io/spacectl mcp server, or swap the token for SPACELIFT_API_KEY_ENDPOINT, SPACELIFT_API_KEY_ID and SPACELIFT_API_KEY_SECRET. Restart the AI tool so it picks up the change. The README gives this generic mcpServers block for the local server. For the hosted server, Spacelift's connecting guide gives steps for Claude Code, Cursor, VS Code, Codex and Gemini CLI. In Claude Code, for example, run claude mcp add spacelift -t http https://<account-name>.app.spacelift.io/mcp and approve access in the browser.
Where each client keeps its MCP config file, and the JSON it expects (cheat sheet)
Where it helps
- Finding out why a stack's last tracked run failed by reading its logs and change set.
- Running a proposed plan from local, uncommitted Terraform changes with local_preview before pushing.
- Approving or discarding a run that is waiting for confirmation after reviewing its changes.
- Looking up a private module's inputs, outputs and versions while writing new infrastructure code.
- Exploring the Spacelift GraphQL schema to build a custom query.
Limitations and things to watch
- The spacectl server runs only as a local stdio process. The hosted /mcp endpoint is separate and exposes a different, GraphQL-based tool set (discover, query, mutate, intent and policy tools).
- trigger_stack_run and confirm_stack_run can apply real infrastructure changes, so the credentials you give it deserve care.
- Tokens exchanged from an API key or GitHub token last between 1 and 10 hours, so long sessions may need fresh credentials.
- The tool set covers stacks, runs, resources, modules and the schema; other Spacelift areas need the CLI or GraphQL API.
Sources
Written from the project's own documentation, checked November 2026.
- github.com /spacelift-io/spacectl
- github.com /spacelift-io/spacectl/blob/main/README.md
- docs.spacelift.io /concepts/intelligence/spacelift-mcp
- docs.spacelift.io /concepts/intelligence/spacelift-mcp/connecting
- docs.spacelift.io /concepts/spacectl
How we research: where our facts come from, how often we re-check them, and why no one can pay for a review or a verdict.