# MCP

Use the Interweb MCP in Claude Code, ChatGPT, Codex, Cursor and other tools to ask for images, videos and voice in the chat.

Updated on 17 November 2026

The Interweb 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](https://docs.interweb.ao/en/mcp.md) and [the endpoint](https://docs.interweb.ao/en/mcp.md): What the MCP does and where the agent connects.
- [Before you start](https://docs.interweb.ao/en/mcp.md): The key, the permissions and the environment variable.
- [Claude Code](https://docs.interweb.ao/en/mcp.md), [Codex](https://docs.interweb.ao/en/mcp.md), [Cursor](https://docs.interweb.ao/en/mcp.md), [Cline](https://docs.interweb.ao/en/mcp.md) and [Windsurf](https://docs.interweb.ao/en/mcp.md): The setup of each tool.
- [Claude Code without a key](https://docs.interweb.ao/en/mcp.md) and [ChatGPT](https://docs.interweb.ao/en/mcp.md): Sign in with your account, through OAuth, without pasting a key.
- [The tools](https://docs.interweb.ao/en/mcp.md) and [example prompts](https://docs.interweb.ao/en/mcp.md): What the agent can do and how to ask it.
- [Cost](https://docs.interweb.ao/en/mcp.md), [Sandbox](https://docs.interweb.ao/en/mcp.md) and [Errors](https://docs.interweb.ao/en/mcp.md): Credits, free tests and what to do when something fails.
- [Skill for Claude Code](https://docs.interweb.ao/en/mcp.md): 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](https://docs.interweb.ao/en/ai.md), with the same prices, limits and rules.

## The endpoint

The MCP server lives at the same address as the API, on the `/mcp` path:

```text
https://api.interweb.ao/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: Bearer` header (we also accept `x-api-key`), or your account, through OAuth, without a key, as in [ChatGPT](https://docs.interweb.ao/en/mcp.md).
- In the examples, the server is named `interweb-ai`. You can give it another name: it is only the name the agent shows.

## Before you start

1. Create a key in the [API Center](https://www.meu.interweb.ao/api-center.php?language=english&currency=2) with the `ai:read` and `ai:write` permissions. With a key that only has `ai:read`, the agent sees the models, the generations and the balance, but cannot generate or chat. See [Permissions](https://docs.interweb.ao/en/permissions.md).
2. Have AI credits or an active Coding Plan in [All in One AI](https://www.meu.interweb.ao/all-in-one-ai.php?language=english&currency=2).
3. Keep the key in an environment variable, so it is not written in the configuration files:

```bash
export INTERWEB_API_KEY="prod_..."
```

To have the variable in every new terminal, add this line to `~/.bashrc` or `~/.zshrc`. On Windows, use `setx INTERWEB_API_KEY "prod_..."` and open a new terminal. It is the same variable as on the [Coding tools](https://docs.interweb.ao/en/coding-tools.md) 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](https://docs.interweb.ao/en/mcp.md) and [ChatGPT](https://docs.interweb.ao/en/mcp.md).

## Claude Code

Add the server with a single command, in the terminal:

```bash
claude mcp add --transport http --scope user interweb-ai https://api.interweb.ao/mcp \
  --header "Authorization: Bearer $INTERWEB_API_KEY"
```

- `--scope user` makes the server available in all your projects. Without it, it stays only in the project of the current folder.
- The terminal replaces `$INTERWEB_API_KEY` with the key before running the command, so the key is saved in `~/.claude.json`, only on your computer.
- Check with `claude mcp list` or, 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 `${INTERWEB_API_KEY}` with the value of each person's variable:

```json
{
  "mcpServers": {
    "interweb-ai": {
      "type": "http",
      "url": "https://api.interweb.ao/mcp",
      "headers": { "Authorization": "Bearer ${INTERWEB_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 `INTERWEB_API_KEY`, even if it holds the same key.

## Claude Code without a key

Claude Code can also sign in with your Interweb account, through OAuth, with no key or variable. Add the server without the header:

```bash
claude mcp add --transport http --scope user interweb-ai https://api.interweb.ao/mcp
```

1. Open Claude Code and type `/mcp`. The server shows as needing authentication (needs authentication).
2. Choose the server and then **Authenticate**. The browser opens the Meu Interweb sign-in page.
3. Sign in with your account and click **Allow** on the [authorization screen](https://docs.interweb.ao/en/mcp.md). 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](https://docs.interweb.ao/en/mcp.md).
- To sign out, choose the server in `/mcp` and **Clear authentication**, or [revoke access](https://docs.interweb.ao/en/mcp.md) in All in One AI.
- The key still works as before: the command with `--header` in the previous section does not change.

## Codex

Add the server to `~/.codex/config.toml`:

```toml
[mcp_servers.interweb-ai]
url = "https://api.interweb.ao/mcp"
bearer_token_env_var = "INTERWEB_API_KEY"
tool_timeout_sec = 120
```

- `bearer_token_env_var` is the name of the variable with the key: Codex reads it and sends it in `Authorization: Bearer`.
- `tool_timeout_sec` gives 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 list` or, inside Codex, with `/mcp`.

## Cursor

Create `~/.cursor/mcp.json` (for all projects) or the project's `.cursor/mcp.json`:

```json
{
  "mcpServers": {
    "interweb-ai": {
      "url": "https://api.interweb.ao/mcp",
      "headers": { "Authorization": "Bearer ${env:INTERWEB_API_KEY}" }
    }
  }
}
```

- Cursor replaces `${env:INTERWEB_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

1. Click the **MCP Servers** icon in the top bar of Cline.
2. In the **Configure** tab, click **Configure MCP Servers**, which opens `cline_mcp_settings.json`.
3. Add the server inside `mcpServers`, with your key:

```json
{
  "mcpServers": {
    "interweb-ai": {
      "type": "streamableHttp",
      "url": "https://api.interweb.ao/mcp",
      "headers": { "Authorization": "Bearer prod_..." },
      "disabled": false,
      "autoApprove": []
    }
  }
}
```

- `type` must be `streamableHttp`. Without it, Cline uses the old transport (SSE) and does not connect.
- Leave `autoApprove` empty so Cline asks before each generation, which spends credits.

## Windsurf

1. In the Cascade panel, open the MCP menu and choose **Open MCP config file**, which opens `mcp_config.json`.
2. Add the server inside `mcpServers`:

```json
{
  "mcpServers": {
    "interweb-ai": {
      "serverUrl": "https://api.interweb.ao/mcp",
      "headers": { "Authorization": "Bearer ${env:INTERWEB_API_KEY}" }
    }
  }
}
```

3. Save the file and click the refresh button in the list of MCP servers.

Windsurf replaces `${env:INTERWEB_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 Interweb account through OAuth. It does not use the API key.

1. 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.
2. Give it a name, for example `Interweb`, and a description, if you want.
3. Under **Connection**, enter `https://api.interweb.ao/mcp` in the **Server URL** field.
4. For authentication, choose **OAuth**. You need no Client ID or secret: ChatGPT registers itself with our server.
5. Read the risk warning, click **I understand and want to continue** and then **Create as a plugin**.
6. Install the plugin. ChatGPT opens the Meu Interweb sign-in page: sign in with your account and click **Allow** on the [authorization screen](https://docs.interweb.ao/en/mcp.md).

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 Interweb, 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 to `localhost`.
- 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](https://docs.interweb.ao/en/mcp.md).
- 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.interweb.ao/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](https://www.meu.interweb.ao/all-in-one-ai.php?language=english&currency=2#connected-apps), 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.interweb.ao/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](https://docs.interweb.ao/en/mcp.md) on their own.

## With the aio command

If you have the [aio command](https://docs.interweb.ao/en/cli.md) 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 `interweb-ai` name. For Claude Code, it also adds the server for you, if you confirm. See [MCP in aio](https://docs.interweb.ao/en/cli.md).

## 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`. |
| `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 the `id` from `list_models`.
- `options` holds the model's own fields, such as the image size or the video length. The agent sees them with `get_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 with `get_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-flash` how to sum up this error in one sentence."
- "How many AI credits do I have left?"

## Cost

- `list_models`, `get_model`, `get_generation` and `get_balance` cost 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.
- `chat` pays the tokens at the model price, as in [How chat is charged](https://docs.interweb.ao/en/ai.md). With a Coding Plan, the models in the plan spend points instead of credits.
- Before a long video or many images, ask the agent for the price with `list_models` and the balance with `get_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:

- `chat` always answers `Resposta de teste (sandbox).`
- A generation is ready at once, with a sample link and `0` credits.
- 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](https://docs.interweb.ao/en/api-rules.md).

## 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](https://docs.interweb.ao/en/api-rules.md).

## 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 Interweb 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 `INTERWEB_API_KEY` variable.

- [Download the skill (interweb-ai.zip)](/assets/skill/interweb-ai.zip)
- [View SKILL.md](/assets/skill/interweb-ai/SKILL.md)

### Install

Unzip the file into the personal skills folder, `~/.claude/skills/`, to have it in all projects:

```bash
mkdir -p ~/.claude/skills
curl -fsSLO "https://docs.interweb.ao/assets/skill/interweb-ai.zip"
unzip -o interweb-ai.zip -d ~/.claude/skills/
```

- It ends up in `~/.claude/skills/interweb-ai/SKILL.md`. To have it in one project only, unzip it into `.claude/skills/`, at the project root.
- On Windows, use `Expand-Archive interweb-ai.zip -DestinationPath $HOME\.claude\skills` in PowerShell.
- If Claude Code was already open and the `~/.claude/skills` folder 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 `/interweb-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.
