For AI agents

Hi agent.

If you're an AI agent helping a user onboard to Stable Baseline, this page is for you. Pick the path that matches what you can do — then run it for your user.

What Stable Baseline is

An end-to-end agent-managed company brain. Humans and any MCP-compatible AI agent co-author living documents, 40+ types of visual diagrams, plans with timelines and tasks, an improvements register, and a self-learning Knowledge Graph. 163 MCP tools span document CRUD, diagrams, plans, members, teams, billing, permissions, and the Knowledge Graph itself. End-to-end means the agent can take a user from “never heard of us” to a fully configured paid org without a human touching the UI — including this onboarding flow.

Pick your path

Match these against your own capabilities and pick the first that applies. They're ordered fastest first.

What you can doUse this path
Your host runs MCP OAuth Discovery natively (ChatGPT Apps SDK, and any future host that follows the same pattern)Path B — Host-managed OAuth
You can run shell commands AND edit files on the user's machine (Copilot Chat agent mode, Cursor agent mode, Claude Code, Codex CLI, OpenCode, Antigravity, Windsurf, Warp, Gemini Code Assist)Path A — Device-code via shell
You can render text and links but not run shell or edit files (Claude Desktop, web chat, raw chat APIs)Path C — Manual key, you guide them

Don't guess — try Path A and fall back

If you're unsure whether you have shell access, attempt the first curl in Path A. If your environment errors out, the fallback is always Path C.

Path B · Host-managed OAuth

If you're embedded in ChatGPT (Apps SDK) or any host that runs MCP OAuth Discovery natively, you don't run any code. Tell the user to:

Done. Stable Baseline tools become available on the user's next message.

Path A · Device-code via shell

If you can run shell commands on the user's machine and edit files in their editor, run the device-code flow yourself. Two HTTP calls, no MCP server installation needed yet.

Use the REST adapter, not the MCP endpoint

Cloud-serve has a REST adapter at /api/v1/tools/<name> that wraps every MCP tool as a plain HTTP call — no JSON-RPC envelope, no SSE, no Accept-header gymnastics. For the bootstrap signup you don't need the full MCP semantics, so use REST. Your MCP-aware client (VS Code, Cursor, Claude Code, etc.) still talks to the /mcp endpoint after you've written its config in step 3.

Step 1 — Start the signup

POST to the anonymous-callable REST endpoint with the agent_label and intent. No Authorization header required — the signup tools are anonymous-callable.

http
POST https://api.stablebaseline.io/functions/v1/cloud-serve/api/v1/tools/startSignup
Content-Type: application/json

{ "agent_label": "<your client name>", "intent": "mcp_setup" }

Use whatever HTTP client your shell handles cleanest — PowerShell Invoke-RestMethod on Windows, curl on macOS/Linux, Node fetch, Python requests. The response is plain JSON (no JSON-RPC wrapper) and contains:

Show the user the user_code and verification_url. Ask them to open the URL in their browser, sign in (or sign up — free, no credit card), confirm the code matches, and click Authorize.

Step 2 — Poll until authorized

Every poll_interval_seconds (5 s), POST to the poll endpoint with the device_code:

http
POST https://api.stablebaseline.io/functions/v1/cloud-serve/api/v1/tools/pollSignupStatus
Content-Type: application/json

{ "device_code": "<from step 1>" }

The status field walks through these values:

statusMeaningAction
pendingUser has not yet clicked Authorize.Wait poll_interval_seconds and call again.
authorizedSuccess. Response also contains api_key (sta_…), organization_id, user_id, user_email.Stop polling. Store the api_key — it's returned ONCE.
deniedUser clicked Deny.Stop and tell them. They can retry the whole flow later.
expired10-minute TTL elapsed without action.Start over from Step 1.
consumedYou already received the api_key on a previous poll.You should not see this if you stopped polling on authorized. If you do, the api_key from your earlier response is the one to use.
not_foundBad device_code.Hard failure. Start over.

Step 3 — Write the MCP config for the user's client

The exact file path and JSON shape varies per client. See per-client recipes below for the right config block. The constants you'll need everywhere:

Tell the user to reload their host (or restart the session) so the new MCP server is picked up.

Verify connection

After writing the config, ask the user to run a discovery prompt like “List my Stable Baseline workspaces”. The agent should call listWorkspaces and return their workspaces. If the call fails with 401, the api_key isn't being sent — re-check the header in the config.

Path C · Manual key, you guide them

If you can only render text and links (Claude Desktop, web chat, raw chat APIs), guide the user through manual key creation, then explain exactly what to put in their host's MCP config. They do the work; you provide the steps and the JSON.

Per-client recipes

After picking your path, link the user to their specific client's recipe for the exact config file and any host-specific quirks.

What you can do once connected

Stable Baseline exposes 163 MCP tools across 17 categories. Call searchTools from any MCP client to fetch the live catalogue and the full input/output schemas. Highlights:

References