View as Markdown

Platform · API reference

MCP authorization

A person's own assistant connects over MCP: OAuth 2.1 with PKCE, dynamic registration, and the Provenance MCP server.

Related guide: Connect a client

Register an assistant

POST/v1/oauth/register

RFC 7591 dynamic registration for a person's own assistant: a public client (no secret) with 1–5 exact redirect URIs (https, loopback http, or a reverse-DNS app scheme). 20 an hour per IP. MCP 2026-07-28 prefers Client ID Metadata Documents: an assistant can use the URL of its metadata document as its client_id instead of registering.

No API key needed.

Parameters

client_namestring
The assistant's name.
redirect_urisarray of stringsRequired
Exact redirect URIs.
application_typeenum
web (the default) or native (a desktop app). A web client can't have only loopback redirect URIs. One of web, native.

Returns

The client.

Errors

curl -X POST "$PROVENANCE_API/v1/oauth/register" \
  -H "Content-Type: application/json" \
  -d '{
    "client_name": "Claude Desktop",
    "redirect_uris": [
      "http://127.0.0.1:33418/callback"
    ],
    "application_type": "native"
  }'

Response 201

{
  "client_id": "ocl_01M67Q2B8D7C4E2B9A6F5G1H0K",
  "client_name": "Claude Desktop",
  "redirect_uris": [
    "http://127.0.0.1:33418/callback"
  ],
  "token_endpoint_auth_method": "none",
  "grant_types": [
    "authorization_code",
    "refresh_token"
  ],
  "response_types": [
    "code"
  ],
  "client_id_issued_at": 1793469600
}

Start a terminal sign-in

POST/v1/oauth/device_authorization

The device authorization request (RFC 8628) behind npx @provenanceauth/connect: a code for the person to enter at verification_uri and confirm with their passkey. Poll POST /v1/oauth/token with the device code grant every interval seconds.

No API key needed.

Parameters

client_namestringRequired
The assistant's name, shown to the person.
assistantenum
Which assistant (default other). One of claude-code, codex, gemini, cursor, other.

Returns

The code.

Errors

curl -X POST "$PROVENANCE_API/v1/oauth/device_authorization" \
  -H "Content-Type: application/json" \
  -d '{ "client_name": "Claude Code", "assistant": "claude-code" }'

Response 200

{
  "device_code": "dvc_q3V9xK2mW8sYd4cFjLhXn6gAe1pR5zT7Yk2m8VxQ1rT9",
  "user_code": "QSXT-BKLM",
  "verification_uri": "https://app.provenanceauth.com/me/connect/code",
  "verification_uri_complete": "https://app.provenanceauth.com/me/connect/code?code=QSXTBKLM",
  "expires_in": 600,
  "interval": 5,
  "client_id": "ocl_01M6B4QJ9D7C4E2B9A6F5G1H0K"
}

Get the MCP resource metadata

GET/.well-known/oauth-protected-resource

RFC 9728: the one MCP server's address and its authorization server, with no scopes_supported (the account picker chooses who signs in). An MCP client finds it from the 401's WWW-Authenticate header.

No API key needed.

Parameters

No parameters.

Returns

The metadata.

Errors

curl "$PROVENANCE_API/.well-known/oauth-protected-resource"

Response 200

{
  "resource": "https://mcp.provenanceauth.com",
  "authorization_servers": [
    "https://api.provenanceauth.com"
  ],
  "bearer_methods_supported": [
    "header"
  ],
  "resource_name": "Provenance",
  "resource_documentation": "https://www.provenanceauth.com/docs/provenance-mcp"
}

Get the authorization server metadata

GET/.well-known/oauth-authorization-server

RFC 8414: the endpoints for a person's own assistant (PKCE S256, public clients, when MCP sign-in is set up) and the CIBA backchannel endpoint for company OAuth clients. With MCP sign-in it also advertises Client ID Metadata Documents (client_id_metadata_document_supported) and the RFC 9207 iss on every authorization response (authorization_response_iss_parameter_supported).

No API key needed.

Parameters

No parameters.

Returns

The metadata.

Errors

curl "$PROVENANCE_API/.well-known/oauth-authorization-server"

Response 200

{
  "issuer": "http://127.0.0.1:50036",
  "token_endpoint": "http://127.0.0.1:50036/v1/oauth/token",
  "jwks_uri": "http://127.0.0.1:50036/.well-known/jwks.json",
  "scopes_supported": [
    "openid"
  ],
  "backchannel_authentication_endpoint": "http://127.0.0.1:50036/v1/oauth/bc_authorize",
  "backchannel_token_delivery_modes_supported": [
    "poll",
    "ping"
  ],
  "backchannel_user_code_parameter_supported": false,
  "authorization_details_types_supported": [
    "provenance_action"
  ],
  "token_endpoint_auth_methods_supported": [
    "private_key_jwt",
    "client_secret_basic"
  ],
  "token_endpoint_auth_signing_alg_values_supported": [
    "ES256",
    "EdDSA"
  ],
  "grant_types_supported": [
    "urn:openid:params:grant-type:ciba"
  ]
}

Get the MCP resource metadata (path form)

GET/.well-known/oauth-protected-resource/v1/mcp

RFC 9728's path-inserted form for the one MCP server at /v1/mcp: the same metadata as /.well-known/oauth-protected-resource, for clients that build the address from the resource's path.

No API key needed.

Parameters

No parameters.

Returns

The metadata.

Errors

curl "$PROVENANCE_API/.well-known/oauth-protected-resource/v1/mcp"

Response 200

{
  "resource": "https://api.provenanceauth.com/v1/mcp",
  "authorization_servers": [
    "https://api.provenanceauth.com"
  ],
  "bearer_methods_supported": [
    "header"
  ],
  "resource_name": "Provenance",
  "resource_documentation": "https://www.provenanceauth.com/docs/provenance-mcp"
}

Get or refresh tokens

POST/v1/oauth/token

authorization_code with the PKCE verifier, refresh_token, the device code grant (RFC 8628), or the CIBA grant (urn:openid:params:grant-type:ciba with auth_req_id, the OAuth client authenticated): authorization_pending until the person decides, then the intent token, the approved authorization_details and an id_token. Form-encoded (or JSON).

No API key needed.

Parameters

grant_typeenumRequired
Which exchange. One of authorization_code, refresh_token, client_credentials, urn:ietf:params:oauth:grant-type:device_code, urn:openid:params:grant-type:ciba.
client_idstring
The client (CIBA: optional; the client authenticates with an assertion or Basic).
codestring
With authorization_code.
redirect_uristring
With authorization_code: the same redirect URI.
code_verifierstring
With authorization_code: the PKCE verifier.
refresh_tokenstring
With refresh_token.
device_codestring
With the device code grant.
auth_req_idstring
With the CIBA grant: the id from POST /v1/oauth/bc_authorize.
client_assertion_typestring
With the CIBA grant and private_key_jwt: urn:ietf:params:oauth:client-assertion-type:jwt-bearer.
client_assertionstring
With the CIBA grant or client_credentials and private_key_jwt: the signed assertion.
scopestring
With client_credentials: a registered agent's capabilities (requesting:read requesting:act, and responding:read responding:act once its responder tools are on; never requesting:pay), or exchanges:read for a party with no account. Left out, the agent's allowed set.

Returns

The tokens.

Errors

curl -X POST "$PROVENANCE_API/v1/oauth/token" \
  -H "Content-Type: application/json" \
  -d '{
    "grant_type": "authorization_code",
    "client_id": "ocl_01M67Q2B8D7C4E2B9A6F5G1H0K",
    "code": "ocd_Yk2m8VxQ1rT9nB4wC7zD3fG6hJ0kL5pS",
    "redirect_uri": "http://127.0.0.1:33418/callback",
    "code_verifier": "dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk"
  }'

Response 200

{
  "access_token": "eyJhbGciOiJFUzI1NiIsInR5cCI6ImF0K2p3dCJ9.eyJ0b2tlbl91c2UiOiJtY3BfYWNjZXNzIn0.c2ln",
  "token_type": "Bearer",
  "expires_in": 3600,
  "refresh_token": "ort_Vq7m2KxT9nB4wC1zD3fG6hJ0kL5pSrY8",
  "scope": "provenance:personal"
}

End a connection

POST/v1/oauth/revoke

RFC 7009: an assistant ends its own connection with its access token. Always 200.

No API key needed.

Parameters

tokenstringRequired
The access token.

Returns

Done.

Errors

curl -X POST "$PROVENANCE_API/v1/oauth/revoke" \
  -H "Content-Type: application/json" \
  -d '{ "token": "eyJhbGciOiJFUzI1NiJ9.e30.c2ln" }'

Response 200

{}

Was this page helpful? Send us feedback

LLM? Read llms.txt.