- Use AI
- By hand
1. Sign up
If you don’t have a Braintrust account, sign up for free at braintrust.dev.2. Get API keys
Create API keys for:- Braintrust
- Your AI provider or framework (OpenAI, Anthropic, Gemini, etc.)
3. Instrument your app
Now, update your code to send traces to Braintrust. To do this, you’ll set up Braintrust’s MCP server and ask it to add tracing to your app.Configure MCP

Claude Code
Claude Code
Install Claude Code

Claude Desktop
Claude Desktop
Install Claude Desktop
Add the Braintrust MCP server
- Name:
Braintrust - URL:
https://api.braintrust.dev/mcp

Cursor
Cursor
Install Cursor
Add the Braintrust MCP server
.cursor/mcp.json:YOUR_BRAINTRUST_API_KEY with your actual API key.Cursor also supports OAuth authentication. If you omit the headers field, Cursor will prompt you to authenticate via OAuth when you first use the server.
VS Code
VS Code
Install VS Code
Install an AI assistant extension
- GitHub Copilot
- Continue
- Other MCP-compatible extensions
Add the Braintrust MCP server
-
Workspace settings - Create or edit
.vscode/mcp.jsonin your project: -
User settings - Add to your VS Code user settings (
Cmd+,/Ctrl+,→ Search for “mcp”):
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.
Windsurf
Windsurf
Install Windsurf
Add the Braintrust MCP server
~/.codeium/windsurf/mcp_config.json and add the Braintrust server:YOUR_BRAINTRUST_API_KEY with your actual API key.
Codex (OpenAI)
Codex (OpenAI)
Install Codex
Add the Braintrust MCP server
~/.codex/config.toml and add the Braintrust MCP server configuration:BRAINTRUST_API_KEY environment variable.
OpenCode
OpenCode
Install OpenCode
Add the Braintrust MCP server
YOUR_BRAINTRUST_API_KEY with your actual API key.
Gemini CLI
Gemini CLI
Install Gemini CLI
Add the Braintrust MCP server
~/.gemini/settings.json and add the Braintrust MCP server configuration:YOUR_BRAINTRUST_API_KEY with your actual API key.
Warp
Warp
Install Warp
Add the Braintrust MCP server
- Name:
Braintrust - URL:
https://api.braintrust.dev/mcp - Header:
Authorization: Bearer YOUR_BRAINTRUST_API_KEY
YOUR_BRAINTRUST_API_KEY with your actual API key.Other clients
Other clients
Authorization header:Prompt assistant
docs://sdk-install resource, detect your programming language and frameworks, install the appropriate SDK, and configure auto-instrumentation. Once complete, it will run your app, verify traces are being logged, and provide a permalink to view them in Braintrust.4. View traces
In the Braintrust UI, go to your “Tracing quickstart” project and select Logs. You’ll see a trace for each request.Click into any trace to see:- Complete input prompt and model output
- Token counts, latency, and cost
- Model configuration (temperature, max tokens, etc.)
- Request and response metadata
Troubleshoot
Not seeing traces in the UI?
Not seeing traces in the UI?
- Verify
BRAINTRUST_API_KEYis set and starts withsk-(echo $BRAINTRUST_API_KEY) - Check that the project name in your code matches the project you’re looking at in the UI
- Check your console for error messages — common issues are invalid API key, network connectivity, or firewall blocking
api.braintrust.dev
TypeScript auto-instrumentation not working?
TypeScript auto-instrumentation not working?
- Run with
node --import braintrust/hook.mjs(not--loader, which is deprecated) - Verify
braintrustis installed (npm list braintrust) - Call
initLogger()with a project name before making any LLM calls - Verify
BRAINTRUST_API_KEYis set in your environment - Using a bundler (Vite, Webpack, esbuild, Rollup)? Use the bundler plugin instead of
--import. See TypeScript SDK documentation - Requires Node.js 18.19.0+ or 20.6.0+ for
--importflag support (node --version)
Python auto-instrumentation not working?
Python auto-instrumentation not working?
- Call
braintrust.auto_instrument()at the start of your application, before any AI library imports or client creation - Verify
BRAINTRUST_API_KEYis set in your environment
Ruby auto-instrumentation not working?
Ruby auto-instrumentation not working?
- Ensure your Gemfile has
gem "braintrust", require: "braintrust/setup"(note therequire:option) - Your application must load Bundler with
require 'bundler/setup'andBundler.require(default in Rails, may need to be added in Sinatra/Rack) - Verify
BRAINTRUST_API_KEYis set in your environment
Go auto-instrumentation not working?
Go auto-instrumentation not working?
- Ensure you have a
go.modfile (go mod init your-project-nameif not) - Verify Orchestrion is installed (
orchestrion version). If not, reinstall withgo install github.com/DataDog/orchestrion@latest - Ensure
orchestrion.tool.goexists in your project root with the correct imports - Build with
orchestrion go build— regulargo buildwon’t instrument your code - Verify
BRAINTRUST_API_KEYis set in your environment - Requires Go 1.24 or later (
go version)
MCP not working?
MCP not working?
- Verify the URL is exactly
https://api.braintrust.dev/mcp(no trailing slash) - Check internet connection — corporate networks may need to allowlist
api.braintrust.devand*.braintrust.dev - Restart your AI tool and verify JSON configuration syntax
Need help?
Need help?
- Join our Discord
- Email us at support@braintrust.dev
- Use the Loop feature in the Braintrust UI
Next steps
- Explore the full Braintrust workflow
- Go deeper with tracing:
- Explore integrations with AI providers, SDKs, and developer tools
- Trace application logic for application logic
- Capture user feedback like thumbs up/down
- Analyze logs for patterns and issues