MCP server

Moth DocsGuides

Moth's MCP server puts every Moth model inside AI apps that speak MCP, such as Claude Code, Cursor, VS Code and Windsurf, on one API key.

The server lives at https://api.runmoth.si/mcp. An app adds it by that address with one of your API keys, and every model call it makes is billed and logged like any other call on that key, with the key's cap and model list in force. The server itself costs nothing.

Add it to your app

Moth Console shows the command under Settings, ready to copy. Make a key under Keys first.

The MCP server card in Moth Console's Settings, marked Live, with the one-line Claude Code command to copy
The MCP server in Moth Console's Settings, with the command to copy.

Claude Code adds it in one command. Put your key in MOTH_API_KEY first, or paste it in place.

bash
claude mcp add --transport http moth https://api.runmoth.si/mcp \
  --header "Authorization: Bearer $MOTH_API_KEY"
A terminal where claude mcp add adds the HTTP MCP server moth at api.runmoth.si/mcp, with the Authorization header shown as REDACTED
Claude Code adds the server and hides the key in its own output.

claude mcp list checks it. Moth shows as connected once the key is accepted.

A terminal where claude mcp list, filtered to moth, shows moth at api.runmoth.si/mcp over HTTP as Connected
Moth listed as connected in Claude Code.

Cursor reads ~/.cursor/mcp.json, and Windsurf and most other apps take the same shape in their MCP settings.

json
{
  "mcpServers": {
    "moth": {
      "url": "https://api.runmoth.si/mcp",
      "headers": { "Authorization": "Bearer moth_..." }
    }
  }
}

VS Code reads .vscode/mcp.json in a project, with the server's type set to http.

json
{
  "servers": {
    "moth": {
      "type": "http",
      "url": "https://api.runmoth.si/mcp",
      "headers": { "Authorization": "Bearer moth_..." }
    }
  }
}

Apps that sign in with OAuth. Some apps add remote servers only through an OAuth sign-in, such as the Claude.ai and ChatGPT web apps. Moth's server takes an API key, so add it in an app that takes a server address with a header.

The tools

ToolWhat it does
list_modelsLists the models the key can reach, with each one's maker, kind, Moth's price and the list price
ask_modelSends a prompt to any chat model and returns the reply, the tokens and what it cost
generate_imageMakes a picture and returns it with a download link, or a job id if it takes longer than about a minute and a half
start_videoStarts a video clip and returns its job id and the price held
start_songStarts a song and returns its job id and the price held
check_jobReads a job's status, and once it is done, its download links
get_balanceReads the account's balance, the key's cap and what it has spent against it

Ask for it in plain words in the app's chat, and name Moth so the app reaches for these tools. Asking Claude Code to get a second opinion from GPT 6.2 Sol through moth runs ask_model, and the reply comes back with what the call cost.

Claude Code after calling moth, quoting gpt-6.2-sol's two-line answer about deleting a SQLite WAL file, then adding its own correction and that the call cost $0.0011
A second opinion from GPT 6.2 Sol inside Claude Code. The call cost $0.0011.

A tool that can't run, because the key is out of credit, at its cap or not allowed that model, answers with the same plain message the API gives, so the app's model can tell you what to do.

What it costs

Each model call costs that model's price on Moth, the same as calling the API, and the Console's Models page lists them. Pictures, clips and songs hold their price when they start and settle when they finish, as Images, video and music explains. Listing models, checking a job and reading the balance cost nothing.

Downloads

A finished picture, clip or song comes with a download link that works without your key for 24 hours, for that one file only. After that, check_job gives a fresh one.

Privacy

Each model call goes through the Mothpoint like any other, so the model's host sees Moth and never you. The app you add the server to is a different matter. It sees its own conversation, including what Moth's tools send back, under that app's own policy.