Weights & Biases MCP Server

by wandb

63 stars
311 downloads
Not rated
GitHub

About

The official implementation of the W&B Models and Weave MCP server.

Details

Author
wandb
GitHub stars
63
Downloads
311
Categories
Other

- Query W&B runs, metrics, and experiments via natural language
- Analyze LLM traces with configurable detail levels
- Create reports with charts, markdown, and custom panels
- Search and explore Weave trace schemas
- Compare and inspect artifact versions
- List model registries, collections, and automations
- Proxy W&B documentation search through a single connection

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Weights & Biases MCP Server
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Use the hosted server at https://mcp.withwandb.com with a W&B API key from wandb.ai/authorize. One-click or one-command setup is available for Cursor, Claude Code, OpenAI Codex, and Gemini CLI. Manual configuration is provided for Claude Desktop, VSCode, OpenAI Responses API, and Mistral Chat. For local development, run uvx with the git repository via STDIO.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "weights & biases mcp server": {
            "wandb-mcp-server": {
                "command": "uv",
                "args": [
                    "pip",
                    "install",
                    "git+https://github.com/wandb/wandb-mcp-server"
                ]
            }
        }
    }
}

McpServers

{
    "wandb-mcp-server": {
        "command": "uv",
        "args": [
            "pip",
            "install",
            "git+https://github.com/wandb/wandb-mcp-server"
        ]
    }
}

W&B MCP Server

Query and analyze your Weights & Biases data using natural language through the Model Context Protocol.

CI
Eval
<!-- BEGIN EVAL BADGES -->
SDK
MCP
<!-- END EVAL BADGES -->

<div align="center">
<a href="https://cursor.com/en/install-mcp?name=wandb&config=eyJ0cmFuc3BvcnQiOiJodHRwIiwidXJsIjoiaHR0cHM6Ly9tY3Aud2l0aHdhbmRiLmNvbS9tY3AiLCJoZWFkZXJzIjp7IkF1dGhvcml6YXRpb24iOiJCZWFyZXIge3tXQU5EQl9BUElfS0VZfX0iLCJBY2NlcHQiOiJhcHBsaWNhdGlvbi9qc29uLCB0ZXh0L2V2ZW50LXN0cmVhbSJ9fQ%3D%3D">Cursor</a>
<a href="#claude-desktop">Claude</a>
<a href="#openai">OpenAI</a>
<a href="#gemini-cli">Gemini</a>
<a href="#mistral-lechat">LeChat</a>
<a href="#vscode">VSCode</a>
</div>

---

What Can This Server Do?

<details open>
<summary><strong>Example Use Cases</strong> (click command to copy)</summary>

| Analyze Experiments | Debug Traces | Create Reports | Get Help |
|:---|:---|:---|:---|
| Show me the top 5 runs by eval/accuracy in wandb-smle/hiring-agent-demo-public? | How did the latency of my hiring agent predict traces evolve over the last months? | Generate a wandb report comparing the decisions made by the hiring agent last month | How do I create a leaderboard in Weave - ask SupportBot? |

"Go through the last 100 traces of my last training run in grpo-cuda/axolotl-grpo and tell me why rollout traces of my RL experiment were bad sometimes?"
</details>

<details>
<summary><strong>Available Tools</strong> (16 tools)</summary>

| Tool | Description | Example Query |
|------|-------------|---------------|
| infer_trace_schema_tool | Discover field names, types, and sample values | "What fields are in my traces?" |
| query_weave_traces_tool | Analyze LLM traces with detail_level control | "Show failed traces with full data" |
| count_weave_traces_tool | Count traces and get storage metrics | "How many traces failed?" |
| query_wandb_tool | Query W&B runs, metrics, and experiments | "Show me runs with loss < 0.1" |
| get_run_history_tool | Sampled time-series metric data | "Show loss curve for run abc123" |
| create_wandb_report_tool | Create reports with markdown, charts, and panels | "Create a report with loss plots" |
| log_analysis_to_wandb | Log analysis metrics to W&B as a run | "Log these latency stats to W&B" |
| search_wandb_docs_tool | Search official W&B documentation | "How do I create a Weave scorer?" |
| query_wandb_entity_projects | List projects for an entity | "What projects exist?" |
| list_registries_tool | List model registries in an organization | "What registries are available?" |
| list_registry_collections_tool | List collections within a registry | "What models are in the prod registry?" |
| list_artifact_versions_tool | List versions of an artifact collection | "Show versions of my model artifact" |
| get_artifact_details_tool | Get full details of an artifact version | "What's in model-v2 artifact?" |
| compare_artifact_versions_tool | Diff two artifact versions | "Compare model v1 vs v2" |
| list_wandb_automations_tool | List W&B Automations | "What automations alert on run metrics or status for my team's runs?" |
| list_wandb_integrations_tool | List registered integrations for W&B automations (e.g. Slack, webhook) | "Which Slack channels can my automations target?" |

Schema-first workflow: Call infer_trace_schema_tool first to discover fields, then query_weave_traces_tool with precise columns and detail_level:
- "schema" -- structural fields only (fast browsing)
- "summary" -- truncated inputs/outputs (default)
- "full" -- everything untruncated (drill into specific traces)

Chart panels: create_wandb_report_tool accepts a panels parameter for LinePlots, BarPlots, run comparisons, custom Vega charts, and ordered report layouts. Use panel_grid when multiple charts should share one runset, and use heading plus markdown blocks to interleave narrative sections with charts.

Docs search: search_wandb_docs_tool proxies docs.wandb.ai so you get data tools + documentation search from a single MCP connection. Disable with WANDB_MCP_PROXY_DOCS=false if you connect the docs MCP separately.

</details>

<details>
<summary><strong>Usage Tips</strong> (best practices)</summary>

→ Provide your W&B project and entity name
LLMs are not mind readers, ensure you specify the W&B Entity and W&B Project to the LLM.

→ Avoid asking overly broad questions
Questions such as "what is my best evaluation?" are probably overly broad and you'll get to an answer faster by refining your question to be more specific such as: "what eval had the highest f1 score?"

→ Ensure all data was retrieved
When asking broad, general questions such as "what are my best performing runs/evaluations?" it's always a good idea to ask the LLM to check that it retrieved all the available runs. The MCP tools are designed to fetch the correct amount of data, but sometimes there can be a tendency from the LLMs to only retrieve the latest runs or the last N runs.

</details>

---

Quick Start

We recommend using our hosted server at https://mcp.withwandb.com - no installation required! <br>

> 🔑 Get your API key from wandb.ai/authorize <br>

> 🌐 To connect to a W&B Dedicated / On-Prem Instance currently only the local MCP configuration can be used with an additional WANDB_BASE_URL env variable (the default is api.wandb.ai)

Cursor

<details> <summary>One-click installation</summary>

Click on the button above to automatically add the config to Cursor
Then add your WANDB_API_KEY in the respective field Bearer YOUR_API_KEY and connect

For manual or local installation, see Option 2 below.
</details>

OpenAI Response API

<details> <summary>Python client setup</summary>
from openai import OpenAI
import os

client = OpenAI()

resp = client.responses.create(
model="gpt-4o",
tools=[{
"type": "mcp",
"server_url": "https://mcp.withwandb.com/mcp",
"authorization": os.getenv('WANDB_API_KEY'),
"server_label": "WandB_MCP",
}],
input="How many traces are in my project?"
)
print(resp.output_text)

> Note: OpenAI's MCP is server-side, so localhost URLs won't work. For local servers, see Option 2 with ngrok.
</details>

Claude Code

<details> <summary>One-command installation</summary>
# run in terminal
claude mcp add --transport http wandb https://mcp.withwandb.com/mcp --scope user --header "Authorization: Bearer <your-api-key-here>"

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.