# MCP server

> Connect Claude, ChatGPT, Cursor and other AI apps to your Muzekit editors. Sign in once, pick the editors and what the app may do, and work in Test or Live.

Muzekit runs an MCP server for your team. An AI app connected to it can build and edit templates, render images, PDFs and videos, change your editor's look and features, look up end users, and read usage and the audit log, with your role and nothing more.

```text
https://mcp.muzekit.com/mcp
```

Add that URL to your AI app as a remote MCP server (also called a custom connector). The app opens a Muzekit sign-in page: you pick the editors it may work in and what it may do in each, then Allow. There is no key to copy.

To let your users connect their own AI app to their designs, see [Let your users connect their AI app](#let-your-users-connect-their-ai-app).

<McpPaths />

## Connect

### Claude Code

```bash
claude mcp add --transport http muzekit https://mcp.muzekit.com/mcp
```

Then run `/mcp` in Claude Code and choose **Authenticate**.

### Claude and ChatGPT

In Claude, open **Settings → Connectors → Add custom connector**; in ChatGPT, **Settings → Apps → Create**. Paste the URL and connect.

### Cursor, VS Code and other clients

```json
{
  "mcpServers": {
    "muzekit": { "url": "https://mcp.muzekit.com/mcp" }
  }
}
```

Any client that supports MCP's Streamable HTTP transport with OAuth works. Secret keys (`mk_test_…`, `mk_live_…`) don't work on MCP: they are for your servers and the [REST API](/docs/api-reference).

## Set up the editor in your app

With a coding agent (Claude Code, Cursor, Codex, VS Code and others) connected, ask it in your project:

```text
Set up the Muzekit editor in this app, on an /editor page for signed-in users.
```

The agent reads your repo to find your stack, then calls `get_setup_guide`. It answers with the exact files for that stack: a server route that opens a [session](/docs/sessions) with your secret key, and the page that mounts the editor with the [browser SDK](/docs/embed-sdk). The agent adds them using your own sign-in for the user.

Stacks with ready files: Next.js (App and Pages Router), React Router and Remix, React, Vue, Nuxt, SvelteKit, Angular, Astro, Node with Express, Rails, Laravel, plain PHP, Django, Flask, FastAPI and Go. Anything else gets the same two steps to follow.

You put your Test key (`mk_test_…`, from **API keys**) in your server's environment file yourself, as `MUZEKIT_SECRET_KEY`: the agent never sees it, and keys never work on MCP. Run your app and open the page. Test works on `localhost` on any port, for free.

The agent then calls `get_setup_status` to confirm the editor opened in your app, and offers what is left: a starter template from the library, your logo and colors, **Copy to Live**, and your domain in Live.

## What the app may do

On the sign-in page you pick the editors, and for each one its access: **Read only**, **Design** or **Manage**, plus a **Live changes** switch. Choices your role doesn't allow aren't offered, and ones the app didn't ask for are greyed out.

<Screenshot src="/docs/5-consent-verified.webp" original="/docs/raw/5-consent-verified.png" alt="The sign-in page for Claude: the editors to connect, each with its access" />

<Screenshot src="/docs/5-consent-access-menu.webp" original="/docs/raw/5-consent-access-menu.png" alt="An editor's access menu: Read only, Design, Manage and the Live changes switch" />

What each choice allows:

| Choice | What it allows |
|---|---|
| Read only | See templates, the brand kit, files, renders and settings. Always on |
| Design | Create and edit templates, the brand kit and files, and render |
| Manage | Change the editor's settings, end users, webhooks and team |
| Live changes | Change Live templates and settings, not only Test. Off unless you turn it on |

What a call may do is always **your role now** and **what you allowed** for that editor, whichever is less. If an owner changes your role, the app's next call follows the new role. See [Team](/docs/team) for what each role can do.

The brand kit, the team, library picks and the editor's name are shared by Test and Live, so changing them doesn't need Live changes.

Some things are never done through an app, only in the dashboard: billing, API keys, webhook signing secrets, transferring or deleting an editor, and accepting invites.

An app Muzekit hasn't verified says so at the top, and starts without **Manage**:

<Screenshot src="/docs/5-consent-unverified.webp" original="/docs/raw/5-consent-unverified.png" alt="The sign-in page for an app Muzekit hasn't verified, with its warning" />

## Test and Live

Tools take `environment`, Test by default; tools for what Test and Live share, like the brand kit and the team, don't. An app without **Live changes** can read Live but only change Test. To publish, the app can run **Copy to Live** if you allowed it, or you can do it from the dashboard.

## Tools

| Area | Tools |
|---|---|
| Setup | `get_setup_guide`, `get_setup_status` |
| Editors | `list_editors`, `get_editor`, `list_environments`, `get_editor_settings`, `update_editor_settings`, `get_domains`, `update_domains`, `copy_to_live_plan`, `copy_to_live` |
| Templates | `list_templates`, `get_template`, `get_template_parameters`, `create_template`, `update_template`, `duplicate_template`, `delete_template`, `get_template_document`, `update_template_document`, `list_template_versions`, `get_template_version_document`, `share_template` |
| Library | `list_library`, `pick_library_template`, `unpick_library_template`, `copy_library_template` |
| Brand kit and files | `get_brand`, `add_brand_color`, `update_brand_item`, `delete_brand_item`, `list_assets`, `create_asset_upload`, `delete_asset` |
| Renders | `render`, `render_batch`, `get_render`, `list_renders` |
| End users | `list_users`, `get_user`, `get_user_usage`, `list_user_designs`, `open_review_session`, `list_sessions` |
| Webhooks | `list_webhooks`, `create_webhook`, `update_webhook`, `delete_webhook`, `send_test_webhook`, `set_render_on_save` |
| Team | `list_team`, `invite_member`, `cancel_invite`, `change_member_role`, `remove_member`, `list_connections`, `revoke_connection` |
| Usage | `get_usage`, `get_audit_log`, `get_request_log` |

An app sees only the tools it may use: a reviewer's app gets the reading tools.

Every tool takes `editor` (a slug from `list_editors`; optional when you connected one editor) and most take `environment`. Results carry `next`, one line on what is true now, and often a dashboard link.

Renders use API credits and AI credits exactly as [Create a render](/docs/api-reference/renders-create) does. Refused calls answer with the API's own [errors](/docs/errors), plus what would allow them.

## Who did what

Everything an app changes is in the editor's **Audit log** as you, through the app: "Priya via Claude". Its reads are in the **API log**. Filter the audit log by MCP to see only what apps did.

## Disconnect

Your connections are under **Account → Connected apps**: change what an app may do on each editor, add or remove an editor, or disconnect it. Admins and owners see every connection on their editor under **Team → Connected apps**. An admin can revoke their own and those of designers and reviewers; the owner can revoke any. Revoking ends the app's access to that editor at its next call.

<Screenshot src="/docs/5-connected-apps.webp" original="/docs/raw/5-connected-apps.png" alt="Account, Connected apps: Claude with its access on each editor" />

Muzekit emails you when you connect an app or give it more than it had, and emails the owner when a teammate gives an app **Manage** or **Live changes** on their editor. If an app's sign-in is used from two places at once, Muzekit ends it and emails you; connect the app again to keep using it.

## Let your users connect their AI app

Everything above is for your team. Your users can connect Claude, ChatGPT or another AI app too, to their own designs in your editor: "make three sizes of my sale banner" works from their AI app, on what they made in your app. They sign in on your page, as they always do, and allow the app in the editor. They never see a Muzekit account.

### What it costs

It is free to build and try in Test. In Live it needs the **AI assistants for your users** add-on: $349 a month per editor ($3,490 a year), added in **Billing → Add-ons** once your plan has started. The add-on turns the feature on: your editor's address for AI apps and the sign-in on your page. There is no separate meter for assistants. Their work draws on what your plan already has:

- **Sessions**: an assistant at work is a session, counted as below.
- **API credits**: an assistant has no browser, so every image, PDF and video it makes is rendered on our servers, like a [render through the API](/docs/api-reference/renders-create): an image is 1 credit a page, a PDF 1, a video 1 a second. In Test they are free and watermarked.

### Turn it on

In the dashboard, open **Settings → AI assistants** for Test or Live (the environment in the editor switcher). Set:

- **Page in your app**: the page where your users open the editor, for example `https://app.yourproduct.com/design`. When a user connects an AI app, Muzekit sends them there to sign in. It must be on one of the environment's [allowed domains](/docs/allowed-domains). Live needs https; Test also takes `http://localhost`.
- **What an assistant may do**: any of these, at least one.

| Choice | What it allows |
|---|---|
| Their designs | See, create and edit the user's own designs, starting from your templates |
| Render and download | Make images, PDFs and videos of their designs |
| Their uploads | See and add the user's own files |
| The brand kit | Use the editor's brand colors, fonts and images |

The editor's [Features](/docs/editor-modes#turning-parts-of-the-editor-off) still apply: with video off, an assistant can't make videos either. An assistant's tools are `list_designs`, `get_design`, `create_design`, `update_design`, `render_design`, `get_render`, `list_uploads`, `create_upload` and `get_brand`, and it sees only those its choices allow. Then turn **Let users connect an AI app** on.

<Screenshot src="/docs/9-assistant-settings.webp" original="/docs/raw/9-assistant-settings.png" alt="Settings, AI assistants: turned on, with the page in your app, what an assistant may do and the address for your users" />

### The address to give your users

```text
https://mcp.muzekit.com/users/{editor}        Live
https://mcp.muzekit.com/users/{editor}/test   Test
```

`{editor}` is your editor's slug; the dashboard shows the full address with a Copy button once it's on. The editor shows it to your users too: **Use with your AI assistant** in the menu under the design's name, with the address, three steps and the apps they connected. You can also put it in your app's help or settings. Your users add it to their AI app as a custom connector, the same way your team adds the [team address](#connect).

<Screenshot src="/docs/9-assistant-menu.webp" original="/docs/raw/9-assistant-menu.png" alt="The editor's menu under the design's name, with Use with your AI assistant" />

<Screenshot src="/docs/9-assistant-panel.webp" original="/docs/raw/9-assistant-panel.png" alt="The Use with your AI assistant panel: the address, three steps and the apps the user connected" />

### What your users see

<Sequence
  actors={[
    { key: "ai", label: "Their AI app", sub: "Claude, ChatGPT, …" },
    { key: "page", label: "Your page", sub: "your sign-in, the editor" },
    { key: "mk", label: "Muzekit", sub: "mcp.muzekit.com" },
  ]}
  steps={[
    { from: "ai", to: "page", label: "opens it with `?muzekit_connect=…`", detail: "the user signs in if needed" },
    { from: "page", to: "page", label: "the editor asks: Allow?" },
    { from: "page", to: "mk", label: "Allow", detail: "for this user and editor only" },
    { from: "mk", to: "ai", label: "signed in", detail: "the app can now call its tools" },
  ]}
  caption="Your page stays the sign-in. Muzekit never asks your users for a password."
/>

1. The AI app sends the user to your page with `?muzekit_connect=…` on the address. If they aren't signed in, keep that parameter through your sign-in and back.
2. Your page mounts the editor with the [SDK](/docs/embed-sdk) as usual. The SDK takes the parameter off the address and the editor asks "Allow Claude to use Acme Studio for you?" (your editor's name), with what it may do. Apps Muzekit hasn't verified carry a note saying so.
3. **Allow** or **Cancel** sends the page back to the AI app, which finishes signing in or hears the user said no.

<Screenshot src="/docs/9-allow-prompt.webp" original="/docs/raw/9-allow-prompt.png" alt="The editor asking Allow Claude to use Demo editor for you, with what it may do" />

Nothing else changes on your page: the editor opens as it always does under the prompt.

### Your own screen

To ask in your own words, pass `assistantConnect: false` to `Muzekit.mount`. The editor then shows nothing and the parameter stays on the address. The SDK's `assistantConnect` event gives you the request either way:

```js
Muzekit.mount("#editor", {
  fetchClientSecret,
  assistantConnect: false,
  on: { assistantConnect: ({ request }) => showMyAllowScreen(request) },
});
```

Then, from your server, with your secret key for that environment:

```bash
# What the app is and what it asks for
curl https://api.muzekit.com/v1/assistant/requests/$REQUEST \
  -H "Authorization: Bearer $MUZEKIT_SECRET_KEY"

# Allow, for your signed-in user (your own id, as in a session)
curl -X POST https://api.muzekit.com/v1/assistant/requests/$REQUEST/approve \
  -H "Authorization: Bearer $MUZEKIT_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "user": { "id": "user_123", "name": "Ana", "email": "ana@example.com" } }'

# Or say no
curl -X POST https://api.muzekit.com/v1/assistant/requests/$REQUEST/deny \
  -H "Authorization: Bearer $MUZEKIT_SECRET_KEY"
```

The request answers `{ app: { name, logoUrl, verified, selfRegistered }, scopes, editor }`. Approve and deny answer `{ redirect }`: send the user's browser there. A request lasts 10 minutes and works once; after that it answers `404 request_expired` and the user starts again from their AI app.

### Sessions and control

A session is one user's stretch of work, the same in an AI app as in the editor:

- It starts with the first thing a user's AI app does in your editor (its first tool call).
- It goes on for as long as the app keeps working, with breaks of up to 10 minutes between calls. Any number of calls in that time is one session.
- After 10 minutes without a call, the next call starts a new session. A connected app that does nothing uses none.
- One session lasts 12 hours at most.

So a user who asks for three banner sizes and downloads them uses one session; if they come back an hour later with another request, that is a second one. In Live a session counts toward your plan's sessions; in Test it counts like a localhost session (free, up to your plan's fair use). Everything an assistant changes is in the **Audit log** as that user, through the app.

To hold what assistants can spend, choose what they may do: leave **Render and download** off and an assistant can design but not make files, so it uses no API credits.

**Settings → Connected assistants** lists every user's connected app in that environment, with when it was last used. Revoke one and its next call fails. Your users can disconnect their own apps in the editor, under **Use with your AI assistant**. Turning AI assistants off stops every connected app at its next call; turning it back on lets them work again without signing in. Deleting a user ends their connections.

<Screenshot src="/docs/9-end-user-connections.webp" original="/docs/raw/9-end-user-connections.png" alt="Settings, Connected assistants: a user's connected Claude, when it was last used and its revoke button" />
