BrainstormRouter is a personal research project by Justin Jilg. It is not a commercial product, has no SLA and is not intended for production use.

Connect with OAuth (MCP)

Add BrainstormRouter to Claude, ChatGPT, and other MCP clients by signing in — no API key to paste.

This flow is off by default. It is available only on a deployment where the operator has set BR_MCP_OAUTH_ENABLED=1. When it is off, the discovery URLs below return 404 and the MCP endpoint accepts API keys only (Authorization: Bearer br_live_…).

What it does

BrainstormRouter's MCP endpoint is https://api.brainstormrouter.com/v1/mcp/connect. With OAuth enabled, an MCP client that has no key can still connect: it sends you to the BrainstormRouter dashboard, you sign in and approve what the client may do, and the client receives a short-lived token.

You do not create an OAuth app first. The client identifies itself in one of three ways:

Client identityHow it worksShown on the consent screen as
Client ID Metadata DocumentThe client_id is an https:// URL the client publishes. BrainstormRouter fetches it.The host of that URL, marked _Unverified_
Dynamic Client RegistrationThe client registers itself at POST /auth/oauth/register.The name it chose, marked _Unverified_
Pre-registered appA developer created it with POST /v1/oauth/apps (client_id starts with br_app_).Its registered name

Connect from Claude

  1. In Claude, add a custom connector (Settings → Connectors).
  2. Enter the server URL exactly: https://api.brainstormrouter.com/v1/mcp/connect
  3. Leave any OAuth client ID / secret fields empty — BrainstormRouter has no client secrets.
  4. Connect. A BrainstormRouter page opens: sign in, review the request, and choose Approve.

Claude identifies itself with a Client ID Metadata Document hosted on claude.ai, and its redirect URI is https://claude.ai/api/mcp/auth_callback. The consent screen shows both hosts — check that they are claude.ai before approving. Menu names in Claude change; Anthropic's custom connector documentation is the reference for the client side.

Connect from ChatGPT

  1. In ChatGPT, create a connector (app) that points at the MCP server URL

https://api.brainstormrouter.com/v1/mcp/connect.

  1. Choose OAuth as the authentication method. No client ID or secret is needed.
  2. Connect, sign in to BrainstormRouter, and approve.

OpenAI's authentication guide is the reference for the client side.

Connect from any other MCP client

Give the client the MCP URL. A client that follows the MCP authorization specification discovers everything else:

# 1. The MCP endpoint answers 401 and says where the metadata is
curl -i -X POST https://api.brainstormrouter.com/v1/mcp/connect
# WWW-Authenticate: Bearer resource_metadata="https://api.brainstormrouter.com/.well-known/oauth-protected-resource/v1/mcp/connect", scope="models completions tools"

# 2. Protected resource metadata (RFC 9728)
curl https://api.brainstormrouter.com/.well-known/oauth-protected-resource/v1/mcp/connect

# 3. Authorization server metadata (RFC 8414)
curl https://api.brainstormrouter.com/.well-known/oauth-authorization-server

Requirements for clients:

  • Public clients only. There are no client secrets; token_endpoint_auth_method is none.
  • PKCE with S256 is mandatory.
  • Redirect URIs must be https://…, or http:// on 127.0.0.1, localhost or [::1] (any

port). At most five. Custom URI schemes are not accepted for metadata-document or dynamically registered clients.

  • Send resource=https://api.brainstormrouter.com/v1/mcp/connect on the authorization and token

requests. Any other value is rejected with invalid_target.

  • The token endpoint accepts application/x-www-form-urlencoded (and JSON).

Endpoints

MethodPathPurpose
GET/.well-known/oauth-protected-resource/v1/mcp/connectProtected resource metadata (also served at /.well-known/oauth-protected-resource)
GET/.well-known/oauth-authorization-serverAuthorization server metadata
GET/auth/oauth/authorizeStarts sign-in and consent in the browser
POST/auth/oauth/tokenauthorization_code and refresh_token grants
POST/auth/oauth/registerDynamic client registration (RFC 7591)
POST/auth/oauth/revokeToken revocation (RFC 7009)
GET/auth/oauth/userinfoThe account behind an access token

Scopes

ScopeLets the client
modelsSee which models and providers your account can use
completionsSend prompts to models (spends on your own provider keys)
embeddingsCreate embeddings (spends on your own provider keys)
memoryRead and write your stored memories
usageRead usage, cost and audit history
toolsRun the execution tools: br_generate_image, br_generate_speech, br_transcribe_audio, br_list_connected_tools, br_call_connected_tool. This also allows sending prompts, and reading (not changing) your stored memories, which is how an agent loads the marketing brief.
offline_accessNothing by itself; clients send it to ask for a refresh token
fullEverything the developer role can do

An MCP client is told to ask for models completions tools. That is enough to read memory but not to write it; a client that should save memories must also ask for memory. If a client asks for nothing, it gets completions models. No scope reaches beyond the developer role, and a tool the token's scopes do not cover fails with Forbidden: requires .

Media and connected-service tools run on your own provider keys. If you have not added one, they return provider_key_required.

Tokens

TokenFormatLifetime
Access tokenA BrainstormRouter API key (br_live_…)1 hour
Refresh tokenOpaque (br_rt_…)30 days from the first sign-in, not extended by use

Every refresh returns a new refresh token and retires the old one, along with the previous access token. If a retired refresh token is ever presented again, BrainstormRouter treats it as stolen: the whole chain and its current access token are revoked and you are asked to sign in again. An authorization code that is presented twice has the same effect.

A token response:

{
  "access_token": "br_live_…",
  "token_type": "Bearer",
  "expires_in": 3600,
  "refresh_token": "br_rt_…",
  "scope": "models completions tools"
}

Errors use the standard OAuth shape, for example {"error": "invalid_grant", "error_description": "…"}.

Disconnect

  • From the client: clients that support it call POST /auth/oauth/revoke when you remove the

connector. Revoking either token ends the whole grant.

  • From BrainstormRouter: open Dashboard → API Keys and revoke the key named OAuth: .

The client's next refresh will mint a new key until the grant expires, so to end a grant completely, remove the connector in the client as well.

Who am I connected as?

curl https://api.brainstormrouter.com/auth/oauth/userinfo \
  -H "Authorization: Bearer $ACCESS_TOKEN"
{
  "sub": "0b8f3a52-…",
  "email": "you@example.com",
  "email_verified": true,
  "tenant_id": "5c1d9e07-…"
}

email_verified is true when the account was created by signing in through an identity provider.

For operators

VariableDefaultEffect
BR_MCP_OAUTH_ENABLEDunset (off)1 turns the flow on
BR_PUBLIC_API_URLhttps://api.brainstormrouter.comThe issuer and the base of every advertised URL. Never taken from the Host header.
BRAINSTORMROUTER_PUBLIC_DASHBOARD_URLhttps://brainstormrouter.com/dashboard/Where the browser is sent to sign in and consent
BR_MCP_OAUTH_DCR_PER_IP_HOURLY10Dynamic registrations per IP per hour
BR_MCP_OAUTH_DCR_DAILY_CAP500Dynamic registrations across all callers per 24 hours

The dashboard must be deployed with the consent page before the flag is turned on, and database migration v71 must have run.