MCP Server

MCP Server

Give your AI coding tool StackBlaze tools: deploy apps, read logs and metrics, and fix problems without leaving the editor.

StackBlaze runs a hosted Model Context Protocol server at https://mcp.stackblaze.cloud/mcp. Any MCP client that speaks streamable HTTP can connect to it: Claude Code, Cursor, Codex, VS Code (Copilot), Windsurf, OpenCode and others. The tools act as you: every request carries your API token, so the agent sees exactly the projects and apps your account can see, with your role's permissions.

Set it up with the CLI

The quickest way is the StackBlaze CLI. After stackblaze login, one command adds a stackblaze server to your editor's MCP config and keeps every other server and setting:

terminal
stackblaze login
stackblaze setup mcp --ide claude   # or cursor, codex, vscode, windsurf
stackblaze setup agent -y           # every AI tool on this machine

Restart the editor afterwards. --print prints the snippet instead of writing the file (with the token as a placeholder), for example to commit a workspace .vscode/mcp.json without a secret in it. See setup in the CLI reference for the file each editor uses.

Connect by hand

  1. 1

    Create an API token

    In the dashboard, open Settings → API tokens and create a token, or run stackblaze tokens create claude-mcp. Tokens start with sb_pat_ and are shown once. Older kbr_pat_ tokens keep working.
  2. 2

    Add the server to your client

    Point the client at https://mcp.stackblaze.cloud/mcp and send the token as Authorization: Bearer sb_pat_…. Examples below.
  3. 3

    Check the connection

    Ask the agent something like "list my StackBlaze projects". In Claude Code, claude mcp list should show stackblaze: … ✓ Connected.

Claude Code

terminal
claude mcp add --transport http --scope user \
  --header "Authorization: Bearer sb_pat_…" \
  stackblaze https://mcp.stackblaze.cloud/mcp

Cursor, Windsurf and other JSON configs

Cursor reads ~/.cursor/mcp.json (or .cursor/mcp.json in a project). Most clients use the same shape:

mcp.json
{
  "mcpServers": {
    "stackblaze": {
      "url": "https://mcp.stackblaze.cloud/mcp",
      "headers": { "Authorization": "Bearer sb_pat_…" }
    }
  }
}

VS Code (Copilot)

.vscode/mcp.json
{
  "servers": {
    "stackblaze": {
      "type": "http",
      "url": "https://mcp.stackblaze.cloud/mcp",
      "headers": { "Authorization": "Bearer ${input:stackblaze-token}" }
    }
  },
  "inputs": [
    { "id": "stackblaze-token", "type": "promptString", "description": "StackBlaze API token", "password": true }
  ]
}

Warning

The token in an MCP config is a live credential with your permissions. Keep it out of repositories (use the editor's user config or an input prompt), give it an expiry, and revoke it under Settings → API tokens when you no longer need it.

What the tools can do

By default the server offers a focused set of tools for deploying and troubleshooting, so it doesn't crowd your agent's context. Two more tools, find_tools and run_tool, let the agent find and use the rest when a task needs them.

AreaExamples
Browselist_pipelines, get_app, list_addons, list_builds
Deployinspect_repo, create_pipeline, deploy_app, deploy_template, update_app, redeploy, wait_for_app
Troubleshootcheck_app_health, get_logs, search_logs, get_metrics, get_app_events, diagnose_app_performance
Operaterestart_app, scale_app, repair_addon_connection, delete_app
Datainspect_database (read only), snapshot_app, restore_snapshot, clone_app, migrate_app
Accountget_billing, get_audit, support tickets

Tool names have no prefix: ask for get_app, not stackblaze_get_app. Deleting an app or a project is permanent and removes its data: delete_app and delete_pipeline only run with confirm: true and tell the agent to ask you first, so read what your agent proposes before you approve.

Good to know

TopicDetails
Live logsThe tools read log history. For a live tail, use stackblaze logs -f or the dashboard.
Private repositoriesinspect_repo reads public HTTPS repositories. Deploy private code through the GitHub App connection in the dashboard.
ErrorsA request without a valid token gets HTTP 401. Plan limits come back with the server's message, for example when a plan allows one replica per service.

Note

Prefer a chat that already knows your project? The AI agent in the dashboard and in stackblaze agent uses the same tools. For scripts and CI, use the CLI or the REST API.