Weights & Biases
STDIOWeights & Biases数据查询分析可视化服务
Weights & Biases数据查询分析可视化服务
Query and analyze your Weights & Biases data using natural language through the Model Context Protocol.
| 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? |
New tools for auto-clustering coming soon:
"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?"
| Tool | Description | Example Query |
|---|---|---|
| query_wandb_tool | Query W&B runs, metrics, and experiments | "Show me runs with loss < 0.1" |
| query_weave_traces_tool | Analyze LLM traces and evaluations | "What's the average latency?" |
| count_weave_traces_tool | Count traces and get storage metrics | "How many traces failed?" |
| create_wandb_report_tool | Create W&B reports programmatically | "Create a performance report" |
| query_wandb_entity_projects | List projects for an entity | "What projects exist?" |
| query_wandb_support_bot | Get help from W&B documentation | "How do I use sweeps?" |
→ 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.
We recommend using our hosted server at https://mcp.withwandb.com - no installation required!
🔑 Get your API key from wandb.ai/authorize
⌘, or Ctrl,)wandbhttps://mcp.withwandb.com/mcpFor local installation, see Option 2 below.
Add to your Claude config file:
# macOS open ~/Library/Application\ Support/Claude/claude_desktop_config.json # Windows notepad %APPDATA%\Claude\claude_desktop_config.json
{ "mcpServers": { "wandb": { "url": "https://mcp.withwandb.com/mcp", "apiKey": "YOUR_WANDB_API_KEY" } } }
Restart Claude Desktop to activate.
For local installation, see Option 2 below.
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'), }], 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.
# Set your API key export WANDB_API_KEY="your-api-key-here" # Install the extension gemini extensions install https://github.com/wandb/wandb-mcp-server
The extension will use the configuration from gemini-extension.json pointing to the hosted server.
For local installation, see Option 2 below.
In LeChat settings, add an MCP server:
https://mcp.withwandb.com/mcpFor local installation, see Option 2 below.
# Open settings code ~/.config/Code/User/settings.json
{ "mcp.servers": { "wandb": { "url": "https://mcp.withwandb.com/mcp", "headers": { "Authorization": "Bearer YOUR_WANDB_API_KEY" } } } }
For local installation, see Option 2 below.
The hosted server provides a zero-configuration experience with enterprise-grade reliability. This server is maintained by the W&B team, automatically updated with new features, and scales to handle any workload. Perfect for teams and production use cases where you want to focus on your ML work rather than infrastructure.
The easiest way is using our hosted server at https://mcp.withwandb.com.
Benefits:
Simply use the configurations shown in Quick Start.
Run the MCP server locally for development, testing, or when you need full control over your data. The local server runs directly on your machine with STDIO transport for desktop clients or HTTP transport for web-based clients. Ideal for developers who want to customize the server or work in air-gapped environments.
Add to your MCP client config:
{ "mcpServers": { "wandb": { "command": "uvx", "args": [ "--from", "git+https://github.com/wandb/wandb-mcp-server", "wandb_mcp_server" ], "env": { "WANDB_API_KEY": "YOUR_API_KEY" } } } }
# Install uv (if not already installed) curl -LsSf https://astral.sh/uv/install.sh | sh
# Using uv (recommended) uv pip install wandb-mcp-server # Or from GitHub pip install git+https://github.com/wandb/wandb-mcp-server
Enable the server for a specific project:
uvx --from git+https://github.com/wandb/wandb-mcp-server add_to_client --config_path .cursor/mcp.json && uvx wandb login
Enable the server for all Cursor projects:
uvx --from git+https://github.com/wandb/wandb-mcp-server add_to_client --config_path ~/.cursor/mcp.json && uvx wandb login
uvx --from git+https://github.com/wandb/wandb-mcp-server add_to_client --config_path ~/.codeium/windsurf/mcp_config.json && uvx wandb login
claude mcp add wandb -- uvx --from git+https://github.com/wandb/wandb-mcp-server wandb_mcp_server && uvx wandb login
With API key:
claude mcp add wandb -e WANDB_API_KEY=your-api-key -- uvx --from git+https://github.com/wandb/wandb-mcp-server wandb_mcp_server
uvx --from git+https://github.com/wandb/wandb-mcp-server add_to_client --config_path "~/Library/Application Support/Claude/claude_desktop_config.json" && uvx wandb login
For clients like OpenAI and LeChat that require public URLs:
# 1. Start HTTP server uvx wandb-mcp-server --transport http --port 8080 # 2. Expose with ngrok ngrok http 8080 # 3. Use the ngrok URL in your client configuration
Note: These utilities are inspired by the OpenMCP Server Registry add-to-client pattern.
Deploy your own W&B MCP server for team-wide access or custom infrastructure requirements. This option gives you complete control over deployment, security, and scaling while maintaining compatibility with all MCP clients. Perfect for organizations that need on-premises deployment or want to integrate with existing infrastructure.
docker run -p 7860:7860 \ -e WANDB_API_KEY=your-server-key \ ghcr.io/wandb/wandb-mcp-server
# Clone repository git clone https://github.com/wandb/wandb-mcp-server cd wandb-mcp-server # Install and run uv pip install -r requirements.txt uv run app.py
WANDB_API_KEY as secret (optional)Server URL: https://YOUR-SPACE.hf.space/mcp
from openai import OpenAI from dotenv import load_dotenv import os load_dotenv() client = OpenAI() resp = client.responses.create( model="gpt-4o", # Use gpt-4o for larger context window tools=[ { "type": "mcp", "server_label": "wandb", "server_description": "Query W&B data", "server_url": "https://mcp.withwandb.com/mcp", "authorization": os.getenv('WANDB_API_KEY'), "require_approval": "never", }, ], input="How many traces are in wandb-smle/hiring-agent-demo-public?", ) print(resp.output_text)