Client recipes

Claude Code with Stable Baseline.

Connect Stable Baseline to Claude Code in under two minutes. Once connected, every MCP prompt surfaces as a slash command — type /sb and the full prompt catalogue appears.

Before you begin

  • A Stable Baseline account with a workspace and project — create one at app.stablebaseline.io
  • An API key from your workspace's MCP Setup page (keys are prefixed sta_… and shown once on creation)
  • Claude Code installed — npm install -g @anthropic-ai/claude-code

Step 1 · Add the server (CLI)

Claude Code ships with a first-class MCP CLI. The project scope is recommended — it writes .mcp.json into your repo so every teammate picks the server up on clone.

Terminalbash
claude mcp add --transport http --scope project sb \
  https://api.stablebaseline.io/functions/v1/cloud-serve/mcp \
  --header "Authorization: Bearer YOUR_API_KEY"

Scope options

ScopeStored inWho gets it
--scope project.mcp.jsonShared via git — recommended for team repos
--scope localUser settings (this project only)Only you, only this project (default if omitted)
--scope userUser settings (global)Available to you across every project

Or configure manually

Prefer editing files directly? Create .mcp.json in your project root with the standard Claude Code shape:

.mcp.jsonjson
{
  "sb": {
    "type": "http",
    "url": "https://api.stablebaseline.io/functions/v1/cloud-serve/mcp",
    "headers": {
      "Authorization": "Bearer ${STABLE_BASELINE_API_KEY}"
    }
  }
}

Claude Code resolves ${STABLE_BASELINE_API_KEY} from your environment. Add the key to your shell profile (~/.bashrc, ~/.zshrc, etc.):

Shell profilebash
export STABLE_BASELINE_API_KEY="sta_your_api_key_here"

Verify the connection

Inside Claude Code, run /mcp. You should see sb listed with a green dot and a tool count in the 60+ range. If the server shows disconnected, double-check your API key and that the export is sourced in your current shell.

Step 2 · Run setup

Claude Code exposes every MCP prompt as a slash command. Type /sb to see them all, or jump straight in with the full onboarding prompt:

Claude Codeprompt
/sb-setup

What sb-setup does, in order

  • Verifies MCP connection — Confirms the server is reachable and authenticated
  • Resolves workspace & project — Picks yours, or asks if there are multiple
  • Creates local config — Writes .sb/config.json with your IDs and adds .sb/ to .gitignore
  • Analyses your repository — Reads package files, configs, directory structure, source code, READMEs — everything
  • Creates bespoke documentation — No templates. Folders and documents are tailored to your repo, with architecture diagrams included
  • Augments AGENTS.md — Adds sync rules so Claude Code knows which docs to update when code changes. Existing AGENTS.md content is never removed

Available prompts

All eight Stable Baseline prompts appear as slash commands once the server is connected. Type /sb to browse them:

PromptWhat it does
sb-setupFull onboarding — analyse repo, create docs, configure sync
sb-syncRegenerate AGENTS.md sync rules (preserves existing content)
sb-create-docCreate a single document with CDMD formatting guidance
sb-create-diagramCreate a diagram with type selection and DSL guidance
sb-edit-docEdit an existing document with merge-safe patching
sb-manage-imagesUpload and manage images in documents
sb-manage-dataUpload CSV/JSON/TSV data files for Vega/Vega-Lite charts
sb-updateUpdate docs with changes from the current conversation

How auto-sync works

sb-setup adds a rule table to your AGENTS.md. Whenever Claude Code modifies files matching a pattern, it knows which Stable Baseline document to update — and does so automatically via the MCP tools.

File patternDocumentation impactAction
src/components/**UI components and patternsUpdate "Frontend Patterns"
src/lib/agents/**AI agents and pipelinesUpdate "AI Services"
supabase/functions/**Edge functions and backend logicUpdate "API & Integrations"
supabase/migrations/**Database schema changesUpdate "Data Model"

Your rules, your repo

These patterns are generated specifically for your codebase. The table above is illustrative — sb-setup writes rules that match your actual directory layout.

Try it

After setup has run, paste any of these into the chat:

Create a document explaining our authentication flow with a sequence diagram.

Update the API documentation to reflect the new /v2/users endpoint.

Add an architecture diagram showing how our services communicate.

Document the deployment process for the staging environment.

Regenerate documentation

Need to re-run the full setup? Use the same prompt again:

Claude Codeprompt
/sb-setup

If documentation already exists, setup asks whether to augment (fill gaps), replace (start fresh), or cancel. No surprise overwrites.

Useful keys

Inside a Claude Code session, press / to open the slash-command picker, or Ctrl+C / ⌘C to cancel a running prompt if you want to course-correct mid-flight. Full API key docs →