Signing in an app with OAuth
Who it is for
OAuth is how an app acts for a person: an AI assistant they use, or a tool of your own. The person signs in to Tooli as they always do, chooses the organisation and approves what the app may do. The app then reads what that person may see, no more. A program that acts for the organisation, not a person, uses an API key instead.
The tokens are for the MCP server at https://app.tooli.dev/mcp, and only for it: /api/v1/ takes keys only.
How an app finds Tooli
- The MCP server's description (RFC 9728):
https://app.tooli.dev/.well-known/oauth-protected-resource/mcp. A request to/mcpwith no token is answered401with aWWW-Authenticateheader that names it. - The authorisation server's (RFC 8414):
https://app.tooli.dev/.well-known/oauth-authorization-server/api/auth.
An app says who it is by a Client ID Metadata Document: its client_id is the https address of a JSON document it publishes, with its name and the addresses it sends people back to. Nothing is registered with Tooli first, and dynamic client registration is off.
The sign-in
- The app sends the person to the authorisation address with
response_type=code, itsclient_id, itsredirect_uri, the scopes it asks for, astate,resource=https://app.tooli.dev/mcp, and a PKCE challenge (code_challenge_method=S256;plainis refused). - The person signs in (Google, Zoho, their company's sign-on, …), sees the app by its published name and where it sends them back, chooses the organisation, and allows or denies.
- The app swaps the code for tokens at the token address, with its PKCE verifier.
The access token is a JWT for the MCP resource that lasts an hour. With offline_access the app gets a refresh token too, which changes each time it is used.
Scopes
read: what the person may see.write: changes (make and change links, tag and file emails, add a website, the never-track list), given only where the organisation allows connected apps to change records and the person's role may make the change. Switched off later, it stops at once for tokens already given.offline_access: a refresh token.
Disconnecting
The person disconnects an app in Your settings, and owners and admins in Organisation → API and MCP. It stops at once: its approval and tokens are removed, and an access token already handed out stops on its next use. Signing out of Tooli doesn't disconnect an app. Someone who leaves the organisation takes their apps' access with them.