Recommended Endpoint
Connect normal agent workflows to: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 exactly:
lamina_plan,lamina_execute,lamina_status,lamina_cancel,lamina_upload_asset,lamina_brand_context, 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.