Workflows
Cursor
Connect Cursor to Stable Baseline and get your entire codebase documented — architecture, schemas, security, business context — in one prompt.
What You'll Get
MCP Tools
Full access to Stable Baseline from Cursor: create documents, insert diagrams, manage projects.
Bespoke Documentation
Not a template. The agent analyzes YOUR repo and creates a documentation structure tailored to your tech stack, architecture, and domain.
AGENTS.md
A cross-IDE auto-sync rule file at your repo root. Works in Cursor, VS Code, Claude Code, OpenCode, Windsurf, Zed, Warp, and 15+ other tools. Keeps docs in sync whenever you make architectural changes.
Project Config
A .sb/config.json that caches project IDs so your agent skips discovery calls.
Total setup time: ~2 minutes to connect, then the agent does the rest.
Step 1: Add the MCP Server
Add the Stable Baseline MCP server to Cursor. Choose the easiest option for you:
One-Click Install
Click the button to open Cursor and add Stable Baseline automatically. Uses OAuth — no API key needed.

Requires Cursor 0.48+. You'll be prompted to authorize in your browser on first use.
Create a .cursor/mcp.json file in your project root:
Using an API Key (recommended)
{
"mcpServers": {
"stablebaseline-mcp": {
"url": "https://api.stablebaseline.io/functions/v1/cloud-serve/mcp",
"headers": {
"Authorization": "Bearer sta_your_api_key_here"
}
}
}
}Don't have an API key yet? Go to your Stable Baseline organization → Settings → MCP Setup → API Keys and create one. Full setup guide →
Using OAuth 2.1 (alternative)
If your organization uses OAuth, Cursor supports the MCP Authorization spec via its public client (PKCE) flow:
{
"mcpServers": {
"stablebaseline-mcp": {
"url": "https://api.stablebaseline.io/functions/v1/cloud-serve/mcp"
}
}
}Cursor discovers the OAuth endpoints automatically via the Protected Resource Metadata spec (RFC 9728). No manual OAuth configuration required — just the URL.
Project vs Global Config
| Scope | File Location | When to Use |
|---|---|---|
| Project | .cursor/mcp.json | Team repos — commit to git, everyone gets it |
| Global | ~/.cursor/mcp.json | Personal setup across all projects |
We recommend project-level config so every team member gets Stable Baseline automatically when they clone the repo.
Step 2: Run Setup
Open Cursor's Agent mode (⌘I / Ctrl+I) and run the sb-setup prompt. That's it — the agent handles everything from here.
Run the sb-setup prompt from the stablebaseline-mcp server
What it does (in order):
- Verifies the MCP connection — If it can't connect, it tells you exactly what to fix and waits for you to say "continue"
- Resolves your workspace & project — If you have multiple, it asks you to pick. If you have none, it links you to app.stablebaseline.io to create them and waits for you
- Creates .sb/config.json — Caches your workspace and project IDs locally
- Checks for existing documentation — If the project already has docs (e.g. created manually in the app), it shows you what's there and asks whether to augment (fill gaps), replace (start fresh), or cancel
- Analyzes your repository — Tech stack, architecture, directory structure, dependencies, security model, infrastructure, domain context, and more
- Designs a bespoke documentation structure — No fixed template. The structure is tailored to YOUR repo's natural boundaries — by service, by domain, by layer, whatever fits
- Creates the documentation in Stable Baseline — Real content with diagrams, not stubs. A developer joining tomorrow should be able to read these docs and understand the system
- Generates AGENTS.md — A cross-IDE auto-sync rule file at your repo root with file-pattern-to-document mappings specific to your codebase
- Provides a summary — Everything it created, with a tree view and next steps
If anything goes wrong at steps 1 or 2 (connection issues, missing workspace/project), the agent stops, tells you exactly what to do, and waits for you to type continue after you've fixed it. If the project already has documentation (step 4), the agent shows you what exists and lets you choose how to proceed — no surprise overwrites. No need to start over.
What Gets Documented
The agent doesn't follow a checklist. It reads your code and documents what matters for THIS repo. Areas it considers:
Technical Standards & Coding Patterns
How code should be written in this stack
Architectural Patterns
System design, component relationships, data flows, API contracts
Security Patterns
Auth flows, authorization, data protection, secrets management
Operational & Maintenance
Deployment, monitoring, incident response, runbooks
Compliance & Governance
Regulatory requirements, audit trails, data retention
Business Context
Business rules, domain models, stakeholder requirements
Drift Prevention
The "why" behind decisions so future developers don't deviate
Technical and business documentation sit side by side — consistent and driving outcomes from each other.
How Auto-Sync Works
The AGENTS.md file generated in Step 2 contains a table mapping your repo's file patterns to Stable Baseline documents:
| File Pattern | Documentation Impact | Action |
|---|---|---|
| src/auth/** | Authentication & Authorization doc | editDocument |
| migrations/** | Data Model doc | editDocument |
| docker-compose.yml, Dockerfile* | Deployment & Infrastructure doc | editDocument |
| openapi.yaml, src/routes/** | API Reference doc | editDocument |
These patterns are specific to YOUR repo. When Cursor's agent changes files matching a pattern, it knows which Stable Baseline document to update — and does so automatically using the MCP tools.
AGENTS.md is the cross-IDE standard (Linux Foundation / Agentic AI Foundation). It works in Cursor, VS Code Copilot, Claude Code, OpenCode, Windsurf, Zed, Warp, Roo Code, Aider, and 15+ other tools. Switch IDEs and the auto-sync rules follow.
File Structure
After setup, your project root will have:
your-project/ ├── .cursor/ │ └── mcp.json # MCP server config (Step 1) ├── .sb/ │ └── config.json # Project IDs (auto-generated) ├── AGENTS.md # Cross-IDE auto-sync rules (auto-generated) └── ...
All files are safe to commit to git. The API key in mcp.json is scoped to your team's workspace — or use OAuth to avoid committing secrets entirely. Add .sb/ to .gitignore if you prefer to keep IDs local.
Try It
Your baseline docs are ready. Here are some prompts to try next:
"Generate an ERD diagram from my database schema and add it to my docs."
"Create a sequence diagram for the authentication flow."
"Summarize the key design decisions in this repo and document them."
"Add a deployment architecture diagram to my infrastructure doc."
"What documentation is out of date after the changes I just made?"
Regenerate Documentation
Need to start fresh? Ask Cursor's agent:
Delete all existing folders and documents in my Stable Baseline project, then run the sb-setup prompt from the stablebaseline-mcp server to regenerate everything from scratch.
⚠️ Destructive action: This deletes all existing documents and folders in your Stable Baseline project. Document version history will be lost.