Skip to main content
Visual Studio Code is Microsoft’s popular open-source code editor. The Braintrust MCP server integrates with VS Code, giving AI assistants access to your Braintrust projects, experiments, and logs.

Setup

1

Install VS Code

If you haven’t already, download and install Visual Studio Code.
2

Install an AI assistant extension

VS Code requires an AI assistant extension that supports the Model Context Protocol (MCP). Popular options include:Install one of these extensions from the VS Code marketplace.
3

Add the Braintrust MCP server

Add the Braintrust MCP server to your VS Code settings, either in workspace settings or user settings:
  • Workspace settings - Create or edit .vscode/mcp.json in your project:
    {
        "servers": {
            "braintrust": {
                "type": "http",
                "url": "https://api.braintrust.dev/mcp",
                "headers": {
                    "Authorization": "Bearer YOUR_BRAINTRUST_API_KEY"
                }
            }
        }
    }
    
  • User settings - Add to your VS Code user settings (Cmd+, / Ctrl+, → Search for “mcp”):
    {
        "mcp.servers": {
            "braintrust": {
                "type": "http",
                "url": "https://api.braintrust.dev/mcp",
                "headers": {
                    "Authorization": "Bearer YOUR_BRAINTRUST_API_KEY"
                }
            }
        }
    }
    
Replace YOUR_BRAINTRUST_API_KEY with your actual API key.VSCode also supports OAuth authentication. If you omit the headers field, VSCode will prompt you to authenticate via OAuth when you first use the server.
4

Restart VS Code

Reload the VS Code window (Cmd+R / Ctrl+R) or restart VS Code to apply the configuration.

Usage

Once configured, your AI assistant can access Braintrust data through the MCP server. You can fetch experiment results, query logs, log data, and more. See MCP documentation for details. Example prompts:
  • “Show me my recent experiments”
  • “Query the last 10 logged requests with errors”
  • “What’s the average latency for the summarizer prompt today?”

Troubleshooting

  • Verify the JSON configuration syntax is correct
  • Check that you’re using an AI assistant extension that supports MCP
  • Try restarting VS Code completely (not just reloading the window)
  • Verify your API key is correct (no extra spaces or quotes)
  • For OAuth: Clear browser cache and try incognito mode
  • Ensure you can log into Braintrust in your browser
  • Check your internet connection
  • Corporate networks may need to allowlist api.braintrust.dev and *.braintrust.dev
  • Verify the URL is exactly https://api.braintrust.dev/mcp (no trailing slash)

Next steps