Automation & MCP

Reference

Automation

6 min readUpdated August 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.cloudConnect Cursor, Claude, or any MCP client. Per-session Authorization is required.
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. Prefer POST /api/deployments/build/… after your own tests, or apply a stackblaze.yaml when IaC is enabled. GitHub auto-deploy on push is configured on the project — you do not need a deploy hook URL.