# MCP server

Layer provides an [MCP (Model Context Protocol)](https://modelcontextprotocol.io) 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.

[Setup](/docs/mcp/setup)Connect Claude, Cursor, VS Code, Codex, and more.

[Tools](/docs/mcp/tools)The tools the server exposes, grouped by category.

Administering a workspace (projects, members, usage) is handled by a **separate** [Management MCP server](/docs/mcp/management) — kept apart so its admin tools don’t crowd the creative toolset.

## How it works

Once connected, the MCP server exposes tools for workspaces, models, workflows, forge (direct model execution), and files. Your AI agent selects and calls them automatically based on your prompts — see [MCP tools](/docs/mcp/tools) for the full list.

## Example prompts

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?”_

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

## Error codes

| 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 — top up in **Settings > 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                                                                            |
| INVALID\_INPUTS       | 400    | Malformed parameters or UUIDs                                                                                  |
| UPLOAD\_FAILED        | 400    | File could not be downloaded or stored                                                                         |

Having trouble connecting? See the [setup troubleshooting](/docs/mcp/setup#troubleshooting) section.
