Appearance
MCP OAuth (desktop clients)
OpenBrain supports OAuth 2.1 authorization for MCP-capable AI apps (Claude Desktop, ChatGPT connectors, and other hosts that implement MCP OAuth) via Laravel Passport and laravel/mcp metadata routes.
Discovery
| Endpoint | Purpose |
|---|---|
GET /.well-known/oauth-authorization-server | Authorization server metadata |
GET /.well-known/oauth-protected-resource | Protected resource metadata |
POST /oauth/register | Dynamic client registration (RFC 7591) |
MCP clients discover these automatically when /mcp returns 401 with a WWW-Authenticate header pointing at resource metadata.
User consent
- User signs in to the OpenBrain dashboard at
/app. - The authorization screen lists the requesting client, organization, and memory abilities (ingest, search, admin).
- Approved tokens receive scopes:
mcp:use,organization:{uuid}, and selectedmemory:*abilities.
Read-only members can only approve search scope.
Using OAuth tokens
- MCP:
Authorization: Bearer {access_token}onPOST /mcp(same tools as Sanctum PATs). - REST:
Authorization: Bearer {access_token}with optionalX-Organization-Idwhen the token includesorganization:{uuid}.
Configuration
In .env / config/mcp.php:
custom_schemes: private URI schemes allowed for desktop OAuth callbacks (e.g.claudefor Claude Desktop). Additional schemes may be added for other vendors.redirect_domains: restrict HTTPS callbacks in production (avoid*)
Run once per environment:
bash
php artisan passport:installSanctum PATs
Long-lived personal access tokens created in the dashboard remain supported for automation and CI. Prefer OAuth for interactive desktop MCP sessions.