Skip to main content
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

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.

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

VariableRequiredDefaultDescription
DATABRAIN_SERVICE_TOKENYesOrg-level token from Settings → Service Tokens
DATABRAIN_API_TOKENNoPer-data-app token (auto-created during setup if not provided)
DATABRAIN_API_URLNohttps://api.usedatabrain.comAPI 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.