WW

wandb/wandb-mcp-server

开发工具
69 stars 0 forks 质量 90 趋势 90

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

概览

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 Can This Server Do?


Quick Start

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

🔑 Get your API key from wandb.ai/authorize

🌐 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

OpenAI Response API

Claude Code

OpenAI Codex

Gemini CLI

VSCode

Mistral Chat

Claude Desktop

We’re working on adding OAuth support so that we can integrate with ChatGPT.


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 Weights & Biases API key for authentication
--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

Environment Variables

Variable Description Required
WANDB_API_KEY Your W&B API key (alternative to --wandb_api_key flag) Yes
WANDB_BASE_URL Custom W&B instance URL (for dedicated/on-prem instances) No
MCP_SERVER_LOG_LEVEL Logging verbosity: DEBUG, INFO, WARNING, ERROR No
WANDB_SILENT Set to "False" to suppress W&B output No
WEAVE_SILENT Set to "False" to suppress Weave output No
WANDB_DEBUG Set to "true" to enable detailed W&B logging No
MCP_AUTH_DISABLED Disable HTTP authentication (development only) No
WANDB_MCP_PROXY_DOCS Enable/disable docs search proxy (default: true) No
WANDB_MCP_ENABLE_WEAVE_TOOLS Enable Weave trace tools (default: true; set false for installs without a trace backend) No
WANDB_MCP_ENABLE_WEAVE_AGENT_TOOLS Enable Weave Agents (OTel/GenAI) tools (default: false) No
WANDB_MCP_READ_ONLY Omit report creation and analysis logging write tools (default: false) No
MCP_ANALYTICS_DISABLED Disable structured MCP analytics events. Useful as a workaround for older stdio builds that wrote analytics to stdout. No
MAX_RESPONSE_TOKENS Token budget for response truncation (default: 30000) No

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/wandb-mcp-server wandb_mcp_server

# Or with API key as argument
uvx --from git+https://github.com/wandb/wandb-mcp-server wandb_mcp_server --wandb_api_key your-api-key

For stdio clients such as Claude Desktop, stdout is reserved for MCP JSON-RPC messages. The server routes logs and analytics to stderr in stdio mode so desktop clients do not parse diagnostics as protocol messages. If you are using an older version and see JSON-RPC parse warnings containing analytics fields such as schema_version or event_type, set MCP_ANALYTICS_DISABLED=true as a workaround.

HTTP Transport (for testing and development):

# Basic HTTP server on localhost:8080
uvx wandb_mcp_server --transport http --host 127.0.0.1 --port 8080

# Bind to all interfaces with custom port
uvx wandb_mcp_server --transport http --host 0.0.0.0 --port 9090

With Weave Tracing (log MCP calls to W&B):

uvx wandb_mcp_server \
  --transport http \
  --port 8080 \
  --weave_entity my-team \
  --weave_project mcp-monitoring

View all options:

uvx --from git+https://github.com/wandb/wandb-mcp-server wandb_mcp_server --help

Contributing & Releasing

  • CONTRIBUTING.md – Development setup, testing, PR process, architecture overview
  • RELEASING.md – Version bumping, release checklist, deployment pipeline

Key Resources

Example Code

Development

Running Tests

Unit tests run without API keys or network access:

pip install -e ".[test]"
pytest tests/ -v

CI runs automatically on every push and PR via GitHub Actions.

Two-Repo Model

Repo Visibility Contains
wandb/wandb-mcp-server Public Tool logic, core server, unit tests
wandb/wandb-mcp-server-internal Private LLM evals, load tests, Dockerfile, Helm, CI/CD

The internal repo installs the public repo as a pip dependency.

Support

View this README on GitHub

安装

uvx --from git+https://github.com/wandb/wandb-mcp-server wandb_mcp_server

配置

{ "mcpServers": { "wandb": { "command": "/Users/niware_wb/.local/bin/uvx", "args": [ "--from", "git+https://github.com/wandb/wandb-mcp-server", "wandb_mcp_server" ], "env": { "WANDB_API_KEY": "<your-api-key>" } } } }