Connector
Authentication
A remote client authenticates with OAuth 2.1 and holds its own token. A script authenticates with an API key. Both reach the same tools; only the remote path supports per-user grants and revocation.
The OAuth flow
Nothing is provisioned by hand. A client discovers the server, registers itself, and sends the person to a consent screen. Every URL below is live and can be called by a reviewer without an account.
1. Discover the resource
curl https://cresva.ai/.well-known/oauth-protected-resource/mcp { "resource": "https://cresva.ai/mcp", "authorization_servers": ["https://cresva.ai"], "scopes_supported": ["read:marketing", "read:commerce", "write:negotiation"], "bearer_methods_supported": ["header"]}RFC 9728. authorization_servers points at the document below.
A client that calls /mcp without a token gets the same pointer in the challenge, so discovery works from either direction.
HTTP/2 401www-authenticate: Bearer resource_metadata="https://cresva.ai/.well-known/oauth-protected-resource/mcp", error="invalid_token", error_description="This connector needs a Cresva access token."2. Register
Dynamic client registration, RFC 7591. It is open by design, because a client registers before it has any credential. Registering grants nothing: no consent, no data, no access to an account.
curl -X POST https://cresva.ai/api/oauth/register \ -H 'content-type: application/json' \ -d '{ "client_name": "Your client", "redirect_uris": ["https://your.app/callback"], "grant_types": ["authorization_code", "refresh_token"], "response_types": ["code"], "token_endpoint_auth_method": "none" }'Redirect URIs are matched exactly
3. Authorise
PKCE is mandatory and S256 is the only accepted method. The resource parameter is required and must name the resource from the discovery document, per RFC 8707.
https://cresva.ai/oauth/authorize ?response_type=code &client_id=<from registration> &redirect_uri=<exactly what you registered> &code_challenge=<S256 of your verifier> &code_challenge_method=S256 &scope=read:marketing read:commerce &state=<opaque> &resource=https://cresva.ai/mcpScopes, in plain words
read:marketingread:commercewrite:negotiationwrite:proposalsAPI keys, the alternative
The local package and any direct HTTP caller authenticate with a Cresva API key instead. A key is not tied to a person, so it has no consent screen, no grant row and nothing to revoke from Connected apps: you rotate the key.
curl -X POST https://cresva.ai/api/mcp/brands \ -H 'authorization: Bearer sk_live_...' \ -H 'content-type: application/json' \ -d '{}'TEST and LIVE
sk_live_reads your real connected accounts.sk_test_reads simulated data. Nothing it returns is your account, and nothing it does can change one. Use it in CI and in demos.
See Test mode for what the simulated data contains.
Tokens rotate