MCP
MCP is the protocol agents (Claude Code, Claude Desktop, Cursor, Cline, OpenClaw and others) use to plug in external tools. Mixen runs its own MCP server over Streamable HTTP: the agent gets the models directly — ask a text model, generate an image, check the catalog and the balance — without writing a line of integration code.
Connecting
Section titled “Connecting”Authentication uses the same mxn-… key (Keys & authentication); the key’s scopes and rate limits carry over.
Claude Code:
claude mcp add --transport http mixen https://api.mixen.ai/v1/mcp \ --header "Authorization: Bearer mxn-your-key"Cursor (.cursor/mcp.json in the project root; add the file to .gitignore so the key never reaches the repository):
{ "mcpServers": { "mixen": { "type": "http", "url": "https://api.mixen.ai/v1/mcp", "headers": {"Authorization": "Bearer mxn-your-key"} } }}Any other MCP client: URL https://api.mixen.ai/v1/mcp, Streamable HTTP transport, header Authorization: Bearer mxn-….
| Tool | What it does |
|---|---|
mixen_chat |
Ask a text model: model, prompt, optionally system, reasoning_effort, max_tokens, web_search (auto/native/exa) |
mixen_generate_image |
Generate an image — the result arrives as an image the agent can see |
mixen_list_models |
Catalog: ids, types, prices in ₽ |
mixen_get_balance |
Account balance |
mixen_get_topup_link |
Top-up payment link: amount (₽ 10–10000, or $ 1–200 with amount_usd=true), method — tochka/cryptobot/cryptocloud |
mixen_list_transactions |
Recent transactions: date, type, amount, model (limit 1–50, default 10) |
Just tell the agent: “ask mixen what’s new” or “generate a cover via mixen” — it will call the tools on its own. When the balance runs out, the agent checks it with mixen_get_balance, hands you a payment link from mixen_get_topup_link, and reports spending via mixen_list_transactions.
Model cascades: delegation
Section titled “Model cascades: delegation”mixen_chat is a way to reach any model in the catalog from inside one session, even when the leading agent is locked to its own family (Claude Desktop, for one, runs sessions only on Claude models). The “expensive lead + cheap workers” pattern:
- the model is a parameter of every call:
mixen_chatwithz-ai/glm-5.3-flash($0.01 per 1M input) translates and classifies, withdeepseek/deepseek-v4-proit dissects code, withgoogle/gemini-4-argonit reasons; - the list of available models and their prices is not a hardcode:
mixen_list_modelsreturns the live catalog, and the agent can call it and pick a model by price on the fly (“pick anything under $0.02 per 1M input and translate the text”); - to make the agent delegate on its own, without reminders, pin a rule in the project (
CLAUDE.md/AGENTS.md/ workspace rules): “delegate routine tomixen_chatwithz-ai/glm-5.3-flash, images tomixen_generate_image”. A readyCLAUDE.mdgoes to the workspace root (Claude Desktop — the Code tab; globally for all projects —~/.claude/CLAUDE.md):
- Delegate routine text tasks (translation, classification, drafts, ticket triage) to mixen_chat with the model z-ai/glm-5.3-flash — do not answer them yourself.- Generate images via mixen_generate_image with the model recraft/recraft-v4.1-flash.The model in the rule is an ordinary catalog id; swap it for another (say openai/gpt-6-luna for text, black-forest-labs/flux-3-image-klein for images) and the agent obeys from the next session.
Rules + memory + tasks: CLAUDE.md / MEMORY.md / TODO.md
Section titled “Rules + memory + tasks: CLAUDE.md / MEMORY.md / TODO.md”CLAUDE.md is the only file the engine reads by itself; memory and tasks fit nicely in sibling files wired in with @ imports (nesting up to 5 levels). This is the agent host’s mechanism (Claude Code and the Code tab in Claude Desktop), not our MCP’s: in Codex CLI the same trick lands in AGENTS.md, in other clients — in their rules files:
CLAUDE.md
- Delegate routine text tasks (translation, classification, drafts) to mixen_chat with the model z-ai/glm-5.3-flash — do not answer them yourself.- Generate images via mixen_generate_image with the model recraft/recraft-v4.1-flash.- An explicit request in chat (a named model or "answer yourself") always overrides these rules.- Cross out finished items in TODO.md; append new agreements and facts yourself: tasks to TODO.md, knowledge to MEMORY.md.
@MEMORY.md@TODO.mdMEMORY.md — accumulated facts (cross-chat memory: every new chat reads them):
- Flower delivery: Moscow inside the MKAD only, mornings before 11 a.m.; supplier — the Sadovy greenhouse, locally grown flowers only.TODO.md — a living task list:
- [ ] Come up with 5 names for a delivery service- [x] Generate a 1:1 logoDialogues do not carry over between chats — the files are the shared memory. Tell the agent “write to MEMORY.md that …” or “do the first TODO.md item and cross it out” and it edits the files, so the next chat picks up where you left off. Models can be named conversationally too: “let GPT-6 Luna come up with…” — the names are there in mixen_list_models.
Images use the same trick: Claude in a session does not generate pictures itself, while mixen_generate_image returns a result the agent can “see” and use further.
Billing and limits
Section titled “Billing and limits”Usage is billed from the same balance as the bot, the cabinet and the API; charges show up in GET /v1/history (Tokens and billing). The key’s scopes apply (a chat-only key cannot generate images), and so does the shared limit — 120 requests per minute. Errors arrive as tool text: invalid api key, the top-up requirement, the rate-limit message.
Limitations
Section titled “Limitations”- No text streaming over MCP — a protocol limitation, not a backend one: by specification a tool result arrives as a single message and agents do not render partial text (only progress notifications are available). For streaming deltas use SSE
/v1/chat/completions. - Video, music, generation history and file storage are not exposed over MCP — they are available through the HTTP API.