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/mcpnpm 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/mcpThe 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.
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
| Variable | Default | What it does |
|---|---|---|
MUBIT_MANAGEMENT_KEY | none | Your management key. Required. |
MUBIT_MCP_ALLOW_WRITES | off | Set 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=1to theclaude mcp addcommand. - Claude Desktop and Cursor: add
"MUBIT_MCP_ALLOW_WRITES": "1"toenv.
With changes turned on:
- The key's role still applies. Mubit checks it on every call. A
readkey 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 arerevoke_management_key,promote_version,rollback_versionandset_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 can | Tool |
|---|---|
| See your organization | get_org |
| List and open projects | list_projects, get_project |
Keys
| You can | Tool | Needs |
|---|---|---|
| List a project's inference keys | list_keys | read |
| List the provider keys Mubit calls providers with | list_providers | read |
| List management keys | list_management_keys | admin |
| Revoke a management key | revoke_management_key, with confirm: true | admin |
The server can't create or rotate management keys. Create them in the console.
Calls
| You can | Tool | Needs |
|---|---|---|
| List calls, filtered by project, task, model, status and time | search_calls | read |
| Open a call | get_call | read |
| Rate a reply up or down, with a comment or a corrected answer | add_call_feedback | member |
Tasks and trained models
| You can | Tool | Needs |
|---|---|---|
| List tasks | list_tasks | read |
| Open a task: its stage, what it waits for and why | get_task_status | read |
| Read a task's settings | get_task_settings | read |
| List a task's training examples | list_examples | read |
| Train a new version now | retrain_task | admin |
| List a task's versions | list_versions | read |
| Open a version, with its test results | get_version | read |
| Run a version silently beside the current model, or serve it on a share of the calls | set_rollout, with confirm: true | admin |
| Promote a version | promote_version, with confirm: true | admin |
| Roll back to the previous version | rollback_version, with confirm: true | admin |
Lessons, imports, usage and activity
| You can | Tool | Needs |
|---|---|---|
| List and open the lessons Mubit formed | list_lessons, get_lesson | read |
| List imports | list_imports | read |
| See usage: calls and tokens | get_usage | read |
| See your balance and credit | get_billing | read |
| Read a project's activity | list_activity | read |
| Read a long-running job | get_job | read |
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
dataandnext_cursor. To get the next page, the agent passesnext_cursorback ascursor. - 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.