Recipe

Codex with Stable Baseline.

Add Stable Baseline to Codex in one command, sign in from the browser, and ask Codex to document your repository. The same setup serves the Codex command line and its editor extension.

1. Add the server

bash
codex mcp add sb --url https://api.stablebaseline.io/functions/v1/cloud-serve/mcp
codex mcp login sb

The second command opens your browser to sign in to Stable Baseline and choose what Codex may reach. Check the connection with codex mcp list.

Or use an API key

Create one under Organisation settings, Developers, API keys. See Setup. Codex reads the key from an environment variable you name:

bash
codex mcp add sb --url https://api.stablebaseline.io/functions/v1/cloud-serve/mcp --bearer-token-env-var STABLE_BASELINE_API_KEY

That writes this to Codex's config file, which you can also edit yourself:

~/.codex/config.tomltoml
[mcp_servers.sb]
url = "https://api.stablebaseline.io/functions/v1/cloud-serve/mcp"
bearer_token_env_var = "STABLE_BASELINE_API_KEY"

A name, not a value

bearer_token_env_var takes the name of the environment variable, not the key itself.

Keep the key out of your files

Put your API key in the 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

Codex does not run MCP prompts, so ask it in plain words:

prompt
Document this repository in my Stable Baseline project. Use the Stable Baseline tools to find my workspace and project (do not create them), read the code, design a structure of folders, documents and diagrams, write them, and add a Stable Baseline section to AGENTS.md so you keep the docs current as the code changes.

It follows the same steps as the sb-setup prompt:

  1. Checks the connection

    It confirms it can reach Stable Baseline with your key or sign-in.
  2. 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.
  3. Remembers them

    It writes their ids to .sb/config.json, and keeps .sb/ out of git.
  4. Checks for existing docs

    If the project already has documentation, it asks whether to add to it, replace it, or stop.
  5. Reads the repository

    It works through the code to understand what is there.
  6. Designs a structure

    Folders and documents that fit this repository, not a fixed template.
  7. Writes it

    Folders, documents, and the diagrams each document needs.
  8. Updates AGENTS.md

    It adds a Stable Baseline section with rules for keeping the docs current, and keeps everything else in the file.
  9. Sums up

    It tells you what it created.

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.”