Skip to content

MCP server

Layer provides an MCP (Model Context Protocol) server that lets you generate images, 3D assets, video, and audio directly from AI conversations: no code required.

The server is available at https://mcp.app.layer.ai/mcp over Streamable HTTP. Most clients connect with OAuth; some use a Personal Access Token.

Administering a workspace (projects, members, usage) is handled by a separate Management MCP server: kept apart so its admin tools don’t crowd the creative toolset.

Once connected, the MCP server exposes tools for workspaces, models, workflows, forge (direct model execution), files, and Layer’s managed agents. Your AI agent selects and calls them automatically based on your prompts. See MCP tools for the full list.

The jobs of the Layer app’s tools menu, such as upscale or reframe, run over MCP as they do in the app. list_inference_tools lists the tools you can run, get_inference_tool returns a tool’s fields on a model, and run_inference_tool runs it. A tool asks only for the fields its job needs, and the asset it makes reopens in that tool in the Layer app. See Layer tools for how a tool picks its model and how to reopen a past run in its tool.

Your agent can hand a whole job, such as a playable ad or a motion-design video, to one of Layer’s managed agents and hold the conversation with it. list_agents returns the agents your workspace’s AI policy allows, each with the Creative Units and minutes a build round takes at each effort.

A job is a send, then a poll:

  1. send_agent_message starts a turn and returns its session_id and turn_id at once. Pass an idempotency_key so a retried send returns the same turn instead of starting a second one.
  2. get_agent_response waits on the turn and returns its status: queued, working (with progress), completed (with the reply and any outputs), failed or cancelled. Call it again while the turn is queued or working. A question or a plan is back in seconds; a build takes 15 to 45 minutes.
  3. To answer, send again with the same session_id. One turn runs at a time in a session; a send while one runs fails with TURN_IN_PROGRESS.

Agents often answer with a question or a priced plan before they start. Over MCP a plan comes back as text ending on “Shall I go ahead?”, and as pending_plan with its total in Creative Units. When several plans wait together, pending_plan combines them: the summaries joined and the totals added. Your next message saying yes approves it and starts the build. That spend is the user’s decision: a well-behaved client asks them, and does not approve a plan on its own.

A generation (one run, or one batch of runs priced together) that costs more than the spend confirmation threshold, or a step the agent always confirms such as a Playables art-bible sheet, waits for approval instead of starting. The turn reads completed with the cost in reply and a pending_spend holding its Creative Units, model, output count and confirmation_id. Answer it with confirm_agent_spend: approved: true lets it run, as long as the workspace can still pay for it, and the same turn carries on; false declines it. A message sent instead stops the turn, which declines the spend. The answer is recorded as the user’s, as if they had approved the cost card in the Layer app, so ask them first.

Each turn bills Creative Units, as it does in the Layer app. cancel_agent_turn stops a running turn and keeps what the agent already delivered.

An MCP session is an ordinary Layer session. It shows on My sessions in the app, opens there from its session_url, and can be continued from either side. list_chat_sessions lists the same sessions, each with its latest turn. A follow-up goes to the agent that last replied; when that agent isn’t available over MCP, such as in a session handled in the Layer app, send_agent_message refuses a follow-up without an agent_id and names the agents you can pass. A turn waiting on a card in the app, such as a question, a form or a plan to approve, reads completed with the card in reply, and your next message answers it. A cost card is the exception: answer it with confirm_agent_spend.

Generations are grouped into sessions, the boards you see in the Layer app. To file work in a project, name the project in your prompt; the agent passes its project_id:

Tool With project_id
execute_forge, run_inference_tool, execute_workflow, render_video_timeline Start a new session in the project. With session_id, that session must already be in the project.
upload_file, request_file_upload_url Add the file to the project.
render_text, compose_image Add the image to the project. With session_id, that session must already be in the project.
create_reference_set, start_training Add the reference set to the project.
send_agent_message Start a new session in the project, under the project’s AI policy.

A run that creates a session returns its session_id. The agent passes it on follow-up calls so the rest of the work lands on the same board.

The project must be active, and you must be a member of it. A workspace admin may also use a project open to the workspace, but not a private one, which takes its members only. Adding a file, image or reference set to a project with project_id also needs permission to edit projects, as it does in the Layer app; a service account’s token needs the projects:write scope for it. Starting a session in a project does not.

The server ships an MCP Apps view, so a generation renders inside the conversation: you see and browse the images, video, 3D, or audio as they come back, instead of a run id to follow up on.

Nothing to install or configure. Clients that negotiate the io.modelcontextprotocol/ui extension (Claude and ChatGPT among them) render the view automatically; clients that don’t get the same structured result as before.

ui://layer/execute-generation: text/html;profile=mcp-app, rendered for execute_forge, execute_workflow, run_inference_tool.

The view inventory is also published unauthenticated at /.well-known/mcp (mcp_apps), since an MCP client cannot list resources before completing the OAuth connection.

Once connected, try prompts like:

  • “Generate 4 variations of a crystal sword icon on a transparent background”
  • “Show me what image models are available for my workspace”
  • “Create a 3D model of a treasure chest from this reference image”
  • “Run the product shot workflow with a photo of my item”
  • “How many Creative Units do I have left?”
  • “Have Layer’s playable agent build a playable ad from this key art”

Your AI agent will pick the right tools, estimate costs, run the generation, and show you the results.

Code Status Meaning
UNAUTHENTICATED 401 OAuth connection not completed: reconnect in your Connectors settings
FORBIDDEN 403 You don’t have permission for this action
INSUFFICIENT_BALANCE 402 Not enough Creative Units. See Creative Units & billing.
RATE_LIMITED 429 Too many requests: generation is limited to 60/min (plus 30/min for video) per user. Retry after Retry-After.
WORKSPACE_NOT_FOUND 404 Workspace doesn’t exist or you’re not a member
MODEL_NOT_FOUND 404 Model not found or not available in this workspace
WORKFLOW_NOT_FOUND 404 Workflow not found or not linked to this workspace
RUN_NOT_FOUND 404 Workflow or forge run doesn’t exist
PROJECT_NOT_FOUND 400 Project doesn’t exist in this workspace
PROJECT_ARCHIVED 400 Project is archived: unarchive it in the app to add work
PROJECT_DELETED 400 Project is deleted and can’t take new work
PROJECT_ACCESS_DENIED 403 You’re not a member of the project
SESSION_NOT_FOUND 404 Session doesn’t exist or isn’t yours
AGENT_NOT_FOUND 404 Agent doesn’t exist or can’t be reached over MCP
TURN_NOT_FOUND 404 Turn doesn’t exist in the session, or the session has no turns yet
TURN_IN_PROGRESS 409 A turn is already running in the session: wait for it or cancel it
AGENT_UNAVAILABLE 503 The session’s agent isn’t answering right now: retry shortly
INVALID_INPUTS 400 Malformed parameters or UUIDs
UPLOAD_FAILED 400 File could not be downloaded or stored

Having trouble connecting? See the setup troubleshooting section.