> ## Documentation Index
> Fetch the complete documentation index at: https://elarislabs.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP setup

> Configure Claude Desktop, Cursor, Windsurf, VS Code, and other MCP clients to use ElarisLabs Creative Studio tools in three steps.

Connect Creative Studio to your agent in three steps.

Every API key is bound to one brand. Discovery tools are free. Generation tools
deduct credits from that brand's balance.

<Steps>
  <Step title="Create an API key">
    Open [your profile](https://studio.elarislabs.ai/en/profile) and go to
    **API keys / MCP**.

    * Pick a brand.
    * Set an expiry and a spend cap.
    * Copy the key (`elx_live_...`). It is shown only once.
  </Step>

  <Step title="Add the server to your client">
    Paste the config below into your MCP client. Use your key in the
    `Authorization: Bearer` header.

    <CodeGroup>
      ```json Claude Desktop theme={"dark"}
      {
        "mcpServers": {
          "elarislabs": {
            "url": "https://studio.elarislabs.ai/api/mcp",
            "headers": {
              "Authorization": "Bearer elx_live_YOUR_KEY_HERE"
            }
          }
        }
      }
      ```

      ```json Cursor theme={"dark"}
      {
        "mcpServers": {
          "elarislabs": {
            "url": "https://studio.elarislabs.ai/api/mcp",
            "headers": {
              "Authorization": "Bearer elx_live_YOUR_KEY_HERE"
            }
          }
        }
      }
      ```
    </CodeGroup>
  </Step>

  <Step title="Restart and prompt">
    Restart the client and enable the server in settings. Then ask in plain
    language:

    > "List available image models, then generate a product shot with flux-2-flash."
  </Step>
</Steps>

<Tip>
  Start with free tools like `list_models` and `list_brands` to confirm the
  connection before running paid generation.
</Tip>

## How do I set up Claude Desktop?

Works with Claude Desktop on macOS and Windows. It requires a recent version
with remote MCP (URL) support.

### Option A. Remote URL (recommended)

<Steps>
  <Step title="Open the config">
    Open Claude Desktop, then go to **Settings > Developer > Edit Config**. This
    opens `claude_desktop_config.json`.
  </Step>

  <Step title="Find the config file">
    * macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
    * Windows: `%APPDATA%\Claude\claude_desktop_config.json`
    * Linux: `~/.config/Claude/claude_desktop_config.json`
  </Step>

  <Step title="Add the server">
    Replace the token with your key.

    ```json claude_desktop_config.json theme={"dark"}
    {
      "mcpServers": {
        "elarislabs": {
          "url": "https://studio.elarislabs.ai/api/mcp",
          "headers": {
            "Authorization": "Bearer elx_live_YOUR_KEY_HERE"
          }
        }
      }
    }
    ```
  </Step>

  <Step title="Restart Claude">
    Save, then fully quit and restart Claude Desktop. Do not just close the
    window. Open a new chat and the ElarisLabs tools appear in the tools panel.
  </Step>
</Steps>

### Option B. stdio bridge (older Claude builds)

If your Claude version does not support remote `url` servers, use the
`mcp-remote` npm package as a local bridge.

```json claude_desktop_config.json theme={"dark"}
{
  "mcpServers": {
    "elarislabs": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://studio.elarislabs.ai/api/mcp",
        "--header",
        "Authorization: Bearer elx_live_YOUR_KEY_HERE"
      ]
    }
  }
}
```

<Note>
  Requires Node.js 18+ installed. The bridge forwards stdio to HTTP so Claude can
  talk to the remote server.
</Note>

## How do I set up Cursor?

Cursor has first-class MCP support. Use Agent mode so the model can call tools on
its own.

### Global vs project config

| Scope   | File                            | When to use                                            |
| ------- | ------------------------------- | ------------------------------------------------------ |
| Global  | `~/.cursor/mcp.json`            | Available in every project on your machine             |
| Project | `.cursor/mcp.json` in repo root | Share with teammates via git. Use env vars for secrets |

<Steps>
  <Step title="Edit your config">
    Create or edit your MCP config file.
  </Step>

  <Step title="Add the server">
    ```json .cursor/mcp.json theme={"dark"}
    {
      "mcpServers": {
        "elarislabs": {
          "url": "https://studio.elarislabs.ai/api/mcp",
          "headers": {
            "Authorization": "Bearer elx_live_YOUR_KEY_HERE"
          }
        }
      }
    }
    ```
  </Step>

  <Step title="Enable it">
    Open **Cursor Settings > MCP**. Confirm `elarislabs` is listed and the toggle
    is on (green). A red dot means the server failed to connect. See
    [Troubleshooting](#troubleshooting).
  </Step>

  <Step title="Use Agent mode">
    Open Agent mode, not Ask. Then prompt in plain language. The agent discovers
    tools on its own. You do not need to mention the server unless you want to
    force it.
  </Step>

  <Step title="Try a prompt">
    > "Use list\_models to show image models, then generate\_image with flux-2-flash. A neon city skyline at dusk."
  </Step>
</Steps>

<Accordion title="Keep secrets out of git (project-level config)" icon="lock">
  Cursor supports environment variable interpolation in `mcp.json`. Set
  `ELARIS_MCP_KEY` in your shell or `.env`, then reference it.

  ```json .cursor/mcp.json theme={"dark"}
  {
    "mcpServers": {
      "elarislabs": {
        "url": "https://studio.elarislabs.ai/api/mcp",
        "headers": {
          "Authorization": "Bearer ${env:ELARIS_MCP_KEY}"
        }
      }
    }
  }
  ```
</Accordion>

## What about other MCP clients?

Any client that supports remote MCP (URL plus headers) can use the same config
block. The JSON shape is always `mcpServers` then `{ name: { url, headers } }`.

<AccordionGroup>
  <Accordion title="Claude Code (CLI)" icon="terminal">
    Add to `~/.claude/settings.json` or project `.mcp.json`. It uses the same
    structure as Claude Desktop. Run `claude mcp list` to verify.
  </Accordion>

  <Accordion title="Windsurf" icon="wind">
    Open **Windsurf Settings > Cascade > MCP** and add a custom server. Or edit
    `~/.codeium/windsurf/mcp_config.json` with the same JSON block.
  </Accordion>

  <Accordion title="VS Code (GitHub Copilot agent mode)" icon="code">
    In VS Code 1.99+, add MCP servers via **Command Palette > "MCP: Add Server"**.
    Or edit `.vscode/mcp.json` in your workspace. Use the URL transport with the
    Authorization header.
  </Accordion>

  <Accordion title="Generic stdio fallback" icon="square-terminal">
    Clients that only support local stdio processes can use the `mcp-remote`
    bridge. This is the same as Claude Option B above.

    ```bash Terminal theme={"dark"}
    npx -y mcp-remote https://studio.elarislabs.ai/api/mcp \
      --header "Authorization: Bearer elx_live_YOUR_KEY_HERE"
    ```
  </Accordion>
</AccordionGroup>

## Can I use ElarisLabs alongside other MCP servers?

MCP clients can connect to many servers at once.

ElarisLabs handles creative generation. Other servers handle their own domains,
like databases, docs, or Google Workspace. Add each server as a separate entry
under `mcpServers`.

```json mcp.json theme={"dark"}
{
  "mcpServers": {
    "elarislabs": {
      "url": "https://studio.elarislabs.ai/api/mcp",
      "headers": {
        "Authorization": "Bearer elx_live_YOUR_KEY_HERE"
      }
    },
    "another-server": {
      "command": "npx",
      "args": ["-y", "@example/some-mcp-server"],
      "env": {
        "API_KEY": "your-other-key"
      }
    }
  }
}
```

### What ElarisLabs MCP does and does not do

| Capability                            | ElarisLabs MCP | Needs a different server                                    |
| ------------------------------------- | -------------- | ----------------------------------------------------------- |
| Image, video, audio generation        | Yes            | No                                                          |
| Brand pack resize and composer edits  | Yes            | No                                                          |
| Studio projects and templates         | Yes            | No                                                          |
| Google Slides, Docs, Sheets           | No             | Yes. Use a Google Workspace MCP server alongside ElarisLabs |
| GitHub, Linear, Notion                | No             | Yes. Each has its own MCP server                            |
| Database queries (Supabase, Postgres) | No             | Yes. Use the provider's MCP server                          |

<Tip>
  **Combining servers:** with ElarisLabs and a Google Slides MCP connected, you
  can ask: "Generate a hero image with flux-2-flash, then add it to slide 2 of
  this deck." The agent picks the right tool from each server. You still install
  and authenticate the Google server yourself. ElarisLabs does not proxy
  third-party MCPs.
</Tip>

Browse community servers at
[modelcontextprotocol/servers](https://github.com/modelcontextprotocol/servers)
or your client's MCP directory.

## Example prompts

Once connected, talk in plain language. The agent maps your intent to tools.

<AccordionGroup>
  <Accordion title="Discovery (free)" icon="search">
    "What brands and image models can this key access? List the top 5 image
    models."
  </Accordion>

  <Accordion title="Image generation" icon="image">
    "Generate a square product shot of a matte black sneaker on white marble using
    flux-2-flash. 2K resolution."
  </Accordion>

  <Accordion title="Image to video" icon="film">
    "Take the image you just generated and make a 6-second vertical video. Slow
    camera push-in, cinematic lighting."
  </Accordion>

  <Accordion title="Brand pack" icon="package">
    "List brand-pack sizes, then resize that hero image into Instagram feed,
    story, and 300x250 display. Return the zip."
  </Accordion>

  <Accordion title="Composer edit" icon="wand-sparkles">
    "Add the text 'SUMMER DROP' in white at the bottom of the image, then remove
    the background."
  </Accordion>

  <Accordion title="Multi-step workflow" icon="workflow">
    "Generate 3 lifestyle variants of our product, stitch them into a hyperlapse
    at 24fps, then generate a voiceover saying 'Built for the city.'"
  </Accordion>
</AccordionGroup>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Server shows red or &#x22;failed to connect&#x22; in Cursor" icon="circle-x">
    Check that your JSON is valid, with no trailing commas. Confirm the URL ends
    in `/api/mcp` with no extra slash. Verify the bearer token starts with
    `elx_live_` and has not been revoked. Restart Cursor after editing
    `mcp.json`.
  </Accordion>

  <Accordion title="Tools do not appear in Claude after restart" icon="triangle-alert">
    Make sure you fully quit Claude. On macOS use Cmd+Q, not just close the
    window. If you use the URL transport and it still fails, switch to the
    `mcp-remote` stdio bridge. Check Claude's developer logs for connection
    errors.
  </Accordion>

  <Accordion title="&#x22;Invalid key&#x22;, &#x22;Key expired&#x22;, or &#x22;Key revoked&#x22;" icon="key-round">
    Create a new key in [your profile](https://studio.elarislabs.ai/en/profile)
    and update the config. Keys have a required expiry, max 24 weeks. Revoked keys
    stop working immediately.
  </Accordion>

  <Accordion title="&#x22;Insufficient credits&#x22; or spend cap hit" icon="wallet">
    Top up the brand's credit balance in Studio. Or raise the per-key spend cap in
    profile settings, max 2000 credits per key. Free tools like `list_models`
    still work.
  </Accordion>

  <Accordion title="Agent does not call tools, only describes what it would do" icon="bot">
    In Cursor, switch to Agent mode, not Ask. Explicitly ask it to use a tool:
    "Call generate\_image with flux-2-flash." Confirm the MCP server toggle is on
    in Settings > MCP.
  </Accordion>

  <Accordion title="Video or brand-pack tool times out" icon="clock">
    These jobs can take 30 to 90 seconds. If your client has a short tool timeout,
    retry or ask for a shorter `durationSeconds` on video. Brand packs with many
    sizes take longer.
  </Accordion>

  <Accordion title="Can I create Google Slides from a link via ElarisLabs MCP?" icon="presentation">
    Not directly. ElarisLabs MCP is for creative generation, like images, video,
    audio, and brand packs. To edit Google Slides, install a separate Google
    Workspace MCP server and connect both. Then ask the agent to generate assets
    with ElarisLabs and place them with the Google server.
  </Accordion>

  <Accordion title="Testing the endpoint manually" icon="flask-conical">
    With a valid key, the MCP initialize handshake should return a 200.

    ```bash Terminal theme={"dark"}
    curl -s -X POST "https://studio.elarislabs.ai/api/mcp" \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer elx_live_YOUR_KEY_HERE" \
      -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}'
    ```
  </Accordion>
</AccordionGroup>
