Overview
Superleap exposes a hosted Model Context Protocol (MCP) server for each workspace. Use it to let AI clients securely access Superleap tools on behalf of an authenticated user. Your MCP server URL is based on your Superleap workspace subdomain:apple.superleap.com, use:
Replace
<subdomain> everywhere in this guide with your workspace subdomain. Do not include .superleap.com in the MCP URL path.Authentication
Superleap MCP uses OAuth 2.0 Authorization Code flow with PKCE. OAuth keeps user authorization separate from API keys and lets MCP clients request access through a standard browser-based consent flow. The OAuth endpoints are hosted onapp.superleap.com, not on mcp.superleap.com. The MCP host is the protected resource server; it tells the client which authorization server to use.
The typical flow is:
- Start with the workspace MCP URL and read its protected-resource metadata.
- Discover the workspace OAuth authorization server metadata.
- Register the MCP client using Dynamic Client Registration (DCR), if your client does not already have a
client_id. - Redirect the user to the workspace authorization endpoint with PKCE and the MCP
resourceparameter. - Receive the authorization code at the registered callback URL.
- Exchange the authorization code for an access token.
- Connect to the workspace MCP endpoint with the access token.
Step 1: Discover the protected resource
Start from the workspace MCP endpoint. An unauthenticated request returns401 Unauthorized with a WWW-Authenticate header that points to the protected-resource metadata URL.
apple workspace, the response includes:
apple, the response looks like:
MCP resource URL. Send this exact value as the OAuth
resource parameter during authorization.Authorization server identifiers for this workspace. Use the workspace identifier to discover OAuth endpoints.
Supported bearer-token delivery methods. Use the
Authorization: Bearer <access_token> header.Step 2: Discover OAuth endpoints
Use the workspace authorization server metadata endpoint. The workspace subdomain appears afteroauth-authorization-server:
apple:
OAuth issuer identifier.
URL where users authorize access. For
apple, this is https://app.superleap.com/api/v1/apple/oauth/authorize.URL used to exchange authorization codes and refresh tokens. For
apple, this is https://app.superleap.com/api/v1/apple/oauth/token.Dynamic Client Registration endpoint. For
apple, this is https://app.superleap.com/api/v1/apple/oauth/register.Supported OAuth response types. Use
code for Authorization Code flow.Supported grant types, such as
authorization_code and refresh_token.Supported token endpoint authentication methods. Public MCP clients use
none with PKCE.PKCE challenge methods. Use
S256 when available.Step 3: Register your MCP client
MCP clients can use Dynamic Client Registration to create a client automatically. Post to theregistration_endpoint returned by discovery.
Human-readable client name shown during authorization.
Callback URLs your client can use. The
redirect_uri in the authorization request must exactly match one of these values.OAuth grant types requested by the client. Use
authorization_code and refresh_token.OAuth response types requested by the client. Use
code.Token endpoint authentication method. Public MCP clients commonly use
none with PKCE.Optional URL for your client application.
client_id:
Step 4: Request user authorization
Redirect the user to theauthorization_endpoint returned by the workspace metadata endpoint. Include the resource value from protected-resource discovery.
apple:
Do not hard-code
scope=read_only. The current Superleap MCP OAuth metadata does not advertise scopes_supported; use only the parameters returned or required by discovery unless a future metadata response explicitly lists scopes.Must be
code.Client identifier returned during registration.
Callback URL. Must exactly match one of the registered redirect URIs.
Random value generated by your client to protect against CSRF. Verify the same value is returned in the callback.
PKCE code challenge generated from your
code_verifier.Use
S256.The MCP resource URL from protected-resource discovery, for example
https://mcp.superleap.com/apple/mcp.redirect_uri with a temporary authorization code:
Step 5: Exchange the authorization code for a token
Exchange the authorization code at thetoken_endpoint returned by discovery.
Bearer token used by the MCP client.
Token type. Use
Bearer.Number of seconds before the access token expires.
Token used to request a new access token when refresh tokens are enabled for the client.
Step 6: Connect your MCP client
Configure your MCP client with your workspace MCP endpoint:apple.superleap.com:
Most MCP clients handle the OAuth flow, token storage, and MCP protocol messages automatically. In that case, you only need to provide the server URL:
https://mcp.superleap.com/<subdomain>/mcp.Example: Connect with Hermes Agent
Hermes Agent supports OAuth-protected remote MCP servers. Add the Superleap MCP server with the workspace MCP URL:apple:
- Ask Hermes to connect to the Superleap MCP server.
- Hermes should give you the authorization URL.
- Open the authorization URL in your browser and approve access.
- When the browser lands on the final
http://127.0.0.1:<port>/callback?code=...&state=...return URL, copy the full URL from the browser address bar. - Paste that full return URL back to Hermes so it can exchange the code for tokens.
Token management
- Store access tokens and refresh tokens securely. Do not commit tokens to version control.
- Track
expires_inand refresh tokens before they expire. - Use PKCE for browser, desktop, CLI, and other public clients.
- Validate the
stateparameter on every OAuth callback. - Re-run OAuth authorization if the user revokes access or the refresh token expires.
Troubleshooting
| Issue | What to check |
|---|---|
https://mcp.superleap.com/.well-known/oauth-authorization-server returns 404 | This is expected. Discover OAuth metadata from https://app.superleap.com/.well-known/oauth-authorization-server/<subdomain> after reading the protected-resource metadata from the MCP URL. |
Authorization URL on mcp.superleap.com does not work | Use the authorization_endpoint on app.superleap.com, for example https://app.superleap.com/api/v1/apple/oauth/authorize. |
invalid_redirect_uri | The authorization request redirect_uri must exactly match a URI registered in redirect_uris. |
invalid_client | Confirm you are using the latest client_id from registration and the correct workspace-specific endpoints. |
invalid_grant | Authorization codes are single-use and expire quickly. Restart the authorization flow. |
401 Unauthorized from MCP | Confirm the Authorization: Bearer <access_token> header is present and the token is not expired. |
| Workspace not found | Confirm the MCP URL uses only the workspace subdomain, for example /apple/mcp for apple.superleap.com. |