Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content
SDKs and tools

MCP server

@mubit-ai/mcp is for developers who want an AI agent, such as Claude Code, Claude Desktop or Cursor, to look after Mubit for them. You ask in plain words, and the agent calls the server's tools. This page covers version 1.0.1.

Which of my tasks are ready to serve, and why is the triage task still waiting?
Look at the last 20 calls, and rate the wrong answers down.
Serve the newest version of the triage task on 10% of its calls.

The server uses the management API, the same one the SDKs and the command line use. By default it only reads.

Install

You need Node.js 22.12 or newer. You don't start the server yourself: your MCP client starts it with this command, after you add it as shown under Set up.

npx -y @mubit-ai/mcp

npm install -g @mubit-ai/mcp installs the same server as the mubit-mcp command. The server talks to its client over standard input and output.

Your key

The server uses a management key, which starts with mwm_. It doesn't use inference keys, which are for sending model calls through Mubit. SDKs and tools shows how to create a management key and what each role can do. The role of the key limits what the agent can do, whatever the tools offer.

The server reads the key from MUBIT_MANAGEMENT_KEY. If the variable isn't set, the server still starts, and each tool answers with an error that names the variable.

Set up

Claude Code

export MUBIT_MANAGEMENT_KEY=<your management key>
claude mcp add mubit -e MUBIT_MANAGEMENT_KEY="$MUBIT_MANAGEMENT_KEY" -- npx -y @mubit-ai/mcp

The server is then available in the current project. Add --scope user to make it available in every project.

Claude Desktop

In Claude Desktop, open Settings, then Developer, then Edit Config. This opens claude_desktop_config.json (on macOS in ~/Library/Application Support/Claude/, on Windows in %APPDATA%\Claude\). Add the server:

{
  "mcpServers": {
    "mubit": {
      "command": "npx",
      "args": ["-y", "@mubit-ai/mcp"],
      "env": {
        "MUBIT_MANAGEMENT_KEY": "<your management key>"
      }
    }
  }
}

Then quit and restart Claude Desktop.

Cursor

Add the same mcpServers block to .cursor/mcp.json in your project, or to ~/.cursor/mcp.json to use the server in every project.

Other MCP clients

Use the same command (npx), arguments (-y @mubit-ai/mcp) and environment variable (MUBIT_MANAGEMENT_KEY) in the client's server settings.

⚠️Warning

A key in a config file that you commit is a leaked key. Keep project-level config files that hold a key out of version control, or set the key in your shell and let the client pass it on, as the Claude Code command above does.

Settings

VariableDefaultWhat it does
MUBIT_MANAGEMENT_KEYnoneYour management key. Required.
MUBIT_MCP_ALLOW_WRITESoffSet to 1 to turn on the tools that change things. See the next section.

Reading and changing

By default your agent can only read. The tools that change something stay hidden until you set MUBIT_MCP_ALLOW_WRITES=1:

  • Claude Code: add -e MUBIT_MCP_ALLOW_WRITES=1 to the claude mcp add command.
  • Claude Desktop and Cursor: add "MUBIT_MCP_ALLOW_WRITES": "1" to env.

With changes turned on:

  • The key's role still applies. Mubit checks it on every call. A read key can't change anything.
  • Some tools ask for confirmation. A tool that revokes a key, promotes a version, rolls one back, or changes how much traffic a version serves runs only when the call also passes confirm: true. Without it, the tool changes nothing and answers with an error that says so. These tools are revoke_management_key, promote_version, rollback_version and set_rollout.

Tools

The tools below are the ones that work today. The tools that read are always available. The tools that change something need MUBIT_MCP_ALLOW_WRITES=1, and the role in the last column.

Organization and projects

You canTool
See your organizationget_org
List and open projectslist_projects, get_project

Keys

You canToolNeeds
List a project's inference keyslist_keysread
List the provider keys Mubit calls providers withlist_providersread
List management keyslist_management_keysadmin
Revoke a management keyrevoke_management_key, with confirm: trueadmin

The server can't create or rotate management keys. Create them in the console.

Calls

You canToolNeeds
List calls, filtered by project, task, model, status and timesearch_callsread
Open a callget_callread
Rate a reply up or down, with a comment or a corrected answeradd_call_feedbackmember

Tasks and trained models

You canToolNeeds
List taskslist_tasksread
Open a task: its stage, what it waits for and whyget_task_statusread
Read a task's settingsget_task_settingsread
List a task's training exampleslist_examplesread
Train a new version nowretrain_taskadmin
List a task's versionslist_versionsread
Open a version, with its test resultsget_versionread
Run a version silently beside the current model, or serve it on a share of the callsset_rollout, with confirm: trueadmin
Promote a versionpromote_version, with confirm: trueadmin
Roll back to the previous versionrollback_version, with confirm: trueadmin

Lessons, imports, usage and activity

You canToolNeeds
List and open the lessons Mubit formedlist_lessons, get_lessonread
List importslist_importsread
See usage: calls and tokensget_usageread
See your balance and creditget_billingread
Read a project's activitylist_activityread
Read a long-running jobget_jobread

Answers, pages and errors

  • Answers are the API's JSON. The server wraps each answer from Mubit in [UNTRUSTED CONTENT] and [/UNTRUSTED CONTENT]. Calls, examples and lessons hold text that people, other agents and recorded traffic wrote: it is data, not instructions.
  • Lists come in pages. A list tool answers with one page, as data and next_cursor. To get the next page, the agent passes next_cursor back as cursor.
  • Errors say what went wrong. When Mubit refuses a call, the tool answers with an error that starts with the HTTP status and Mubit's error code in brackets, followed by the message.

Related

  • SDKs and tools: the keys, and the other tools.
  • Manage Mubit: every operation in all four tools.
  • Claude Code: send Claude Code's own model calls through Mubit. That is a different job from this server, which lets Claude Code manage Mubit.