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"
    }
  }
}
}

The quickest setup is Dashboard → Organization Settings → Integrations: choose Databuddy MCP, select the client, capabilities, and website access you want, then copy the generated config. The secret is shown only once. You can also create and manage keys from API Keys. The key needs at least the read:data scope. Add manage:websites for workspace actions such as goals, funnels, annotations, and investigation replies; add manage:flags for feature-flag mutations; and add read:links plus write:links for the full short-link workflow.

Dashboard setup

The dashboard creates a dedicated automation key tagged MCP rather than requiring you to share a personal API key. The setup sheet defaults to read-only analytics, then lets you enable Workspace actions (goals, funnels, annotations, and investigation replies), Feature flags, and Short links. Each capability maps to the narrowest scopes currently supported by the MCP tools. You can create separate connections for Cursor, Claude, Windsurf, or another MCP client, scope a connection to specific websites, choose a 90-day expiry or no expiry, and rotate or revoke it later from Organization Settings → API Keys.

For clients that support environment-variable interpolation in remote MCP headers, enable the environment-variable option in the setup sheet and set DATABUDDY_API_KEY before launching the client. Otherwise, paste the generated one-time config with the secret in the x-api-key header.

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.
get_funnel_analytics_by_referrerBreak down funnel performance by referrer/source.
create_funnelCreate a funnel after confirmation.
list_goalsList configured goals.
get_goal_analyticsGoal completion analytics.
create_goalCreate a conversion goal after confirmation.
update_goalUpdate a goal after confirmation.
delete_goalDelete a goal after confirmation.

Annotations

ToolDescription
list_annotationsList annotations for a website.
create_annotationCreate an annotation after confirmation.
update_annotationUpdate an annotation after confirmation.
delete_annotationDelete an annotation after confirmation.

Feature Flags

ToolDescription
list_flagsList active feature flags.
create_flagCreate a new feature flag (requires confirmation).
update_flagUpdate flag configuration (requires confirmation).
add_users_to_flagAdd users to a feature flag target group (requires confirmation).
ToolDescription
list_linksList short links.
search_linksSearch links by keyword.
list_link_foldersList link folders with usage counts.
create_linkCreate a short link after confirmation.
update_linkUpdate a short link after confirmation.
delete_linkDelete a short link after confirmation.

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:websitesInvestigation replies; create, update, and delete goals and annotations; create funnels
manage:flagsFeature flag mutations
read:linksRead short links, folders, and link search results
read:data + write:linksUpdate or delete short links for an accessible website
read:data + read:links + write:linksCreate short links

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

How is this guide?