OAuth server support for flespi realms and MCP clients
TL;DR
Realms can now authorize OAuth clients, including compatible MCP clients, without users sharing flespi tokens. Realm owners enable OAuth and allow specific clients using their CIMD URLs; users then sign in and approve access through the usual realm login flow.
For a quicker setup, the realm's Info tab provides integration buttons for Claude Code, Claude, Cursor, VS Code, LM Studio and Goose.

Details
We have added an OAuth 2.0 authorization server to flespi realms. Applications can now request access on behalf of a realm user instead of asking the user to create and share a flespi token. The user signs in with their realm credentials or configured identity provider, reviews the requested access, and explicitly approves or denies it. The resulting access remains limited by that user's realm token ACLs.
Realm OAuth currently supports public clients using the Authorization Code flow with mandatory PKCE (S256), refresh tokens, and the default scope. Only client identification through Client ID Metadata Documents (CIMD) is supported.
Getting access
OAuth server is disabled by default. A realm owner must:
- Enable the realm's
oauth_server setting.
- Add the exact public HTTPS URL of the application's OAuth Client ID Metadata Document (CIMD) to
oauth_server.allowed_clients.
The CIMD URL is also the OAuth client_id. Up to 16 clients can be allowed per realm.
OAuth server discovery
OAuth clients can discover the realm authorization server using its standard metadata URL:
https://flespi.io/.well-known/oauth-authorization-server/realm/<realm-public-id>/oauth
The server metadata is also available directly at:
https://flespi.io/realm/<realm-public-id>/oauth/authorization-server
MCP integration
OAuth-capable MCP clients that support CIMD can connect directly to either realm MCP endpoint:
https://flespi.io/realm/<realm-public-id>/ai/mcp/develop
https://flespi.io/realm/<realm-public-id>/ai/mcp/support
The MCP client must support OAuth protected-resource discovery, CIMD, HTTP redirects that preserve authorization and POST requests, and Streamable HTTP. SSE transport is not supported. Access to the develop and support MCP servers is governed by the realm user's existing ACLs rather than separate OAuth scopes.