Recommended Endpoint
Connect normal agent workflows to:Brand MCP authentication
Usehttps://app.uselamina.ai/mcp/commerce as both the MCP URL and OAuth resource. The host discovers the issuer through the protected resource metadata, then uses the authorization code flow with PKCE. Choose the intended workspace and grant both creative scopes. Brand resource metadata
Existing Brand connections. Keep the same OAuth client ID, resource, workspace and token store when switching to the delegated tool. A valid Brand grant with lamina:creative:read and lamina:creative:write can be reused. Once the operator enables the profile, refresh the host’s tool list and check that it contains only commerce_request. A cached list of direct tools can outlive the configuration change.
Token renewal. Store tokens in the host’s credential store. Send Authorization: Bearer <access_token> to the MCP endpoint. Access tokens last one hour. On expiry, exchange the stored refresh token at the issuer’s token endpoint using grant_type=refresh_token. Save the returned access and refresh tokens together. Each new refresh token has a 30-day lifetime and retains the original client, user, workspace, resource and scopes. Coordinate refreshes between workers that share credentials.
When consent is needed. Start a new authorization if the host has lost its credentials, the refresh grant expired or was revoked, or the integration needs a different client, workspace, resource or additional scope. On a 403 with a valid grant, check Brand workspace access and the integration profile before prompting the user to sign in again. Brand MCP quickstart
Install Pattern
Use a remote Streamable HTTP MCP configuration when the client supports it:add-mcp
For clients supported by the community installer:-g for a global install:
Codex CLI
~/.codex/config.toml:
Claude Code
/mcp in Claude Code to authenticate, then verify with:
Cursor
Use.cursor/mcp.json or the global MCP configuration:
VS Code
Create.vscode/mcp.json:
Other Remote MCP Clients
Use the same v2 URL as a custom Streamable HTTP or remote MCP server:url, serverUrl, httpUrl, or endpoint URL), but authentication
must use the hosted OAuth flow.
Stdio-Only Clients
If a client can only launch a local process, bridge stdio to Lamina’s hosted server:mcp-remote opens Lamina OAuth in a browser and forwards the hosted tools. Do not add
LAMINA_API_KEY for this bridge.
The self-hosted
@uselamina/mcp npm package is retired. Connect to the hosted v2 endpoint
directly or through mcp-remote.OAuth Discovery
Each MCP endpoint publishes protected-resource metadata whoseresource matches the URL you
connect to — as RFC 9728 requires. A spec-correct client verifies that the metadata’s resource
equals the server it is protecting and aborts on a mismatch, so v2 and v1 each advertise their own
identifier:
/mcp/agent/v2 without a token returns a bearer challenge pointing at the v2 metadata:
/mcp/agent/v2 for the front
door). You do not need to re-authorize when migrating v1 → v2: tokens minted for the legacy
/mcp/agent resource are cross-accepted at the v2 endpoint, and both endpoints share one
authorization server, so an existing grant keeps working.
Authorization Flow
1
Register the client
Dynamic clients call
POST /mcp/oauth/register with their name and redirect URIs. Public
clients use token_endpoint_auth_method: "none".2
Start authorization
Open
/mcp/oauth/authorize with the standard authorization-code fields, the resource matching
the endpoint you connect to (https://app.uselamina.ai/mcp/agent/v2 for the front door), and a
PKCE S256 challenge.3
Approve a workspace
The user chooses the Lamina workspace and approves the requested scopes.
4
Exchange the code
POST the code and PKCE verifier to
/mcp/oauth/token, again using the same resource.5
Call v2
Send MCP requests to
/mcp/agent/v2 with Authorization: Bearer <access_token>.6
Revoke on disconnect
POST the token to
/mcp/oauth/revoke when the user removes Lamina.Scopes
lamina:creative:readallows credits and run status.lamina:creative:writeallows planning, execution, cancellation, and signed uploads.lamina:brand:readallows reading brand context.
Verify the Install
- Confirm the client lists the task-level tools, including
lamina_plan,lamina_execute,lamina_status, andlamina_credits. - Call
lamina_credits. - Call
lamina_planwith a small test brief. - Confirm planning returns a plan or clarification without dispatching generation.
- Display the plan and estimated cost before testing
lamina_execute.
timedOut: true or remains non-terminal, call it again with the same run ID.
Completed artifacts are returned in normalized outputs[] entries with durable url values.
Revoke Access
invalid_token.
Troubleshooting
- The client shows 30 tools: it is connected to
/mcp/agent; switch normal workflows to/mcp/agent/v2. - The client shows no tools: inspect the OAuth prompt and server logs, then reconnect.
invalid_token: revoke/reconnect and complete OAuth again.insufficient_scope: reconnect and approve the requested scope.- The client only supports stdio: use
mcp-remotewith the v2 URL. - Planning works but execution fails: verify the exact fingerprint, required inputs, positive credit ceiling, and idempotency key.