Skip to main content
The MCP server uses a separate OAuth 2.0 authorization server at https://mcp.dynamosql.com. This is distinct from the REST API token endpoint at https://api.dynamosql.com/v1/auth/token.
Use the same API client credentials, but not the same bearer token. The REST API accessToken from https://api.dynamosql.com/v1/auth/token is not accepted on POST /mcp. The MCP server only accepts bearer tokens minted by https://mcp.dynamosql.com/token.

Supported flows

Interactive browser login supports pre-registered clients, Client ID Metadata Documents (CIMD), and Dynamic Client Registration (DCR) for public interactive clients. DynamoSQL always validates the final redirect_uri and shows a consent screen before issuing the MCP auth code.

OAuth 2.0 discovery

MCP clients that support OAuth discovery can find the authorization and token endpoints automatically: The protected resource metadata response:
The authorization server metadata response:

Human-user browser login

OAuth-capable MCP clients use a standard OAuth authorization-code flow with PKCE:
  1. The MCP client sends the user to https://mcp.dynamosql.com/authorize. Clients can include prompt=login to force a fresh Hosted UI sign-in and avoid silently reusing an existing browser session.
  2. DynamoSQL resolves the client from pre-registration, CIMD, or DCR, then redirects the browser to the DynamoSQL Hosted UI at auth.dynamosql.com.
  3. The user signs in with their DynamoSQL portal account.
  4. DynamoSQL exchanges the Cognito code server-side and shows a first-party consent page.
  5. After approval, DynamoSQL returns a one-time MCP authorization code to the MCP client.
  6. The MCP client exchanges that code at POST /token.
  7. DynamoSQL returns:
    • an MCP access_token
    • a rotating refresh_token
The resulting bearer token is an MCP token minted by DynamoSQL. It is not a raw Cognito access token or ID token.

Example token response after interactive login

API client authentication

Use this flow for automation, service accounts, or MCP clients that only support static bearer tokens.

Using form body credentials

Token response

Scopes

The scope parameter is optional. If omitted, the issued token includes all MCP-supported scopes allowed for that principal.
The MCP surface only recognizes query and schemas:read. Other portal or API-client scopes are ignored for MCP token issuance.

Using the bearer token

Include the token in the Authorization header on POST /mcp requests:
When the token is missing or invalid, the server returns 401 with a WWW-Authenticate challenge header pointing to the protected resource metadata URL.

Token errors

Token lifecycle

  • MCP access tokens expire after 10 minutes (expires_in: 600)
  • Interactive browser-login sessions receive a rotating refresh token with a 12-hour default lifetime
  • API-client client_credentials tokens do not receive refresh tokens
  • MCP clients that support OAuth discovery and refresh-token handling can renew access tokens automatically
  • For static bearer-token configurations, request a new token when the current one expires

Dynamic Client Registration

Public interactive clients that do not use CIMD can register dynamically at POST /register. Requirements:
  • client_name
  • redirect_uris
  • grant_types including authorization_code
  • response_types including code
  • token_endpoint_auth_method = none
Redirect URI rules:
  • https://... is always allowed
  • loopback HTTP is allowed only for http://127.0.0.1/... and http://localhost/...
  • custom URI schemes and non-loopback plain HTTP are rejected
DCR is public-client-only in this release. DynamoSQL does not issue client secrets for DCR clients and does not support RFC 7592 registration-management APIs yet.