How it works
In OAuth 2.0 mode, MCPCore acts as an OAuth 2.0 resource server. You bring your own Authorization Server — you do not configure usernames, passwords, or client credentials inside MCPCore. You provide MCPCore with a single URL: your Authorization Server’s RFC 8414 metadata endpoint (the.well-known document your auth provider exposes). MCPCore validates that URL, then automatically sets up the discovery infrastructure so that MCP clients can find your auth server and complete the OAuth flow on their own.
When to use it
- User-facing tools — each user authenticates with their own identity; tools act on their behalf
- Enterprise integrations — your org already has Okta / Azure AD / Auth0 and you want to reuse it
- Fine-grained access control — OAuth scopes let you restrict what each client can do
- Compliance — explicit user consent, auditable access grants, short-lived tokens
What you need
An RFC 8414-compliant Authorization Server that exposes a.well-known/oauth-authorization-server metadata document. Any of the following work out of the box:
| Provider | Metadata URL format |
|---|---|
| Auth0 | https://{your-domain}/.well-known/oauth-authorization-server |
| Okta | https://{your-domain}/oauth2/default/.well-known/oauth-authorization-server |
| Keycloak | https://{host}/realms/{realm}/.well-known/oauth-authorization-server |
| Azure AD | https://login.microsoftonline.com/{tenant}/v2.0/.well-known/oauth-authorization-server |
https://accounts.google.com/.well-known/openid-configuration (OpenID fallback) | |
| Self-hosted | Any RFC 8414-compliant server at a public HTTPS address |
What MCPCore validates
When you save the server, MCPCore fetches your metadata URL and checks:| Field | Why it’s required |
|---|---|
issuer | Identifies the authorization authority; used to validate token signatures |
authorization_endpoint | Where MCP clients redirect users to log in |
token_endpoint | Where MCP clients exchange authorization codes for JWT access tokens |
registration_endpoint | Enables Dynamic Client Registration (RFC 7591) — MCP clients self-register automatically without pre-configured credentials |
jwks_uri | MCPCore fetches your server’s public keys from here to verify every incoming JWT |
The
registration_endpoint is what enables zero-config client connections. MCP clients like Claude and Cursor register themselves dynamically the first time they connect — no manual app registration in your provider’s dashboard is needed.Configure
Find your Authorization Server metadata URL
Look up your provider’s RFC 8414 metadata endpoint. This is a public HTTPS URL your auth server exposes.Auth0:Okta:Keycloak:Confirm the URL returns valid JSON before proceeding. Open it in a browser — you should see a JSON object with
issuer, authorization_endpoint, token_endpoint, registration_endpoint, and jwks_uri.Enter the metadata URL
Paste your Authorization Server metadata URL into the OAuth Server URL field.
MCPCore will fetch and validate this URL when you save. You do not enter client IDs, secrets, scopes, or redirect URIs — those are handled automatically by the MCP client through Dynamic Client Registration.
| Field | What to enter |
|---|---|
| OAuth Server URL | The full .well-known metadata URL from your provider |
What MCPCore sets up automatically
After you save, MCPCore configures your subdomain to serve two discovery endpoints:Protected Resource Metadata (RFC 9728)
401 response with discovery pointer
When a client connects without a token, MCPCore responds:The full client flow (automatic)
Once OAuth 2.0 mode is active, here is what happens when an MCP client connects for the first time:Client attempts to connect
The MCP client sends a request to
https://{your-subdomain}.mcpcore.io/mcp. MCPCore returns 401 with a WWW-Authenticate header pointing to the resource metadata endpoint.Client discovers your authorization server
The client fetches
/.well-known/oauth-protected-resource and reads the authorization_servers field to find your auth server’s issuer URL.Client fetches authorization server metadata
The client fetches your metadata URL (the one you configured) to learn the
authorization_endpoint, token_endpoint, registration_endpoint, and jwks_uri.Client registers itself (Dynamic Client Registration)
The client sends a registration request to your
registration_endpoint. Your auth server issues a client_id (and optionally a client_secret). This registration is cached — it only happens once per client.User completes the OAuth authorization flow
The client opens a browser and directs the user to your
authorization_endpoint. The user authenticates with your provider. After consent, your auth server redirects back to the client with an authorization code.The client exchanges the code for a JWT access token at your token_endpoint, using PKCE (Proof Key for Code Exchange) throughout to prevent code interception.Provider-specific setup
Auth0
Auth0
- Log in to manage.auth0.com and open your tenant.
- Go to Applications → APIs and create a new API representing your MCPCore server.
- Enable Allow Offline Access if you want refresh tokens.
- Confirm Dynamic Client Registration is enabled (it is on by default for Auth0 management API).
- Your metadata URL:
Okta
Okta
- Log in to your Okta admin console.
- Go to Security → API → Authorization Servers.
- Use the
defaultserver or create a custom one. - Under Settings, confirm Dynamic Client Registration is enabled.
- Your metadata URL:
{authServerId} with default or your custom server ID.Keycloak
Keycloak
- Open your Keycloak admin console.
- Select your realm and go to Realm settings → General.
- Confirm Client registration → Open is enabled (allows Dynamic Client Registration without an initial access token).
- Your metadata URL:
Azure AD (Entra ID)
Azure AD (Entra ID)
- Register an application in the Azure portal for your tenant.
- Enable the authorization_code flow and Dynamic Client Registration via your tenant’s policies.
- Your metadata URL:
Azure does not enable open Dynamic Client Registration by default. You may need to pre-register the MCP client or configure a registration policy in your tenant.
Self-hosted / custom authorization server
Self-hosted / custom authorization server
Client compatibility
MCP clients that implement the MCP Authorization specification handle the OAuth flow automatically — no manual configuration is required.| Client | Native MCP OAuth support |
|---|---|
| Claude (claude.ai) | Yes — automatic |
| Cursor | Yes — automatic |
| VS Code (Copilot) | Partial — check latest version |
| Claude Desktop | Via mcp-remote proxy |
| Windsurf | Via mcp-remote proxy |
| Cline | Via mcp-remote proxy |
mcp-remote as a proxy, the proxy handles the OAuth flow locally and forwards a session token to MCPCore. The user is prompted once in their browser; subsequent connections are silent.
Token lifetime recommendations
| Setting | Recommended value |
|---|---|
| Access token lifetime | 15–60 minutes |
| Refresh token lifetime | 7–30 days (sliding) |
| Refresh token rotation | Enabled |