Skip to main content

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:
For example, if your workspace is available at 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 on app.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:
  1. Start with the workspace MCP URL and read its protected-resource metadata.
  2. Discover the workspace OAuth authorization server metadata.
  3. Register the MCP client using Dynamic Client Registration (DCR), if your client does not already have a client_id.
  4. Redirect the user to the workspace authorization endpoint with PKCE and the MCP resource parameter.
  5. Receive the authorization code at the registered callback URL.
  6. Exchange the authorization code for an access token.
  7. 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 returns 401 Unauthorized with a WWW-Authenticate header that points to the protected-resource metadata URL.
For the apple workspace, the response includes:
Fetch that metadata URL:
For apple, the response looks like:
string
MCP resource URL. Send this exact value as the OAuth resource parameter during authorization.
array
Authorization server identifiers for this workspace. Use the workspace identifier to discover OAuth endpoints.
array
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 after oauth-authorization-server:
For apple:
The response includes the endpoints your client should use:
Do not use https://mcp.superleap.com/.well-known/oauth-authorization-server, https://mcp.superleap.com/authorize, https://mcp.superleap.com/token, or https://mcp.superleap.com/register. Those are not the OAuth endpoints for Superleap MCP.
string
OAuth issuer identifier.
string
URL where users authorize access. For apple, this is https://app.superleap.com/api/v1/apple/oauth/authorize.
string
URL used to exchange authorization codes and refresh tokens. For apple, this is https://app.superleap.com/api/v1/apple/oauth/token.
string
Dynamic Client Registration endpoint. For apple, this is https://app.superleap.com/api/v1/apple/oauth/register.
array
Supported OAuth response types. Use code for Authorization Code flow.
array
Supported grant types, such as authorization_code and refresh_token.
array
Supported token endpoint authentication methods. Public MCP clients use none with PKCE.
array
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 the registration_endpoint returned by discovery.
string
required
Human-readable client name shown during authorization.
array
required
Callback URLs your client can use. The redirect_uri in the authorization request must exactly match one of these values.
array
required
OAuth grant types requested by the client. Use authorization_code and refresh_token.
array
required
OAuth response types requested by the client. Use code.
string
Token endpoint authentication method. Public MCP clients commonly use none with PKCE.
string
Optional URL for your client application.
A successful registration response returns a client_id:

Step 4: Request user authorization

Redirect the user to the authorization_endpoint returned by the workspace metadata endpoint. Include the resource value from protected-resource discovery.
For 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.
string
required
Must be code.
string
required
Client identifier returned during registration.
string
required
Callback URL. Must exactly match one of the registered redirect URIs.
string
Random value generated by your client to protect against CSRF. Verify the same value is returned in the callback.
string
required
PKCE code challenge generated from your code_verifier.
string
required
Use S256.
string
required
The MCP resource URL from protected-resource discovery, for example https://mcp.superleap.com/apple/mcp.
After the user approves access, Superleap redirects to your redirect_uri with a temporary authorization code:

Step 5: Exchange the authorization code for a token

Exchange the authorization code at the token_endpoint returned by discovery.
The token response includes:
string
Bearer token used by the MCP client.
string
Token type. Use Bearer.
integer
Number of seconds before the access token expires.
string
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:
For a workspace at apple.superleap.com:
The MCP client should send the OAuth access token as a Bearer token when connecting:
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:
For apple:
Hermes will perform the discovery and Dynamic Client Registration steps automatically, then print an authorization URL. Open that URL in your browser, approve access, and complete the OAuth redirect. If Hermes is running on a remote machine, in Slack, or in another headless environment, the browser may not be able to call the local callback URL directly. In that case:
  1. Ask Hermes to connect to the Superleap MCP server.
  2. Hermes should give you the authorization URL.
  3. Open the authorization URL in your browser and approve access.
  4. 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.
  5. Paste that full return URL back to Hermes so it can exchange the code for tokens.
Keep the Hermes login process running while you approve access and paste back the return URL. The authorization code, state, and PKCE verifier are tied to that live OAuth attempt.

Token management

  • Store access tokens and refresh tokens securely. Do not commit tokens to version control.
  • Track expires_in and refresh tokens before they expire.
  • Use PKCE for browser, desktop, CLI, and other public clients.
  • Validate the state parameter on every OAuth callback.
  • Re-run OAuth authorization if the user revokes access or the refresh token expires.

Troubleshooting