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.
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
| Scope | Stored in | Who gets it |
|---|---|---|
| --scope project | .mcp.json | Shared via git — recommended for team repos |
| --scope local | User settings (this project only) | Only you, only this project (default if omitted) |
| --scope user | User 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:
{
"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.):
export STABLE_BASELINE_API_KEY="sta_your_api_key_here"
Verify the connection
/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:
/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.jsonwith 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.mdcontent is never removed
Available prompts
All eight Stable Baseline prompts appear as slash commands once the server is connected. Type /sb to browse them:
| Prompt | What it does |
|---|---|
sb-setup | Full onboarding — analyse repo, create docs, configure sync |
sb-sync | Regenerate AGENTS.md sync rules (preserves existing content) |
sb-create-doc | Create a single document with CDMD formatting guidance |
sb-create-diagram | Create a diagram with type selection and DSL guidance |
sb-edit-doc | Edit an existing document with merge-safe patching |
sb-manage-images | Upload and manage images in documents |
sb-manage-data | Upload CSV/JSON/TSV data files for Vega/Vega-Lite charts |
sb-update | Update 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 pattern | Documentation impact | Action |
|---|---|---|
src/components/** | UI components and patterns | Update "Frontend Patterns" |
src/lib/agents/** | AI agents and pipelines | Update "AI Services" |
supabase/functions/** | Edge functions and backend logic | Update "API & Integrations" |
supabase/migrations/** | Database schema changes | Update "Data Model" |
Your rules, your repo
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:
/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 →