This guide covers the full configuration for each supported AI client, including file paths, self-hosted setup, and optional pre-configuration of API tokens.
Configuration by Client
Cursor
Claude Desktop
Claude Code
Windsurf
Generic / stdio
Config File Location
- Project-level:
.cursor/mcp.json in your project root
- Global:
~/.cursor/mcp.json
Project-level config takes precedence when both exist.Configuration
{
"mcpServers": {
"databrain": {
"command": "npx",
"args": ["@databrainhq/mcp-server"],
"env": {
"DATABRAIN_SERVICE_TOKEN": "<your-service-token>"
}
}
}
}
Restart
After saving the config file, restart Cursor or reload the window (Cmd+Shift+P → “Reload Window”) to pick up the new MCP server.Config File Location
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
%APPDATA%\Claude\claude_desktop_config.json
Configuration
{
"mcpServers": {
"databrain": {
"command": "npx",
"args": ["@databrainhq/mcp-server"],
"env": {
"DATABRAIN_SERVICE_TOKEN": "<your-service-token>"
}
}
}
}
Restart
Fully quit Claude Desktop (not just close the window) and reopen it. On macOS, use Cmd+Q to quit.Add via CLI
claude mcp add databrain -- npx @databrainhq/mcp-server
Set Environment Variable
Add to your shell profile (.bashrc, .zshrc, etc.):export DATABRAIN_SERVICE_TOKEN="<your-service-token>"
Then reload your shell:Verify
You should see databrain in the list of configured servers.Config File Location
~/.codeium/windsurf/mcp_config.jsonConfiguration
{
"mcpServers": {
"databrain": {
"command": "npx",
"args": ["@databrainhq/mcp-server"],
"env": {
"DATABRAIN_SERVICE_TOKEN": "<your-service-token>"
}
}
}
}
Restart
Restart Windsurf after saving the config file.Direct Execution
The server uses stdio transport and works with any MCP-compatible client.export DATABRAIN_SERVICE_TOKEN="<your-service-token>"
npx @databrainhq/mcp-server
Programmatic Usage
If your client accepts a command and arguments:
- Command:
npx
- Args:
["@databrainhq/mcp-server"]
- Env:
{ "DATABRAIN_SERVICE_TOKEN": "<your-service-token>" }
Self-Hosted Databrain
If you’re running a self-hosted Databrain instance, add the DATABRAIN_API_URL environment variable pointing to your API:
{
"mcpServers": {
"databrain": {
"command": "npx",
"args": ["@databrainhq/mcp-server"],
"env": {
"DATABRAIN_SERVICE_TOKEN": "<your-service-token>",
"DATABRAIN_API_URL": "https://your-databrain-instance.com"
}
}
}
}
If DATABRAIN_API_URL is not set, the server defaults to https://api.usedatabrain.com.
Pre-Configuring an API Token
By default, the MCP server creates API tokens automatically during embed setup via the create_api_token tool. If you prefer to provide one upfront (for example, to reuse an existing token), add it to the config:
{
"mcpServers": {
"databrain": {
"command": "npx",
"args": ["@databrainhq/mcp-server"],
"env": {
"DATABRAIN_SERVICE_TOKEN": "<your-service-token>",
"DATABRAIN_API_TOKEN": "<your-api-token>"
}
}
}
}
The API token is scoped to a single data app. If you work with multiple data apps, let the MCP server create tokens on the fly instead.
Environment Variables Reference
| Variable | Required | Default | Description |
|---|
DATABRAIN_SERVICE_TOKEN | Yes | — | Org-level token from Settings → Service Tokens |
DATABRAIN_API_TOKEN | No | — | Per-data-app token (auto-created during setup if not provided) |
DATABRAIN_API_URL | No | https://api.usedatabrain.com | API base URL for self-hosted instances |
Verifying the Connection
After configuring your client, try asking your AI assistant:
“List my Databrain datasources”
If the server is configured correctly, you’ll see a list of your connected datasources. If you get a MISSING_SERVICE_TOKEN error, double-check that the token is set in the env block of your config and restart your client.
See the Troubleshooting guide for more common issues and solutions.