API Reference

MCP Server

The Databuddy MCP server lets AI agents (Claude, Cursor, Windsurf, or any MCP-compatible client) query your analytics, manage feature flags, triage errors, and more through a standard protocol.

Endpoint

EnvironmentURL
Productionhttps://api.databuddy.cc/v1/mcp/
Localhttp://localhost:3001/v1/mcp/

The server uses the Streamable HTTP transport (JSON-RPC over HTTP). No SSE or WebSocket connection required.

Alternate transport surfaces are also available at https://api.databuddy.cc/mcp and https://api.databuddy.cc/.well-known/mcp for WebMCP-capable agents.

Discovery Manifest

Agents can discover the Databuddy MCP server from either well-known manifest URL:

ManifestURL
Primaryhttps://www.databuddy.cc/.well-known/mcp.json
Alternatehttps://www.databuddy.cc/.well-known/mcp/manifest.json
Server cardhttps://www.databuddy.cc/.well-known/mcp/server-card.json
API-hosted server cardhttps://api.databuddy.cc/.well-known/mcp/server-card.json

The manifest includes the Streamable HTTP endpoint, API-key auth header, required scopes, related OpenAPI spec, and a ready-to-use MCP client config template.

Authentication

Pass an API key with the read:data scope:

json
{
"mcpServers": {
  "databuddy": {
    "type": "http",
    "url": "https://api.databuddy.cc/v1/mcp/",
    "headers": {
      "x-api-key": "dbdy_your_api_key_here"
    }
  }
}
}

Get your API key from Dashboard → Organization Settings → API Keys. The key needs at least the read:data scope. Add manage:websites to reply to investigations.

Client Setup

Claude Code / Claude Desktop

Add to your .mcp.json or Claude Desktop config:

json
{
"mcpServers": {
  "databuddy": {
    "type": "http",
    "url": "https://api.databuddy.cc/v1/mcp/",
    "headers": {
      "x-api-key": "dbdy_your_api_key_here"
    }
  }
}
}

Cursor / Windsurf

Add to your MCP settings (typically .cursor/mcp.json or workspace settings):

json
{
"mcpServers": {
  "databuddy": {
    "type": "http",
    "url": "https://api.databuddy.cc/v1/mcp/",
    "headers": {
      "x-api-key": "dbdy_your_api_key_here"
    }
  }
}
}

Available Tools

Analytics

ToolDescription
get_dataTyped analytics queries (top_pages, recent_errors, errors_by_type, etc.). Batch 2-10 queries in one call.
capabilitiesQuery types, date presets, categories, and compact schema hints. Filter by category.
get_schemaClickHouse column definitions. Use when a field name is uncertain.
list_websitesList websites accessible to the authenticated key.

Investigations

ToolDescription
list_investigationsList durable investigations and their current status.
get_investigationRead an investigation's evidence, outcome, and reply timeline.
reply_to_investigationAdd context and queue the same investigation to continue.

reply_to_investigation returns the durable reply status immediately. If it is queued or running, call get_investigation with the same investigation ID until the reply is succeeded or failed; the new outcome appears in that timeline.

Funnels & Goals

ToolDescription
list_funnelsList configured funnels.
get_funnel_analyticsPer-step conversion analytics for a funnel.
list_goalsList configured goals.
get_goal_analyticsGoal completion analytics.

Feature Flags

ToolDescription
list_flagsList active feature flags.
create_flagCreate a new feature flag (requires confirmation).
update_flagUpdate flag configuration (requires confirmation).
ToolDescription
list_linksList short links.
search_linksSearch links by keyword.
list_link_foldersList link folders with usage counts.

Conventions

Website selection: Any tool that needs a website accepts websiteId, websiteName, or websiteDomain. Pass one.

Dates: Use a preset (e.g. last_7d, last_30d) OR both from and to (YYYY-MM-DD). Defaults to last_7d. Passing only one of from/to is rejected.

Filters: The field value is the ClickHouse column name. Use get_schema when uncertain. Error messages suggest close matches on typos.

Mutations: When a tool exposes confirmed, preview with confirmed: false, then execute with confirmed: true. Investigation replies use a stable replyId for safe retries instead.

Example Usage

Batch multiple queries in a single get_data call:

json
{
"tool": "get_data",
"arguments": {
  "websiteDomain": "example.com",
  "queries": [
    { "type": "summary_metrics", "preset": "last_7d" },
    { "type": "top_pages", "preset": "last_7d", "limit": 5 },
    { "type": "top_referrers", "preset": "last_7d", "limit": 5 },
    { "type": "error_summary", "preset": "last_7d" }
  ]
}
}

Filter errors by type:

json
{
"tool": "get_data",
"arguments": {
  "websiteDomain": "example.com",
  "type": "recent_errors",
  "preset": "last_7d",
  "limit": 20,
  "filters": [
    { "field": "error_type", "op": "eq", "value": "TypeError" }
  ]
}
}

Resources

The server exposes a databuddy://guide resource with extended workflow tips and known footguns. MCP clients that support resources can read it for additional context.

Scopes & Access Control

Tools are filtered based on your API key's scopes:

ScopeTools
read:dataAnalytics, investigations, schema, and read-only tools
manage:websitesReply to investigations; create goals, funnels, and annotations
manage:flags + manage:websitesFeature flag mutations
write:linksLink mutations

Session-authenticated users (via the dashboard) get access based on their organization role instead.

How is this guide?