OpenCode with Stable Baseline.
Add Stable Baseline to OpenCode's config, sign in from the browser, and document your repository with the sb-setup prompt.
1. Add the server
| For | File |
|---|---|
| This project | opencode.json in the project root |
| Every project | ~/.config/opencode/opencode.json |
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"sb": {
"type": "remote",
"url": "https://api.stablebaseline.io/functions/v1/cloud-serve/mcp"
}
}
}OpenCode signs you in when it first connects. You can also run it yourself:
opencode mcp auth sb # sign in opencode mcp list # see each server and whether it is connected opencode mcp logout sb # sign out
Or use an API key
Create one under Organisation settings, Developers, API keys. See Setup. Refer to it through an environment variable, and turn OpenCode's own sign-in off for this server:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"sb": {
"type": "remote",
"url": "https://api.stablebaseline.io/functions/v1/cloud-serve/mcp",
"headers": {
"Authorization": "Bearer {env:STABLE_BASELINE_API_KEY}"
},
"oauth": false
}
}
}Keep the key out of your files
STABLE_BASELINE_API_KEY environment variable or your tool's secret store, and refer to it from the config as shown. Never paste the key itself into a file you commit or share. Signing in with OAuth avoids keys altogether.2. Document the repository
Type /sb:sb-setup and say what you want, for example “architecture docs for new engineers”. It then:
Checks the connection
It confirms it can reach Stable Baseline with your key or sign-in.Finds your workspace and project
It never creates them: if it cannot find the ones you mean, it asks you to create them in the app first.Remembers them
It writes their ids to .sb/config.json, and keeps .sb/ out of git.Checks for existing docs
If the project already has documentation, it asks whether to add to it, replace it, or stop.Reads the repository
It works through the code to understand what is there.Designs a structure
Folders and documents that fit this repository, not a fixed template.Writes it
Folders, documents, and the diagrams each document needs.Updates AGENTS.md
It adds a Stable Baseline section with rules for keeping the docs current, and keeps everything else in the file.Sums up
It tells you what it created.
Every Stable Baseline prompt appears the same way, such as /sb:sb-update. See the full list.
3. Try it
- “What changed in the checkout service this week? Update its document.”
- “Add a sequence diagram of the sign-in flow to the authentication document.”
- “Create a plan for the database migration with three phases.”
- “Log a risk in the work register: the payment provider's rate limits.”