Atoti Intelligence SDK
This is part of the Atoti Intelligence SDK offer.What does this feature enable?
When this feature is enabled, the MCP Server:- Publishes an RFC 9728
Protected Resource Metadata document at
/.well-known/oauth-protected-resource. The document tells clients which authorization server(s) to talk to and which scopes to request. - Returns
WWW-Authenticate: Bearer realm="mcp", resource_metadata="..."on 401 responses from/mcp/**and/sse, so clients can discover the metadata document on first contact.
- The client opens the system browser at the IdP authorization endpoint.
- The user signs in, subject to whatever the IdP enforces (MFA, conditional access, and so on).
- The IdP redirects back to a loopback URI.
- The client swaps the code for an access token.
- The token is stored in the OS keychain and refreshed silently in the background.
Prerequisites
- The Atoti MCP Server is already running. See How to set up the Atoti MCP Server.
- An OAuth 2.0 authorization server (Okta, Entra ID, Auth0, Keycloak, Cognito, …) is configured to issue access tokens for users who should be able to call MCP endpoints.
- The Atoti Spring Security stack is already configured to validate the IdP’s JWTs (this is the same setup used by other Bearer-secured Atoti endpoints — no extra steps).
How to enable OAuth 2.1 discovery
Add the following to yourapplication.yml:
authorization-servers is the only required setting when enabled=true. Startup fails with a
clear error if it is left empty.
Property reference
How to set up the IdP
Concrete steps vary by IdP, but the broad shape is:- Configure your IdP to issue access tokens for the MCP client (Claude Desktop, Claude Code, Cursor, etc.). Most enterprise IdPs require the client to be pre-registered; some support Dynamic Client Registration (RFC 7591).
- Set the resource/audience claim on the issued tokens to match
atoti.server.endpoint.mcp.oauth2.resource. Atoti’s JWT validator must already trust this audience. - Allow the redirect URI used by your client. Most MCP clients use a random loopback URI such
as
http://127.0.0.1:<random-port>/callback.
How does each MCP client behave?
- Claude Code, Claude Desktop, Cursor, Cline, VS Code MCP, Gemini CLI: detect the
WWW-Authenticateheader automatically, open the system browser for the PKCE flow, store the resulting access and refresh tokens in the OS keychain, and refresh silently. - Older or stdio-only MCP clients: use the
mcp-remotebridge — it performs the PKCE dance locally and proxies SSE to the remote MCP Server.
What are the reverse-proxy caveats?
If the Atoti Server sits behind a reverse proxy that rewrites the host or scheme:- Either set
atoti.server.endpoint.mcp.oauth2.resourceexplicitly to the public URL of the server, or - Enable Spring Boot’s
ForwardedHeaderFilter(viaserver.forward-headers-strategy=framework) so the request-derived URL honoursX-Forwarded-*.
resource field and the resource_metadata= URL in the challenge
header will reflect the internal hostname instead of the public one.
What are the limitations and out-of-scope features?
Inexternal mode the MCP Server is only a resource server — it advertises discovery metadata and
validates Bearer tokens, but it does not issue them. The following are therefore out of scope for
external mode (they are the IdP’s responsibility):
- Dynamic Client Registration (RFC 7591). Customers pre-register MCP clients in their IdP, or rely on the IdP’s own DCR support.
/.well-known/oauth-authorization-server. That endpoint is served by the IdP.
- Token Exchange (RFC 8693). The MCP Server does not exchange tokens for downstream services.
- Per-error-code
WWW-Authenticateparameters (error=invalid_token, etc., per RFC 6750). The v1 challenge contains onlyrealmandresource_metadata.