
The MozOut MCP server gives your coding agent new tools: generate images, videos and voice, ask another model and check the balance, without leaving the chat. On this page:
- What it is and the endpoint: What the MCP does and where the agent connects.
- Before you start: The key, the permissions and the environment variable.
- Claude Code, Codex, Cursor, Cline and Windsurf: The setup of each tool.
- Claude Code without a key and ChatGPT: Sign in with your account, through OAuth, without pasting a key.
- The tools and example prompts: What the agent can do and how to ask it.
- Cost, Sandbox and Errors: Credits, free tests and what to do when something fails.
- Skill for Claude Code: A package that teaches Claude Code to use our API.
What it is
MCP (Model Context Protocol) is the common way for AI tools to use outside services. Once your agent is connected to our server, just ask in plain language, for example "generate an image for the home page", and the agent picks the right tool, sends the request and shows you the result.
- It works with any agent model: Claude Code, Codex or Cursor keep the model they already use, and our server does the generations.
- It uses the same API key and the same AI credits, or your Coding Plan, for the text models that are in the plan.
- Everything the MCP does goes through the AI API, with the same prices, limits and rules.
The endpoint
The MCP server lives at the same address as the API, on the /mcp path:
https://api.mozout.co.mz/mcp- The transport is Streamable HTTP, the remote MCP transport: there is no program to install.
- There are two ways in: the API key in the
Authorization: Bearerheader (we also acceptx-api-key), or your account, through OAuth, without a key, as in ChatGPT. - In the examples, the server is named
mozout-ai. You can give it another name: it is only the name the agent shows.
Before you start
- Create a key in the API Center with the
ai:readandai:writepermissions. With a key that only hasai:read, the agent sees the models, the generations and the balance, but cannot generate or chat. See Permissions. - Have AI credits or an active Coding Plan in All in One AI.
- Keep the key in an environment variable, so it is not written in the configuration files:
export MOZOUT_API_KEY="prod_..."To have the variable in every new terminal, add this line to ~/.bashrc or ~/.zshrc. On Windows, use setx MOZOUT_API_KEY "prod_..." and open a new terminal. It is the same variable as on the Coding tools page.
If you sign in with your account, through OAuth, you need neither the key nor the variable: step 2 is enough. See Claude Code without a key and ChatGPT.
Claude Code
Add the server with a single command, in the terminal:
claude mcp add --transport http --scope user mozout-ai https://api.mozout.co.mz/mcp \
--header "Authorization: Bearer $MOZOUT_API_KEY"--scope usermakes the server available in all your projects. Without it, it stays only in the project of the current folder.- The terminal replaces
$MOZOUT_API_KEYwith the key before running the command, so the key is saved in~/.claude.json, only on your computer. - Check with
claude mcp listor, inside Claude Code, with/mcp: the server should show as connected.
To share the setup with your team without sharing the key, create a .mcp.json at the project root. Claude Code replaces ${MOZOUT_API_KEY} with the value of each person's variable:
{
"mcpServers": {
"mozout-ai": {
"type": "http",
"url": "https://api.mozout.co.mz/mcp",
"headers": { "Authorization": "Bearer ${MOZOUT_API_KEY}" }
}
}
}Do not use ${ANTHROPIC_AUTH_TOKEN} or ${ANTHROPIC_API_KEY} in this header: Claude Code reads these variables as empty for MCP servers. Use MOZOUT_API_KEY, even if it holds the same key.
Claude Code without a key
Claude Code can also sign in with your MozOut account, through OAuth, with no key or variable. Add the server without the header:
claude mcp add --transport http --scope user mozout-ai https://api.mozout.co.mz/mcp- Open Claude Code and type
/mcp. The server shows as needing authentication (needs authentication). - Choose the server and then Authenticate. The browser opens the Meu MozOut sign-in page.
- Sign in with your account and click Allow on the authorization screen. The browser goes back to Claude Code and the server is active.
- Claude Code keeps the access on your computer and renews it on its own. There is no key to copy, keep or rotate.
- It spends the credits or the plan of the account you signed in with, like the API. See Cost and limits.
- To sign out, choose the server in
/mcpand Clear authentication, or revoke access in All in One AI. - The key still works as before: the command with
--headerin the previous section does not change.
Codex
Add the server to ~/.codex/config.toml:
[mcp_servers.mozout-ai]
url = "https://api.mozout.co.mz/mcp"
bearer_token_env_var = "MOZOUT_API_KEY"
tool_timeout_sec = 120bearer_token_env_varis the name of the variable with the key: Codex reads it and sends it inAuthorization: Bearer.tool_timeout_secgives time to the generation tools, which wait up to about 50 seconds for the result. Without it, Codex gives up after 60 seconds.- Check with
codex mcp listor, inside Codex, with/mcp.
Cursor
Create ~/.cursor/mcp.json (for all projects) or the project's .cursor/mcp.json:
{
"mcpServers": {
"mozout-ai": {
"url": "https://api.mozout.co.mz/mcp",
"headers": { "Authorization": "Bearer ${env:MOZOUT_API_KEY}" }
}
}
}- Cursor replaces
${env:MOZOUT_API_KEY}with the value of the environment variable. Set it in your shell profile or in the system variables and open Cursor again. - Check in the list of MCP servers in the Cursor settings that the server is enabled and that the tools show up.
Cline
- Click the MCP Servers icon in the top bar of Cline.
- In the Configure tab, click Configure MCP Servers, which opens
cline_mcp_settings.json. - Add the server inside
mcpServers, with your key:
{
"mcpServers": {
"mozout-ai": {
"type": "streamableHttp",
"url": "https://api.mozout.co.mz/mcp",
"headers": { "Authorization": "Bearer prod_..." },
"disabled": false,
"autoApprove": []
}
}
}typemust bestreamableHttp. Without it, Cline uses the old transport (SSE) and does not connect.- Leave
autoApproveempty so Cline asks before each generation, which spends credits.
Windsurf
- In the Cascade panel, open the MCP menu and choose Open MCP config file, which opens
mcp_config.json. - Add the server inside
mcpServers:
{
"mcpServers": {
"mozout-ai": {
"serverUrl": "https://api.mozout.co.mz/mcp",
"headers": { "Authorization": "Bearer ${env:MOZOUT_API_KEY}" }
}
}
}- Save the file and click the refresh button in the list of MCP servers.
Windsurf replaces ${env:MOZOUT_API_KEY} with the value of the variable. On team plans, remote servers only show up after an admin allows them.
ChatGPT
ChatGPT adds remote MCP servers as custom connectors, which now show up as plugins, and signs in with your MozOut account through OAuth. It does not use the API key.
- In ChatGPT on the web, open Plugins (
chatgpt.com/plugins), click the + button and choose Add custom MCP server. You no longer need to turn on Developer mode. - Give it a name, for example
MozOut, and a description, if you want. - Under Connection, enter
https://api.mozout.co.mz/mcpin the Server URL field. - For authentication, choose OAuth. You need no Client ID or secret: ChatGPT registers itself with our server.
- Read the risk warning, click I understand and want to continue and then Create as a plugin.
- Install the plugin. ChatGPT opens the Meu MozOut sign-in page: sign in with your account and click Allow on the authorization screen.
In a chat, type @ and pick the plugin, or name it in your request. The tools that only read (list_models, get_model, get_generation and get_balance) run at once. The ones that generate or chat (generate_* and chat) spend credits, so ChatGPT asks you to confirm each one.
The authorization screen
In ChatGPT, Claude Code or any other client, you always authorize in Meu MozOut, and the app never sees your password or your keys:
- If you are not signed in yet, you sign in with your account first and come back to the screen. Only the account owner can authorize, and the All in One AI account must be active.
- The screen shows the app name, given by the app itself, your account and the address it returns to, for example
chatgpt.com. For a client that runs on your computer, such as Claude Code, it warns that it returns tolocalhost. - It also shows the permissions the app asks for: See models, balance and requests (
ai:read) and Make AI requests (ai:write), which generates text, images, videos and audio and spends credits. - Click Allow only if you know the app and the address. Deny goes back to the app without giving it access.
Cost and limits
- Requests spend the AI credits or the Coding Plan points of the account that authorized, at the same prices as the API, and show up in the All in One AI history.
- They are always production: to test at no cost, use a
sandbox_key in the header, as in Sandbox. - The limit of 90 requests per minute counts for the whole account, adding up all the authorized apps.
- OAuth only serves the MCP server, at
https://api.mozout.co.mz/mcp. The rest of the API still needs a key, and the key still works on the MCP, in the header, as before. - Access lasts one hour and the app renews it on its own. If you do not use it for 30 days, you have to authorize it again.
- In ChatGPT, whether you can add MCP servers, and what they can do, depends on the plan and on the workspace rules. In company accounts, it may be for admins only.
Revoke access
Open All in One AI, on the History tab, and look for the Connected apps block. It lists the apps you authorized, with the date of the authorization and of the last use. Revoke access cuts that app's access at once: to use it again, you have to authorize it again. To be sure the app can no longer get in, use Revoke access even if you already deleted the plugin in ChatGPT.
Other tools
Any MCP client that accepts a remote Streamable HTTP server with headers works the same way: enter the https://api.mozout.co.mz/mcp address and the Authorization: Bearer header with your key. Clients that sign in through OAuth only need the address: they open the authorization screen on their own.
With the aio command
If you have the aio command installed, aio mcp install claude, aio mcp install codex or aio mcp install cursor shows the setup for each tool, already with the address and the mozout-ai name. For Claude Code, it also adds the server for you, if you confirm. See MCP in aio.
The tools
The agent sees these tools, with the description and fields of each one, and picks which one to use on its own:
| Tool | What it does | Fields |
|---|---|---|
list_models | Lists the models, with the id, the name and the price in credits. | type (text, image, video, audio or agent), q and limit, all optional. |
get_model | Shows the fields that an image, video or voice model accepts. | id |
generate_image | Generates an image from a description. | prompt and, if you want, model and options. |
generate_video | Generates a video from a description or from an image. | prompt and, if you want, model, image_url and options. |
generate_audio | Generates voice or sound from a text. | text or prompt and, if you want, model and options. |
get_generation | Shows the status of a generation and the links to the files. | id |
chat | Asks a question to another text model or to one of your agents. | model, messages or prompt and, if you want, system and max_tokens. |
web_search | Searches the web and returns the top results, with the title, the link and a summary. | query |
get_balance | Shows the AI credits and, with a Coding Plan, the points left. | None. |
- Without
model, the generation tools use a default model of ours, good and cheap. To choose another, ask for it by name or by theidfromlist_models. optionsholds the model's own fields, such as the image size or the video length. The agent sees them withget_model.
Images, videos and voice
- Each
generate_*sends the request and waits up to about 50 seconds. If the generation finishes, it returns the links to the files and, for an image up to 1 MB, also the image itself, which the agent can see. - If it does not finish in time, as happens with many videos, it returns the generation
id. The agent checks it later withget_generation, or you can ask it "check if the video is ready". - The generation keeps running on the server even if the agent stops waiting, and it is charged when it finishes.
- The links to the files are not permanent: ask the agent to download them into the project.
Example prompts
Write to the agent as you would write to a person. Some examples:
- "Which video models do you have and how much does each second cost?"
- "Generate a square image of a modern office with plants and morning light, and save it to
public/img/hero.png." - "Make a 5-second 720p video of a drone flying over a city at sunset."
- "Animate this image for 5 seconds:
https://www.example.com/photo.jpg" - "Read this text aloud and save the audio to
audio/welcome.mp3: Thank you for contacting us." - "Ask
deepseek-ai/deepseek-v4-flashhow to sum up this error in one sentence." - "How many AI credits do I have left?"
Cost
list_models,get_model,get_generationandget_balancecost nothing.- Generations are paid with credits, at the model price in
list_models: per image, per second of video or per generation. We reserve the credits on the request, charge the real cost at the end and return the rest. A generation that fails costs nothing. chatpays the tokens at the model price, as in How chat is charged. With a Coding Plan, the models in the plan spend points instead of credits.- Each
web_searchcosts 0.5 credits. A search that fails costs nothing. - Before a long video or many images, ask the agent for the price with
list_modelsand the balance withget_balance.
Each tool call counts towards the key's limit of 90 requests per minute and shows up in the All in One AI history.
Sandbox
With a sandbox_ key, the MCP server answers in the same format, but calls no model and charges nothing:
chatalways answersResposta de teste (sandbox).- A generation is ready at once, with a sample link and
0credits. - The model list, the prices and the balance are the real ones.
Use it to check the connection and the tool setup. Then switch it to the prod_ key. See Sandbox and Production.
Errors
An authentication error stops the connection: the server answers 401 with a JSON-RPC error (code -32001), and the agent shows the server as disconnected or failed. The other errors come back as the tool result, flagged with isError, and with a clear message, which the agent reads and explains to you:
| Situation | What to do |
|---|---|
The key is missing, wrong or revoked (401). | Check the key and the header, and open the agent again after setting the variable. |
The OAuth access was revoked or is no longer valid (401). | Authorize again: in Claude Code, in /mcp; in ChatGPT, in the plugin settings. |
The key does not have ai:read or ai:write. | Create a key with both permissions. |
| The credits are not enough for the reservation. | Buy credits in All in One AI or choose a cheaper model. |
| The model does not exist or is not of the right type. | Ask the agent to look up the id with list_models. |
| The All in One AI account is not active. | Open All in One AI and check the account status. |
| The Coding Plan points ran out and the request cannot be paid with credits. | Wait for the reset or turn on "Use credits when the plan runs out". |
| You went over the requests per minute limit. | Wait a little: the agent can repeat the request. |
| The AI service did not respond as expected. | Try again in a little while or choose another model. |
The full list of codes is in Errors.
Skill for Claude Code
A skill is a folder with a SKILL.md instructions file that Claude Code reads when the request is about it. Our skill teaches Claude Code to use the MozOut AI API: choose models, chat with other models, generate and follow images, videos and voice, check the balance and use the MCP server, always with the key in the MOZOUT_API_KEY variable.
Install
Unzip the file into the personal skills folder, ~/.claude/skills/, to have it in all projects:
mkdir -p ~/.claude/skills
curl -fsSLO "https://docs.mozout.co.mz/assets/skill/mozout-ai.zip"
unzip -o mozout-ai.zip -d ~/.claude/skills/- It ends up in
~/.claude/skills/mozout-ai/SKILL.md. To have it in one project only, unzip it into.claude/skills/, at the project root. - On Windows, use
Expand-Archive mozout-ai.zip -DestinationPath $HOME\.claude\skillsin PowerShell. - If Claude Code was already open and the
~/.claude/skillsfolder did not exist yet, run/reload-skills.
Use
Claude Code uses the skill on its own when the request is about generating images, videos or voice, other models or AI credits. You can also call it by name, with /mozout-ai. The skill prefers the MCP server tools, when they are connected, and uses the API directly when they are not. Before generating videos or many images, it shows the price and asks you to confirm.