Automation & MCP

Reference

Automation

6 min readUpdated October 2026

Automate StackBlaze with the REST API, stackblaze.yaml, or MCP. The dashboard is a Vue client of the same API. For terminal workflows, the stackblaze CLI wraps these endpoints in commands.

terminal

# Token from Settings → API tokens

export STACKBLAZE_TOKEN=kbr_pat_…

# List projects

$ curl -sS https://api.stackblaze.cloud/api/pipelines -H "Authorization: Bearer $STACKBLAZE_TOKEN"

# Restart production/api

$ curl -sS https://api.stackblaze.cloud/api/apps/acme-app/production/api/restart -H "Authorization: Bearer $STACKBLAZE_TOKEN"

Authentication

Settings → API tokens → Generate tokenMint a kbr_pat_ token scoped to the current organization. The secret is shown once.
Authorization: Bearer $STACKBLAZE_TOKENSend the token on every /api request. Session cookies work for the dashboard only.

Projects and apps

GET /api/pipelinesList projects in the active organization
GET /api/pipelines/{pipeline}/appsList apps across phases
GET /api/apps/{pipeline}/{phase}/{app}Read an app spec
GET /api/apps/{pipeline}/{phase}/{app}/restartRestart a running app
POST /api/deployments/build/{pipeline}/{phase}/{app}Queue a new image build

stackblaze.yaml

GET /api/iac/blueprint/schemaPublic JSON Schema (no auth)
GET /api/iac/status?pipeline=Whether IaC is enabled for the project
POST /api/iac/blueprint/validateParse and compile. Body { yaml }. Requires IaC on.
POST /api/iac/blueprint/compileCompile YAML. Body needs yaml, pipeline, and phase. Not IaC-gated.
POST /api/iac/blueprint/planDiff YAML against the live project (IaC on)
POST /api/iac/blueprint/applyUpsert pipeline, apps, and databases. Never deletes.
GET /api/iac/blueprint/export?pipeline=Download a live phase as stackblaze.yaml. Query pipeline is required.

MCP

https://mcp.stackblaze.cloud/mcpConnect Cursor, Claude, or any MCP client with Authorization: Bearer kbr_pat_…, or run stackblaze setup agent -y to configure it for you.
get_app, deploy_app, search_logs, …Tool names are unprefixed in code. Docs sometimes write stackblaze_* — use the unprefixed name.

CI/CD

Store STACKBLAZE_TOKEN as a CI secret, install the CLI with the one-liner, and run stackblaze up --ci --wait. It builds the exact pushed commit, streams the build as NDJSON, and fails the job when the build fails or the app does not come up. The CLI & CI guide has a complete GitHub Actions workflow. Prefer raw HTTP? Call the endpoints above with the same token, or apply a stackblaze.yaml when IaC is enabled. If the project already auto-deploys on push from GitHub, you need neither.