MCP server

Give your AI assistant a Trell login. The MCP server exposes your workspaces — stats, funnels, webhooks, domains — as tools any MCP-compatible client can call, with the same guardrails as the dashboard.

Endpoint

The MCP server lives on its own host: https://mcp.relake.co — not https://trepi.relake.co, which serves only the REST API. It speaks Streamable HTTP (stateless: one transport per request, no session affinity) at POST /. Unknown paths answer 404 and non-POST methods 405. For local development there is also a stdio entry point that runs against your own database with no auth.

Authentication

Send Authorization: Bearer … with either the service key (MCP_API_KEY, for bots and backends) or an OAuth access token (Google login with dynamic client registration and PKCE, recommended for people). Missing or invalid credentials answer 401 with a WWW-Authenticate discovery header (RFC 9728). If MCP_API_KEY is empty the HTTP endpoint is disabled (fail-closed): only OAuth logins work.

Scope

MCP_ALLOWED_SLUGS restricts which workspaces the server answers for (*, the default, means all). OAuth callers additionally see only the workspaces they belong to. Destructive tools stay off unless MCP_ALLOW_DESTRUCTIVE=true and every call passes "confirm": true.

Reading

Every tool takes a project slug or id except list_projects:

list_projects

List accessible workspaces (id, slug, name, plan). The only tool that takes no project argument.

get_project

Workspace detail: plan, publishable key, domain allowlist, creation date.

get_stats

Event KPIs for a workspace: total, counts by type, top forms and pages (default last 30 days, max range 366 days).

tracking_checkup

Is a workspace receiving events? Reports connection state, last event time, totals, domains and findings.

get_series

Time series of event counts in hour/day/week buckets, gap-filled with zeros.

get_breakdown

Top-N breakdown by dimension: page, utm_*, device, browser, os, form or type (default page, limit 25).

get_forms

Per-form ranking with starts, successes and conversion rate (default last 90 days).

query_events

Raw events, newest first, with cursor pagination (max 100 per call).

list_funnels

Funnel definitions of a workspace.

get_funnel

One funnel definition by id or name, with its steps.

list_views

Saved dashboard views of a workspace.

list_webhooks

Webhook metadata (URL, events, enabled) — signing secrets are never exposed.

list_utm_templates

UTM templates of a workspace.

list_api_keys

Server-key metadata only (name, prefix, creation date) — hashes and secrets are never exposed.

Writing

Safe mutations, available to workspace members:

create_funnel

Create a funnel from an ordered step list (1–10 steps).

update_funnel

Rename a funnel or replace its steps.

delete_funnel

Delete a funnel.

create_utm_template

Create a UTM template (name required).

update_utm_template

Update a UTM template.

delete_utm_template

Delete a UTM template.

add_domain

Add a hostname to the tracking allowlist (idempotent, normalized).

remove_domain

Remove a hostname from the tracking allowlist.

create_webhook

Create a webhook: valid http(s) URL plus subscribed events (Pro workspaces).

delete_webhook

Delete a webhook.

create_api_key

Create a server key — the secret is shown exactly once, store it in .env, never in the browser.

Destructive

Owner role plus MCP_ALLOW_DESTRUCTIVE=true plus "confirm": true, otherwise the call fails with destructive_disabled or confirm_required:

revoke_api_key

Revoke a server key immediately — integrations using it break at once.

delete_project

Permanently delete a workspace and everything in it (events, keys, webhooks) in cascade.

rotate_project_secret

Rotate the project-level secret: the new sk shows once, the old one dies instantly, named keys are untouched.

Resources & prompts

Beyond tools, the server exposes three resources for context (trell://projects, trell://projects/{slug}/usage, trell://schema/events) and two canned prompts (weekly_report, tracking_setup_help).

Connect

Point any MCP client at the URL with your key in the headers:

json
{
  "mcpServers": {
    "trell": {
      "url": "https://mcp.relake.co",
      "headers": {
        "Authorization": "Bearer YOUR_MCP_API_KEY"
      }
    }
  }
}

Probe the endpoint — listing tools with a valid key returns a JSON-RPC result; without credentials you get 401:

bash
curl -s -o /dev/null -w '%{http_code}\n' \
  -X POST https://mcp.relake.co \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_MCP_API_KEY" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'

Secrets stay secret

The MCP server never returns sk_… values, webhook signing secrets, key hashes, or its own credentials. create_api_key and rotate_project_secret reveal the new secret exactly once. The publishable pk_… is public by design and may appear in responses.