Ownership Model
Remote MCP authentication is owned by the gateway-side MCP client pool:Auth Types
| Type | Use when | Credential shape |
|---|---|---|
none | The remote MCP server is internal or unauthenticated | No auth block required |
bearer | The server accepts Authorization: Bearer <token> | token as a SecretValue |
header | The server expects an API key or custom header | header_name plus header_value |
basic | Legacy HTTP Basic auth | username and password |
oauth | Hosted MCP OAuth, mounted OAuth tokens, or client credentials | OAuth fields below |
auth field is intentionally symmetric: non-OAuth and OAuth credentials all live in the same per-server remote.auth block.
Secret Values
Secret fields use the sameSecretValue shape everywhere. Exactly one source must be set:
token, header_value, username, password, client_id, client_secret, access_token, and refresh_token.
Non-OAuth Examples
Bearer token:OAuth Cycle
OAuth has two phases: interactive authorization and runtime consumption.The old top-level formsfracta mcp login/fracta mcp export/fracta mcp auth-statusstill work as a one-release deprecation alias. Seefracta mcp(deprecated alias) for the remapping table.
1. Configure the OAuth server
For hosted MCP OAuth with browser login:remote.url is used for MCP protected-resource discovery. metadata_url, when set, must point to OAuth authorization server metadata, not protected-resource metadata.
If the server supports dynamic client registration, client_id can be omitted. If it does not, provide a client identity:
2. Login locally
Run login from a machine that can open a browser:- Reads the named MCP server from config.
- Starts the local callback server before opening the browser.
- Discovers OAuth metadata from
remote.urland optionalmetadata_url. - Dynamically registers a client if no client identity is configured or stored.
- Uses authorization code flow with PKCE S256 by default.
- Exchanges the callback code for a token.
- Stores the token and dynamic client registration in the local OS keyring.
client_id.
3. Inspect or clear local credentials
token_store. The default is:
auto and keyring both use the OS keyring through zalando/go-keyring.
Stored items use:
file token store driver is not implemented. For headless deployments, export from the local keyring and mount the exported files or K8s Secret.
4. Export for headless deployments
Export formats:env emits variables such as:
files writes:
k8s-secret emits a Secret named fracta-mcp-<server> with keys:
client-registration.json is only emitted when fracta has a stored dynamic client registration.
Runtime OAuth Config
Local-process gateway
For local development, the gateway can read directly from the local keyring:fracta config mcp auth login notion once before starting the gateway. The transport token store reads and updates the OS keyring.
Kubernetes gateway
Usek8s-secret export and mount the Secret into the gateway pod:
client-registration.json, omit client_registration_file.
Docker Compose gateway
Usefiles export and Compose secrets:
client_registration_file.
Inline pre-authorized tokens
Inline token fields are useful when another system injects credentials as env vars or mounted files:expires_at. Prefer token_file when you have the JSON exported by fracta.
Client Credentials Grant
Useclient_credentials for service-to-service MCP servers that do not need a user browser session:
metadata_url if set, otherwise from remote.url using authorization server discovery.
Client credentials tokens are fetched when the transport is created and attached as a bearer token. They are not stored in the local keyring.
Token Refresh And Restart Behavior
For local keyring-backed OAuth, refreshed tokens are saved back to the keyring by the OAuth token store. Fortoken_file, mounted files are read-only bootstrap inputs. The gateway can refresh tokens in memory during its process lifetime, but refreshed tokens are not written back to the mounted file. On restart, the gateway re-reads the original file. If the provider rotates refresh tokens, periodically re-run:
Validation Rules And Gotchas
auth.typemust be one ofnone,bearer,header,basic, oroauth.SecretValuerequires exactly one ofvalue,env, orfile.remote.headers.Authorizationcannot be combined with auth types that generateAuthorization.auth.type: headerrejects case-insensitive collisions with existingremote.headers.- OAuth
grant_typemust beauthorization_code,client_credentials, ordevice_code. client_credentialsrequiresclient_idandclient_secret.access_tokenandtoken_fileare mutually exclusive.client_registration_fileis a hard requirement if configured. Remove it when the exported credentials do not include that file.- The gateway pod or container must have outbound network access to the hosted MCP server and OAuth issuer.
- OAuth scope step-up on
403 insufficient_scopeis not implemented yet. Re-login with the required scopes if a provider rejects the token.

