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.
Quickest path · Have Claude Code do it
Already running Claude Code in this repo? Paste the prompt below. Claude runs the device-code signup against Stable Baseline's anonymous-callable endpoint, shows you a 6-character code to authorise in your browser, then registers the server with claude mcp add. You never copy a key by hand or open the website to mint one.
One block, paste-and-go
I want to onboard to Stable Baseline using its agent-driven signup. Walk me through end-to-end without stopping in between.
1. POST https://api.stablebaseline.io/functions/v1/cloud-serve/api/v1/tools/startSignup
Body: {"agent_label": "Claude Code", "intent": "mcp_setup"}
Response: {user_code, verification_url, device_code, poll_interval_seconds, ...}
Show me user_code and verification_url. Tell me to open the URL, sign in or sign up, paste the code, click Authorize.
2. Every 5 seconds, POST https://api.stablebaseline.io/functions/v1/cloud-serve/api/v1/tools/pollSignupStatus
Body: {"device_code": "<from step 1>"}
Stop when status is "authorized" — response includes api_key (starts with sta_). If denied or expired, tell me and stop.
3. Register the server with Claude Code's MCP CLI (project scope so teammates pick it up on clone):
claude mcp add --transport http --scope project sb \
https://api.stablebaseline.io/functions/v1/cloud-serve/mcp \
--header "Authorization: Bearer <YOUR_KEY>"
This writes .mcp.json into the repo root.
4. Tell me to start a fresh Claude Code session (or run /mcp to refresh) so the new server is loaded. Type /sb to see the prompt catalogue. Then ask what I want to do next.Already have a key? Skip below
--scope user for global), or prefer the shell-environment-variable approach.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 of 163. 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 →