MCP and Claude Desktop
MCP, the Model Context Protocol, is an open standard that lets an AI client call tools in other applications. PotionUI is an MCP server, so a client such as Claude Desktop or Claude Code can search your gallery, manage your prompts and start generations with your account.
On this page
What you get#
A connected client sees the same tools the built-in PotionAI chat uses in its Generate mode, minus the few that need a Generate tab open in your browser. It acts as you: it sees the presets, models, history and Library you can see, and nothing more.
Turn MCP on#
Two switches, both set by an administrator, must be on before a key can connect.
-
The instance switch
In Administration, System Settings, Access, turn on MCP Access. It is off by default.
In the same section, Public address sets the address used to build links to generations for MCP clients, for example
https://potion.example.com. Leave it empty to use the address the client connected to. -
The per-user switch
In Administration, Users, open a user. Under MCP Access, Allow MCP connections is on by default once the instance switch is on. Turn it off to refuse MCP for that one account.
If either switch is off, connections are refused. You can still see and revoke your keys in Settings.
Create an API key#
MCP clients connect with an API key, the same kind of key a script uses for the HTTP API. It replaces the MCP tokens of earlier releases.
-
Open Settings, API keys
Open your Settings, choose API keys and press Create key.
-
Name it and choose what it can do
Give it a Name, for example Claude Desktop, choose when it Expires (Never, 30 days, 90 days or 1 year) and tick Use with MCP clients. Add Can read as well if the same key should also call the HTTP API. Can generate and Can change and delete your content are separate permissions, and Full administration is for administrators only.
-
Copy it now
The key starts with
pui_and is shown once. Press Copy key; the dialog also shows a block of settings for an MCP client with your address filled in.What you will seeEach key is listed with its permissions. From its row you can rename it, change what it can do, see its activity, choose its MCP tools and revoke it. A revoked or expired key stays in the list.
A key carries your account’s access, within the permissions you ticked. Anyone who has it can act as you. Revoke a key you no longer use; any client using it loses access at once, and this cannot be undone. Keys made from MCP tokens in an earlier release work for MCP only, so create a new key for the HTTP API.
Connect a client#
Give your MCP client the endpoint and the key as a bearer token:
URL: https://<your-server>/api/mcp Authorization: Bearer <your-key>
The endpoint takes JSON-RPC requests over HTTP POST and answers with plain JSON; it does not stream. It speaks the MCP protocol versions 2025-06-18, 2025-03-26 and 2024-11-05, and offers tools only.
In your client, add a remote MCP server: enter the URL above and set a custom header named Authorization with the value Bearer <your-key>. Use the same two values in every client that supports remote MCP servers. Then start a new chat and ask it to list your presets to check the connection.
Check the connection
Before setting up a client, you can ask the server for its tool list with curl:
curl -X POST https://<your-server>/api/mcp \
-H "Authorization: Bearer $MCP_KEY" \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "tools/list"}'| Status | Message | What to do |
|---|---|---|
| 401 | MCP needs an API key (api_key_required) | Send an API key in the Authorization: Bearer header. A signed-in browser session is not accepted. If the key was revoked or has expired, create a new one in Settings, API keys. |
| 403 | MCP is disabled on this instance | Ask an administrator to turn on MCP Access. |
| 403 | MCP is disabled for this user | Ask an administrator to allow MCP connections for your account. |
What the assistant can do#
You ask your client in plain words; it picks the tools. They are grouped by purpose. The exact, current list with each tool’s arguments is in the app, under Administration, Documentation, MCP Tools.
| Purpose | Tools |
|---|---|
| Find presets and models | list_presets, get_preset_info (a mode’s form fields and prompting guide), search_models, get_model_info |
| Generate | start_generation: starts a run from a preset, or from a saved session by its session_id with only what changes; returns the generation_id and a details_url that opens it in History |
| Follow a generation | get_generation_status (state, progress, queue position, error), wait_for_generation (returns when the run finishes or after a bounded wait), get_generation_results (a few pictures come back inline, everything else as links), cancel_generation |
| Send a file | upload_media: sends a picture, video or audio file (up to 10 MB) into your Library and returns a path for a media field of start_generation |
| Gallery and history | search_gallery (find pictures by what they show), organize_gallery (list recent, read one, tag, untag, rate), manage_collections |
| Library and media tools | list_library_items, run_media_tool: trim, crop, resize, rotate, speed and the other media tools, as a new copy or replacing the original |
| Saved prompts | list_prompts, get_prompt, search_model_prompts, add_prompt, edit_prompt, delete_prompt |
| Improve a prompt | enhance_prompt: rewrites a prompt for a model; needs a language model configured on the instance |
| Segments | list_segment_categories, get_saved_segments, get_segment_templates, and create, update and delete for segment categories, saved segments and segment templates |
| Phrasebook | list_phrasebook_categories, get_phrasebook_values, create_phrasebook_category, update_phrasebook_category, delete_phrasebook_category, create_phrasebook_values, update_phrasebook_values, remove_phrasebook_values |
| Prompt variables | list_tab_drafts (your Generate tabs that hold variables), get_prompt_variables, manage_prompt_variables, write_condition. The variable tools need a tab_id from list_tab_drafts; an open tab updates live. |
| Memory | read_memory, write_memory, update_memory, delete_memory: the same notes PotionAI keeps |
| Elixirs | list_elixirs, describe_elixir, run_elixir, get_elixir_run: your own elixirs |
| Sessions | list_sessions: your saved forms, and the details of one |
| Notifications and sharing | list_notifications, mark_notifications_read, list_inspirations, publish_inspiration |
| Deletes | delete_generation, delete_library_item: your own, permanent |
| Administrators only | list_automations, run_automation, get_automation_status, search_provider_models, download_model, get_download_status. These need an administrator’s key that also holds the admin permission. |
Ask, for example, “List my presets that can make video”, “Find pictures in my gallery with a red fox and tag them fox”, or “Start a Krea-2 picture of a glass potion bottle”. The Generate workspace guide shows the calls behind a generation.
Which tools a client sees
Three levels decide it, and each can only narrow the one above.
- The administrator’s ceiling. For the whole instance, either every tool is available or only tools that read. The administrator can then switch individual tools off for everyone.
- Your default. Your own choice of tools for all your keys. It starts read-only: tools that only look at things are on, and tools that change things or spend, such as starting a generation, stay off until you turn them on in Settings.
- The key. One key can switch tools off for itself, so a client can get less than your default. A key can never turn on a tool that is off above it.
The two delete tools are destructive. No policy turns them on by itself, not even all tools on: the administrator switches each one on, then you switch it on in your default. These settings can only be changed from the browser, never with a key, so a connected assistant cannot give itself more tools.
Your MCP client asks you before it calls a tool that changes something. PotionUI does not ask a second time, so a write you approve in the client runs at once, including replacing a Library original with a media tool.
What it cannot do#
- No live Generate form. Tools that read or change the form open in your browser, the Video Director or Music Director document, or run a generation from that form are not offered; ten of the in-app assistant’s tools are in this group.
- No recipes or administration. There are no tools for recipes, users, settings, plugins or backups. Only the automation and model-download tools above reach administrator areas.
- Memory needs a target. Over MCP there is no open preset or model to attach a note to, so a note for a preset, model or mode must name it.