mcp-server
by: wandb
A collection of MCP (Model Context Protocol) tools and examples for wandb and weave
📌Overview
Purpose: To provide a Model Context Protocol (MCP) server for querying Weights & Biases Weave traces and generating reports.
Overview: The Weights & Biases MCP Server enables users to access Weave traces and produce insightful reports by allowing interaction through a designated MCP client. It streamlines the process of data querying and visualization, serving as a bridge between complex analytics and user-friendly outputs.
Key Features:
-
Query Weave Traces Tool: Offers advanced filtering, sorting, and pagination for querying Weave traces, allowing users to retrieve complete trace data or just metadata, addressing limitations of LLM context windows.
-
Count Weave Traces Tool: Efficiently counts Weave traces based on specified filters, providing both total and root trace counts to inform users about project scope prior to detailed querying.
-
Create W&B Report Tool: Facilitates the creation of detailed W&B Reports with markdown text and visualizations, allowing for a documented analysis of findings that can be easily shared.
how many openai.chat traces in the wandb-applied-ai-team/mcp-tests weave project? plot the most recent 5 traces over time and save to a report
## Installation
```bash
git clone https://github.com/wandb/mcp-server.git
cd mcp-server && uv venv && source .venv/bin/activate
uv pip install -e .
Configuration
Create a .env
file in the root directory with your Weights & Biases API key:
WANDB_API_KEY=your_api_key_here
Running the Server
Run the server using:
uv run src/mcp_server/server.py
Client Setup
Claude Desktop
Example configuration:
"mcpServers": {
"weights_and_biases": {
"command": "uv",
"args": [
"--directory",
"/ABSOLUTE/PATH/TO/PROJECT",
"run",
"src/mcp_server/server.py"
]
}
}
TODOs
- Add W&B Models data
- Convert to run with npx
- Make more configurable: specify wandb URL
- Improve reports plots prompt for consistent visualizations
- Explore authentication solutions
Troubleshooting
Error: spawn uv ENOENT
If you see the error:
Error: spawn uv ENOENT
This means the uv
package manager cannot be found.
Fix:
-
Install
uv
using the official script:curl -LsSf https://astral.sh/uv/install.sh | sh
-
If the error persists, create a symlink:
sudo ln -s ~/.local/bin/uv /usr/local/bin/uv