Sign-In And Client Metadata
This page is for developers running an MCP server behind OAuth who want Row-Bot to sign in to it, and for anyone reviewing how Row-Bot does it. The code is in src/row_bot/mcp_client/auth.py, application/client_mcp_auth.py and the sign_in step of integrations/plans.py.
Row-Bot's Client Metadata Document
Row-Bot has no client secret and no hosted service. Its OAuth client ID is the address of a static Client ID Metadata Document (CIMD), https://row-bot.ai/oauth/client-metadata.json, published from docs-site/static/oauth/client-metadata.json:
{
"client_id": "https://row-bot.ai/oauth/client-metadata.json",
"client_name": "Row-Bot",
"client_uri": "https://row-bot.ai",
"logo_uri": "https://row-bot.ai/img/brand/row_bot_glyph_256.png",
"application_type": "native",
"redirect_uris": [
"http://127.0.0.1/api/v1/settings/mcp/auth/callback",
"http://127.0.0.1:8080/api/v1/settings/mcp/auth/callback"
],
"grant_types": ["authorization_code", "refresh_token"],
"response_types": ["code"],
"token_endpoint_auth_method": "none"
}
It names only loopback redirects, so a sign-in made with it returns to the computer that started it, or, from another device, ends on an address the person pastes back (see The Redirect). It holds no secret or key.
How Row-Bot Finds Out A Sign-In Is Needed
During an agreed setup, the test step sends one unauthenticated initialize request. A 401 or 403 makes Row-Bot read the server's protected-resource metadata (RFC 9728) and then its authorization server's metadata (RFC 8414), and turns the plan's sign_in step on. So a hosted app whose catalog listing says nothing about sign-in can still sign in. These reads are limited to public https addresses and 64 KiB, and happen only inside a setup the person agreed to.
Which Client Row-Bot Uses
- The person's own OAuth app, when they gave one for this connection before, or when a reviewed recipe says the service needs one (GitHub's OAuth-app way, for example).
- CIMD, when the authorization server's metadata says
client_id_metadata_document_supportedand the sign-in uses a loopback address the document lists. CIMD is preferred when the server supports both, except for a device code (below), which needs a registered client. - Dynamic client registration, when the server has a
registration_endpoint. Row-Bot registers as a public client named Row-Bot with only its callback address. - Otherwise the setup pauses at Add your OAuth app for a client ID and an optional client secret. The help gives the callback address to register. With a secret, Row-Bot authenticates with
client_secret_post.
The authorization request uses PKCE with S256. A reviewed recipe may set oauth_scope to ask for less than everything the server lists. During sign-in Row-Bot checks that the issuer is the expected one, refuses HTTP redirects, contacts public https addresses only, and sends the access token only to the app's own server.
The Redirect
How the answer comes back depends on where the sign-in starts (delivery on the plan's sign_in step):
- This computer (
this_computer): the Row-Bot desktop app on the computer Row-Bot runs on. The callback ishttp://127.0.0.1:<port>/api/v1/settings/mcp/auth/callbackon the port Row-Bot is using (8080 by default), and the browser opens on the same computer. The client metadata lists the address both without a port and with 8080; an authorization server that follows RFC 8252 §7.3 accepts any port on a loopback redirect. - Another device, with Row-Bot's public address (
public): when Row-Bot has exactly one approved public https origin and the server has aregistration_endpoint, Row-Bot registers a client for that sign-in with the public callback,https://<origin>/api/v1/settings/mcp/auth/callback, and the browser returns there by itself. CIMD and the person's own app don't list that address, so they use the next way. - Another device, pasting the address back (
paste): the redirect ishttp://127.0.0.1/api/v1/settings/mcp/auth/callback, which doesn't load on that device. The person pastes the address the browser ended on, and the client sends it toPOST /api/v1/integrations/plans/{plan_id}/sign-inwith the session that started the setup. Row-Bot never fetches it and reads onlystateandcodeorerror. It must be exactly the sign-in's own callback (scheme, host, port and path), carry each of those once, and name no part of the token exchange (redirect_uri,code_verifier,client_id…). It is then checked exactly as the callback route checks one: this owner's own waiting sign-in, its one-time state (the PKCE verifier never leaves Row-Bot), once, within five minutes, while the connection is unchanged. Refusals aremcp_auth_address_invalid,mcp_auth_address_other,mcp_auth_address_usedandmcp_auth_address_expired. - Another device, with a code (
device): when the authorization server publishes adevice_authorization_endpointand listsurn:ietf:params:oauth:grant-type:device_code(RFC 8628), and Row-Bot has a client that can use it (one it registers with that grant, or the person's own app), Row-Bot shows the code and the service's page, then asks the token endpoint at the service's interval (five seconds more afterslow_down) until the person allows or denies it or the code expires. If the service gives no code, for example a GitHub OAuth app with device flow switched off, the sign-in carries on as a pasted address.
The callback route, which needs no session, accepts only the state of a sign-in waiting for this computer's browser or the public address, never a pasted or device sign-in's.
For your own OAuth app, register http://127.0.0.1/api/v1/settings/mcp/auth/callback (with a port if your service requires one). The same address works from this computer and, pasted back, from another device.
Tokens
Tokens, the client registration and the person's own client secret are saved together for that one connection in Row-Bot's secret store (the system keychain, or Row-Bot's encrypted store where there is none), never in settings files, logs or API responses. They are bound to the connection's name, address and launch; if those change, the person signs in again. When a refresh fails or a token stops working, the app shows Sign in needed, and its main action is Sign in again.
Testing
tests/subsystem/integrations/test_sign_in.py covers discovery, CIMD before dynamic registration, the person's own app, scopes, the expired-sign-in state and the published document. tests/subsystem/integrations/test_sign_in_elsewhere.py covers signing in from another device: the public address, pasted addresses and every refusal, and device codes. The live GitHub check, tests/e2e/test_github_live.py, is opt-in; see Extend Row-Bot.