Skip to main content
Connect normal agent workflows to:
It exposes seven task-level tools for planning, approval, execution, status, cancellation, asset upload, brand context, and credits. The lower-level 30-tool endpoint is:
Use the advanced endpoint only when the agent needs direct app/model control, composition, brand or app mutations, refinement, or checkout. The hosted install page provides copyable values:

Install Pattern

Use a remote Streamable HTTP MCP configuration when the client supports it:
The client discovers Lamina OAuth, opens browser consent, lets the user choose a workspace, and stores a workspace-scoped access token. Do not paste an API key into tool arguments.

add-mcp

For clients supported by the community installer:
Add -g for a global install:

Codex CLI

Equivalent ~/.codex/config.toml:

Claude Code

Run /mcp in Claude Code to authenticate, then verify with:

Cursor

Use .cursor/mcp.json or the global MCP configuration:
Refresh MCP servers and complete OAuth when prompted.

VS Code

Create .vscode/mcp.json:
Start or restart the server from the MCP server list, complete OAuth, and enable the seven Lamina tools in agent mode.

Other Remote MCP Clients

Use the same v2 URL as a custom Streamable HTTP or remote MCP server:
Configuration field names vary (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:
Example configuration:
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 whose resource 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:
Connecting to /mcp/agent/v2 without a token returns a bearer challenge pointing at the v2 metadata:
The v2 protected-resource response:
Use the resource indicator that matches the endpoint you connect to (/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:read allows credits and run status.
  • lamina:creative:write allows planning, execution, cancellation, and signed uploads.
  • lamina:brand:read allows reading brand context.
If a token lacks a tool’s required scope, Lamina returns an insufficient-scope bearer challenge so the client can request step-up authorization.

Verify the Install

  1. Confirm the client lists exactly: lamina_plan, lamina_execute, lamina_status, lamina_cancel, lamina_upload_asset, lamina_brand_context, and lamina_credits.
  2. Call lamina_credits.
  3. Call lamina_plan with a small test brief.
  4. Confirm planning returns a plan or clarification without dispatching generation.
  5. Display the plan and estimated cost before testing lamina_execute.
Example plan:
After explicit approval:
Poll the returned run:
If status reports 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

Revoking either token revokes the stored token pair for that grant. A later MCP call with the bearer token returns 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-remote with the v2 URL.
  • Planning works but execution fails: verify the exact fingerprint, required inputs, positive credit ceiling, and idempotency key.