Prerequisites
- Get your W&B API key from wandb.ai/authorize.
- Set your key as an environment variable named
WANDB_API_KEY.
Configure your MCP client to use the W&B’s remote MCP server
W&B provides a hosted MCP server athttps://mcp.withwandb.com that requires no installation. The following instructions show how to configure the hosted server with various AI assistants and IDEs.
- Cursor
- Claude Desktop
- VS Code
- OpenAI
- Gemini CLI
- Mistral LeChat
- On macOS, open the Cursor menu, select
Settings, and then select Cursor Settings. One Windows or Linux, open the Preferences menu, select Settings, and then select Cursor Settings. - From the Cursor Settings menu, select Tools and MCP. This opens the Tools menu.
- In the Installed MCP Servers section, select Add Custom MCP. This opens the
mcp.jsonconfiguration file. - In the configuration file, in the
mcpServersJSON object, add the followingwandbobject, like this:
- Restart Cursor to make the changes take effect.
- Verify that the chat agent has access to the W&B MCP server by telling it to, “List the projects in my W&B account.”
Set up a local version of the W&B MCP server
If you need to run the MCP server locally for development, testing, or air-gapped environments, you can install and run it on your machine.Prerequisites
- Python 3.10 or higher
- uv (recommended) or pip
Install the W&B MCP server on your local machine
To install the W&B MCP server on your local machine:- run one of the following commands:
- uv
- pip
- Install directly from GitHub
- Once you have successfully installed the server, add the following JSON object to your MCP client configuration:
https://mcp.withwandb.com/mcp.
- For web-based clients or testing, run the server with HTTP transport:
ngrok, update your MCP client configuration to use the ngrok URL.
Usage tips
- Provide your W&B project and entity name: Specify the W&B entity and project in your queries for accurate results.
- Avoid overly broad questions: Instead of “what is my best evaluation?”, ask “what eval had the highest f1 score?”
- Verify data retrieval: When asking broad questions like “what are my best performing runs?”, ask the assistant to confirm it retrieved all available runs.