
Query and analyze your Weights & Biases data using natural language through the Model Context Protocol.
Overview
Query and analyze your Weights & Biases data using natural language through the Model Context Protocol.
README
W&B MCP Server
Query and analyze your Weights & Biases data using natural language through the Model Context Protocol.
What’s new in 0.4
- Structured experiment queries and legacy GraphQL inputs work through the same
query_wandb_toolinterface. - Targeted summary/config reads and sparse multi-key history make it easier to work with large experiments without loading every field.
- Explicit tool profiles, read-only mode, and bounded responses let you choose the capabilities appropriate for your installation.
- HTTP session recovery, input validation, and offline token counting are more robust. Tool telemetry excludes raw arguments and API keys; see the privacy guidance before enabling verbose logging.
The current 0.4.3 candidate restores W&B username attribution in analytics,
adds the optional DOCS_MCP_URL override for self-hosted docs search, keeps
every tool description under 4,000 characters with ARIA’s query and counting
rules folded in, and requires mcp 1.30.0 or newer. See the
v0.4.3 release note for its current qualification
state and the release index for earlier 0.4 versions.
Release availability
Public source, W&B-hosted images, customer images, and installation artifacts advance independently. Use only immutable evidence recorded in the release index; a version string or mutable container tag does not prove that another channel is available or qualified.
Explore Agent Lens through MCP
Use this server to query data already recorded in Agent Lens. To start recording Claude Code, Codex, another harness, or an application, first follow the Agent Lens integration guide.
Check the tools advertised by your connection. Agent span tools expose conversations, turns, model calls, and tools. Insights, tag, and instrumentation tools require the explicit Agent Lens profile described in Agent Lens tools; managed dedicated deployments reject that profile. Source availability does not establish availability in a particular release channel; check the release index above.
When the corresponding tools are advertised, try:
- “In my-team/my-project, find conversations mentioning refunds and show one complete conversation.”
- “Check the Insights classification coverage before summarizing the most common failure categories. Include example turn IDs and the covered time range.”
- “List the available tags, then show a bounded sample of conversations for one tag.”
- “Run my app, check instrumentation for the latest conversation, fix the first must-fix issue, and repeat until it is clean.”
Open recorded conversations at https://forge.coreweave.com/agent-lens//.
Connecting MCP does not install a tracing plugin or enable automatic capture of
the coding agent’s own sessions.
What Can This Server Do?
Quick Start
We recommend using our hosted server at https://mcp.withwandb.com/mcp - no installation required!
🔑 Get your API key from wandb.ai/authorize
🌐 For W&B Dedicated / Self-Managed, use the instance MCP endpoint when enabled by your operator chart (
https:///mcp). Local STDIO remains available by settingWANDB_BASE_URL=https://.
Cursor
OpenAI Response API
Claude Code
OpenAI Codex
Gemini CLI
VSCode
Mistral Chat
Claude Desktop
General Installation Guide
More Information
Command Line Reference
When running the server locally, you can customize its behavior with command line arguments:
Available Arguments
Note: Arguments use underscores (e.g.,
--wandb_api_key), not dashes.
| Argument | Type | Default | Description |
|---|---|---|---|
--transport |
string | stdio |
Transport type: stdio for local MCP client communication or http for HTTP server |
--host |
string | localhost |
Host to bind HTTP server to (only used with --transport http) |
--port |
integer | 8080 |
Port to run the HTTP server on (only used with --transport http) |
--wandb_api_key |
string | None | Compatibility-only API key input; prefer WANDB_API_KEY so the key is not exposed in process arguments |
--weave_entity |
string | None | The W&B entity to log traced MCP server calls to |
--weave_project |
string | weave-mcp-server |
The W&B project to log traced MCP server calls to |
For hosted session signing and optional telemetry secret configuration, see Secret resolution.
Environment Variables
| Variable | Description | Required |
|---|---|---|
WANDB_API_KEY |
Your W&B API key (alternative to --wandb_api_key flag) |
Yes |
WANDB_BASE_URL |
Public W&B instance URL used for credentials and user-facing links | No |
WANDB_INTERNAL_BASE_URL |
Optional server-side W&B Models/API URL; Dedicated charts set this to the in-cluster API service. Weave trace routing remains controlled by WF_TRACE_SERVER_URL. |
No |
WB_AGENT_BASE_URL |
Explicit approved HTTPS origin required only by the ARIA tool profile | No |
MCP_SERVER_LOG_LEVEL |
Logging verbosity: DEBUG, INFO, WARNING, ERROR |
No |
WANDB_SILENT |
Set to "True" to suppress W&B SDK output (default: true) |
No |
WEAVE_SILENT |
Set to "True" to suppress Weave SDK output (default: true) |
No |
WANDB_DEBUG |
Set to "true" to enable detailed W&B logging |
No |
MCP_AUTH_DISABLED |
Must be true to acknowledge unauthenticated loopback HTTP development |
No |
WANDB_MCP_PROXY_DOCS |
Enable/disable docs search proxy (default: true) |
No |
DOCS_MCP_URL |
Docs MCP endpoint used by search_wandb_docs_tool (default: https://docs.coreweave.com/mcp); HTTP(S), no credentials, query, or fragment |
No |
MCP_ANALYTICS_DISABLED |
Disable structured MCP analytics events | No |
MCP_ANALYTICS_QUEUE_CAPACITY |
Maximum outstanding events per optional Segment or Datadog forwarder (default: 256) |
No |
MCP_REQUEST_SUCCESS_SAMPLE_RATE |
Deterministic sample rate for successful HTTP request telemetry (default: 0.10; failures and requests over two seconds are always retained). |
No |
MCP_LOG_PRIVACY_LEVEL |
Telemetry privacy: off/standard use an already-authenticated W&B username when functional work has materialized it; strict uses a SHA-256 pseudonym. Datadog keeps one user field, usr.id. Segment uses that trusted username at off/standard for analytics continuity, with a key pseudonym fallback, and always uses a pseudonym at strict. Telemetry never creates a W&B client or viewer request. Unset defaults to off; empty/invalid values fail startup. Raw tool arguments are never logged. |
No |
Release-controlled orthogonal selectors:
| Variable | Default | Effect |
|---|---|---|
WANDB_MCP_TOOL_PROFILE |
models-weave |
Selects one exact reviewed product-capability profile. |
WANDB_MCP_ACCESS_MODE |
read-write |
read-only subtracts every write tool. |
MCP_WORKLOAD_PROFILE |
local |
Selects query/history limits, admission mode and wait, deadlines, sessions, and HTTP rate policy. |
MCP_CAPACITY_CLASS |
small |
Selects bounded actor/process capacities and worker counts. |
Exact tool profiles:
Base profile (WANDB_MCP_TOOL_PROFILE) |
Groups |
|---|---|
models-only |
models |
models-weave |
models, weave |
models-weave-agents |
models, weave, agents |
Extension (WANDB_MCP_TOOL_EXTENSIONS) |
Requires | Managed workloads | Tools |
|---|---|---|---|
agent-lens |
weave, agents | shared | 14 |
aria |
weave, agents | shared | 4 |
raw-graphql |
weave | local only | 1 |
| Resolved profile | Base | Extensions | Managed workloads | Read-write | Read-only |
|---|---|---|---|---|---|
models-only |
models-only |
none | dedicated, shared | 18 | 16 |
models-weave |
models-weave |
none | dedicated, shared | 23 | 21 |
models-weave-graphql-compat |
models-weave |
raw-graphql | local only | 24 | 22 |
models-weave-agents |
models-weave-agents |
none | shared | 34 | 31 |
models-weave-agents-agent-lens |
models-weave-agents |
agent-lens | shared | 48 | 43 |
models-weave-agents-aria |
models-weave-agents |
aria | shared | 38 | 34 |
models-weave-agents-raw-graphql |
models-weave-agents |
raw-graphql | local only | 35 | 32 |
models-weave-agents-agent-lens-aria |
models-weave-agents |
agent-lens, aria | shared | 52 | 46 |
models-weave-agents-agent-lens-raw-graphql |
models-weave-agents |
agent-lens, raw-graphql | local only | 49 | 44 |
models-weave-agents-aria-raw-graphql |
models-weave-agents |
aria, raw-graphql | local only | 39 | 35 |
models-weave-agents-agent-lens-aria-raw-graphql |
models-weave-agents |
agent-lens, aria, raw-graphql | local only | 53 | 47 |
Exact workload defaults:
| Workload | Collection rows | History samples | Metric keys | Range span | Full-detail rows | Admission / HTTP rate |
|---|---|---|---|---|---|---|
shared |
100 | 500 | 20 | 5,000 | 3 | application admission and HTTP rate limiting off |
dedicated |
250 | 1,500 | 50 | 20,000 | 10 | admission on; 60/key/minute, 1000/process/minute |
local |
1,000 | 5,000 | 100 | 100,000 | 25 | application admission and HTTP rate limiting off |
Exact capacity classes:
| Capacity class | Actor | Process | Sync workers | Count workers |
|---|---|---|---|---|
small |
4 | 4 | 4 | 4 |
medium |
4 | 8 | 8 | 8 |
large |
8 | 16 | 16 | 8 |
Use python scripts/public_release.py profiles --all for every exact profile/access-mode manifest and tool name. Runtime contract: sha256:b132f6abd3330c860bb07a964cde31e8764eabde14c232352669a221807e5379.
For the standalone console entrypoint, credential resolution is command-line
compatibility input, then the .netrc entry for WANDB_BASE_URL, then
WANDB_API_KEY (including a repository-root .env loaded by the CLI). Prefer
the environment and remove stale .netrc entries for the same host; never pass
a key in release automation or a process argument.
Workload profiles are authoritative in managed deployments. They select query
and history limits, admission mode and wait, deadlines, session bounds, and
HTTP request-rate policy. Low-level numeric overrides are rejected for
shared and dedicated; only local accepts bounded advanced overrides.
The generated tables above contain the exact workload and capacity defaults.
MCP_CAPACITY_CLASS independently selects actor/process capacity and worker
counts; it does not change product capabilities, query semantics, or caller
authorization.
Usage Examples
STDIO Transport (default for desktop clients):
# Basic usage with environment variable
export WANDB_API_KEY="your-api-key"
uvx --from git+https://github.com/wandb/[email protected] wandb_mcp_server
For stdio clients such as Claude Desktop, stdout is reserved for MCP JSON-RPC messages. The server routes logs and analytics to stderr so clients do not parse diagnostics as protocol messages.
HTTP Transport (for testing and development):
# Basic HTTP server on localhost:8080
export MCP_AUTH_DISABLED=true
uvx --from git+https://github.com/wandb/[email protected] wandb_mcp_server \
--transport http \
--host 127.0.0.1 \
--port 8080
With Weave Tracing (log MCP calls to W&B):
export MCP_AUTH_DISABLED=true
uvx --from git+https://github.com/wandb/[email protected] wandb_mcp_server \
--transport http \
--host 127.0.0.1 \
--port 8080 \
--weave_entity my-team \
--weave_project mcp-monitoring
View all options:
uvx --from git+https://github.com/wandb/[email protected] wandb_mcp_server --help
Contributing & Releasing
- CONTRIBUTING.md – Development setup, testing, PR process, architecture overview
- RELEASING.md – Public source releases and artifact verification
- Release index – Availability and immutable artifacts by channel
- Query capability matrix – Typed reads and the opt-in compatibility path
- Detailed tool guidance – Extended query, trace, history, and report examples outside the compact MCP descriptions
- Observability – Logging, telemetry privacy, and supported collection modes
- Tool-development skill – Safe implementation and validation workflow
- Release skill – Exact-candidate release validation and handoff
Key Resources
- W&B Docs: docs.wandb.ai
- Weave Docs: weave-docs.wandb.ai
- MCP Spec: modelcontextprotocol.io
Example Code
Development
Running Tests
Unit tests run without API keys or network access:
uv sync --frozen --extra test --extra http
uv run pytest tests/ -m "not integration" -v
CI runs automatically on every push and PR via GitHub Actions.
Release artifact model
Source releases, container images, and Helm charts are independently versioned.
Use the source revision and immutable image digest recorded in the release
notes, and check chart compatibility before upgrading. Local source examples
use @vX.Y.Z; replace it only with a signed tag listed as available in the
release index. A container tag does not imply that a
matching Git tag exists. See RELEASING.md for contributor-facing
source and artifact checks.
Support
Install
uvx --from git+https://github.com/wandb/[email protected] wandb_mcp_serverConfiguration
{
"mcpServers": {
"wandb": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/wandb/[email protected]",
"wandb_mcp_server"
],
"env": {
"WANDB_API_KEY": "<your-api-key>"
}
}
}
}