Skip to Content
MCPAuthentication

Authentication

Gavana has two authentication paths, and which one you use is decided entirely by which server you connect to.

Hosted MCPLocal stdio MCP
Endpointhttps://app.gavana.ai/mcpnpx -y @gavana.ai/mcp@0.5.1 on your machine
CredentialBrowser OAuth, PKCE, no token to copyA saved CLI login, or an Agent Access token
Where it livesThe client’s own connector storageYour MCP client’s private environment, or ~/.config/gavana/agent.json
ExpiryNo automatic expiry; it remains active until you disconnect or revoke itNever by default; optionally choose a custom 1–90 day expiry when you create the token
RevocationSettings → Connect an agent → ConnectedThe same list — it holds OAuth grants and tokens together

If you can use the hosted endpoint, use it. Nothing is safer than a credential you never have to handle.

Hosted: browser OAuth

You add an endpoint URL to your client, click connect, sign in to Gavana in a browser, review a consent screen, and approve. No token is ever pasted into a chat window, a config file, or a shell command. Settings → Connect an agent in Gavana walks you through this for each app.

What the flow supports

The authorization server metadata is published at https://app.gavana.ai/.well-known/oauth-authorization-server, and the hosted endpoint publishes protected-resource metadata at /.well-known/oauth-protected-resource/mcp.

Any MCP client that implements standard OAuth discovery finds everything it needs there. The declared surface is:

PropertyValue
Authorization endpointhttps://app.gavana.ai/oauth/authorize
Token endpointhttps://app.gavana.ai/oauth/token
Registration endpointhttps://app.gavana.ai/oauth/register
Revocation endpointhttps://app.gavana.ai/oauth/revoke
Grant typesauthorization_code
Response typescode
Response modesquery
PKCES256 required
Client authenticationnone — public clients with PKCE only
Bearer methodheader

Dynamic client registration is open, with real constraints: 1–10 redirect URIs, each an exact HTTPS or local-loopback callback, and a token_endpoint_auth_method of none. A registration asking for a client secret is rejected. There is no implicit grant and no password grant.

The approval page reads Connect followed by the client’s name and to Gavana, with the subtitle Secure OAuth connection, the account it is Connecting as, and the one place approved access returns to. Permissions are grouped and collapsed; expand a group to read each one:

GroupPermissions it can hold
Canvases and imagescanvas:read, canvas:write, asset:read
Elements and saved referenceselement:read, element:write, reference:extract
Image and video generationimage:generate, video:generate, job:manage

https://app.gavana.ai/mcp grants eight scopes: canvas:read, canvas:write, asset:read, element:read, element:write, image:generate, video:generate, job:manage. There is no partial approval on this path — approving grants all eight. Cancel sends the client back with access_denied.

The authorization server’s metadata also lists reference:extract, so some clients (Codex, for one) ask for every advertised scope. Gavana narrows such a request to the scopes the MCP server can grant and refuses only when none remain.

A read-only connection — the Read-only access switch in Settings → Connect an agent, or --read-only on the gavana mcp helper — uses its own address and grants only canvas:read and element:read. It cannot read image assets, write, or generate.

Approving grants the client the ability to write canvases, manage Elements, and start provider-backed work. Read the list before you click through. The server’s own instructions tell the model to ask for explicit current-turn approval before paid tools, but the capability is present once you approve.

Browser origins

The hosted endpoints accept browser requests from https://chatgpt.com, https://claude.ai, and the Gavana origin itself, plus anything the deployment explicitly allows. A request carrying some other Origin header is refused with 403 before authentication is even attempted. Non-browser clients that send no Origin header are unaffected.

Local: Agent Access tokens

The local stdio server has no browser, so it uses a scoped, revocable Agent Access token — or, if you have already logged in with the CLI, the profile that login saved.

Creating one

The full walkthrough is on Create an Agent Access Token. In short: open Settings → Connect an agent → Developer, name the token after the client and device that will use it under Personal access tokens, keep the default eight permissions and Never expiry or make a deliberate narrower choice, click Create token, then copy the value — Gavana shows it exactly once.

Two details that matter later:

  • The token’s name is written into provenance. A node created through a token named Claude · MCP records that name, so canvas history can tell your clients apart without trusting a caller-supplied label. Use one descriptively named token per client rather than sharing one.
  • Expiry defaults to Never. Choose a custom 1–90 day expiry for a temporary credential. Scopes and expiry are fixed after creation, so replace the token to change either.

Tokens begin with cba_. That prefix is a stable compatibility identifier that predates the Gavana rename — a token starting with cba_ is current, not stale.

Configuring the server

The local server reads either environment variables or the saved CLI profile:

GAVANA_BASE_URL=https://app.gavana.ai GAVANA_AGENT_TOKEN=<your Agent Access token>

or ~/.config/gavana/agent.json, written by gavana auth login.

CRAFTBOARD_BASE_URL, CRAFTBOARD_AGENT_TOKEN, and CRAFTBOARD_AGENT_CONFIG_FILE still work as transition aliases, and the legacy ~/.config/craftboard/agent.json is read when the new path does not exist. Gavana-named variables take precedence.

Put the token in your MCP client’s private environment or secret store. Never in a shared configuration file, a repository, a chat message, or a shell command that lands in history. The install pages use read -rs prompts precisely so the token never appears in your shell history.

Logging in with the CLI instead

If the CLI is already set up, the local MCP server inherits its profile and you configure no token at all. gavana auth login with no token opens a browser and stores a revocable OAuth login — in macOS Keychain where available. To log the CLI in with an existing token instead:

read -rs 'GAVANA_AGENT_TOKEN?Paste Agent Access token: '; printf '\n'; printf '%s' "$GAVANA_AGENT_TOKEN" | gavana auth login --base-url 'https://app.gavana.ai' --token-stdin; unset GAVANA_AGENT_TOKEN

The token goes in over stdin, so it never becomes a command-line argument visible to other processes or to your shell history.

The nine scopes

The same scopes apply to OAuth grants and to Agent Access tokens. A token can hold all nine; a hosted MCP connection holds at most the first eight.

ScopeToken labelGrantsDepends on
canvas:readRead canvasesFind and read canvases, revisions, and node contents—
canvas:writeChange canvasesChange canvases, and add images and generation results to themcanvas:read
asset:readRead assetsRead the image assets connected to your work—
element:readRead ElementsFind and read reusable Elements—
element:writeCreate and manage Elements and Saved referencesCreate, update, archive, and restore Elements and Saved referenceselement:read
image:generateGenerate/upload images and run RecipesGenerate and edit images, write image bytes into Gavana storage, and start any Recipecanvas:read, canvas:write, asset:read
video:generateGenerate videos from prompts and framesDiscover connected video models and start video workcanvas:read, asset:read
job:manageObserve and cancel RunsObserve, resume, wait for, list, and cancel Runs and Jobs—
reference:extractAnalyze and save selected reference imagesUpload selected reference images, analyze them with Gavana managed extraction, and save their ingredientselement:read, element:write, asset:read

Dependencies are enforced when the token is created, not silently added at call time. Asking for image:generate without asset:read returns an error naming the missing scopes; the token creation form selects dependants for you, and clearing a prerequisite clears what depends on it. New tokens start with the first eight selected — everything except reference:extract, which no MCP tool, CLI command, or Canvas API operation on this site needs.

image:generate is the scope that governs writing image bytes into Gavana, not just generating them. That is why save_image_to_canvas requires it even though it generates nothing. A token scoped to canvas:read and canvas:write alone cannot save an image. Importing a product page through save_image_to_canvas with productPageUrl needs only canvas:read, canvas:write, and asset:read.

job:manage is easy to leave off and painful to be without. Without it, a client can start work but cannot poll, wait for, list, or cancel the Run it started. Every hosted tool that waits — generate_image_in_canvas, generate_video, run_canvas_workflow, recipe_run — and every tool that observes — get_image_run, list_image_runs, run_snapshot, get_video_job, get_canvas_workflow_run — requires it.

Which scopes each hosted tool needs

The hosted tools reference lists the exact scopes for every hosted tool, generated from the application’s tool registry. Two rules sit on top of that table:

  • A merged input is authorized as the tool it replaced. generate_image_in_canvas with operation: "edit" needs edit_image_in_canvas’s scopes, save_image_to_canvas with productPageUrl needs import_product_reference_pack’s, model_list with a video capability needs video:generate, and guide_get with query is authorized as guide_search.
  • Applying Elements adds element:read to any image call that passes version-pinned Elements.

guide_get and guide_search require no scope at all, which is why an agent can always read the rules regardless of how narrowly it is provisioned.

Reading an authentication error

ResponseMeansDo this
401 invalid_tokenNo bearer token, a malformed one, or one that expired or was revokedReconnect the client. For a local token created with a custom expiry, create a replacement when that expiry passes.
403 insufficient_scopeThe token is valid but lacks a scope the tool needsThe error names the missing scopes. Reconnect or recreate the token with those added.
403 access_deniedThe browser Origin is not allowedYou are calling from an origin Gavana does not accept.
Tool error toolset_not_enabledThe connection’s profile, ?toolsets=, or ?excludeTools= left that tool — or the tool whose request it makes — outReconnect with an address that includes it.

Both 401 and 403 come back with a WWW-Authenticate header pointing at the protected-resource metadata and listing the required scopes, so a well-behaved client can prompt you to reconnect rather than failing silently.

A scope error at the MCP layer is refused before the handler runs. Nothing partial happens, and no paid work starts.

Credential hygiene

  • Never paste a token into a chat, an issue, a commit, or a screenshot.
  • Never put a token in a URL — Gavana takes bearer tokens in the Authorization header only.
  • Treat a scoped preview URL as a credential. The previewUrl that get_canvas_image and successful image runs return is short-lived and carries its own token query parameter, and anyone holding that URL can fetch the image until it expires. Do not paste one into a shared document, a ticket, or a public log. Hand people the canvas link that canvas_get returns instead.
  • Never expose a connected provider’s configuration — keys, endpoints, or account details — in a transcript or a report.
  • Use one named token per client so revoking one does not break the others, and so provenance stays readable. Settings → Connect an agent → Connected shows when each was last used.
  • Use a custom expiry for a temporary or less-trusted device; otherwise revoke the token when that client or device is no longer trusted.
  • When you report a problem to support, share the X-Request-ID value from the failing response and nothing else. It identifies the request without exposing a credential or canvas content.
  • Webhook signing secrets are deliberately kept out of MCP tool arguments so they cannot enter a model-visible transcript. If you need callbacks, use the CLI’s --webhook-secret-env option or call the API from a trusted backend.
Last updated on