← 返回
未分类 Key

Millimetric Mcp Setup

Connect AI agents (Claude Code, Claude Desktop, Cursor, MCP Inspector, OpenClaw) to the Millimetric MCP server so they can natively call track_event, query_e...
将 AI 代理(Claude Code、Claude Desktop、Cursor、MCP Inspector、OpenClaw)连接到 Millimetric MCP 服务器,以便原生调用 track_event、query_e...
soybelli soybelli 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 需要
★ 0
Stars
📥 322
下载
💾 0
安装
1
版本
#latest

概述

Millimetric MCP Setup

Wire any MCP client to Millimetric's /mcp (single-project) or /mcp/account (multi-project) endpoint. Transport is JSON-RPC 2.0 over HTTP — no SSE needed.

When to Use

  • "Let Claude / my agent read my Millimetric data"
  • Connecting Claude Code, Claude Desktop, Cursor, or MCP Inspector
  • Multi-project / agency setup (ak_live_…)
  • Verifying an MCP connection or listing available tools

When NOT to Use

  • One-shot CLI queries → millimetric-query
  • Sending events from a server → millimetric-track

Endpoints

EndpointAuthScopePlan
-----------------------------
POST https://api.millimetric.ai/mcpsk_live_… or rk_live_…One projectPro+
POST https://api.millimetric.ai/mcp/accountak_live_…All projects on the accountBusiness

pk_live_… keys are rejected with 403 key_kind_not_allowed. They ship in browser JS and must never grant analytics access.

Key you give the agentTools it gets
---------------------------------------
rk_live_…query_events, get_stats, top_sources, funnel, resources
sk_live_…the read tools above plus track_event
ak_live_…every read tool with optional project_id/project_slug/project_ids, plus list_projects and compare_projects

Default to rk_. Only hand the agent sk_ if it must emit events.

Quick start

Claude Code / Claude Desktop

Edit ~/.claude/config.json (or use the UI):

{
  "mcpServers": {
    "millimetric": {
      "url": "https://api.millimetric.ai/mcp",
      "transport": "http",
      "headers": {
        "Authorization": "Bearer rk_live_…"
      }
    }
  }
}

Restart Claude. Then:

> "Use millimetric.top_sources to show me the Facebook social-vs-paid split for the last 7 days."

Cursor

~/.cursor/mcp.json:

{
  "mcpServers": {
    "millimetric": {
      "url": "https://api.millimetric.ai/mcp",
      "transport": "http",
      "headers": { "Authorization": "Bearer rk_live_…" }
    }
  }
}

MCP Inspector (interactive testing)

npx @modelcontextprotocol/inspector
# URL:  https://api.millimetric.ai/mcp   (or http://localhost:8787/mcp for local dev)
# Header: Authorization: Bearer rk_live_…

Account MCP (multi-project)

{
  "mcpServers": {
    "millimetric-account": {
      "url": "https://api.millimetric.ai/mcp/account",
      "transport": "http",
      "headers": { "Authorization": "Bearer ak_live_…" }
    }
  }
}

Verify the connection from the CLI

# List available tools
curl -s -X POST https://api.millimetric.ai/mcp \
  -H "Authorization: Bearer $MILLIMETRIC_KEY" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | jq

# Call top_sources directly
curl -s -X POST https://api.millimetric.ai/mcp \
  -H "Authorization: Bearer $MILLIMETRIC_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc":"2.0","id":2,"method":"tools/call",
    "params":{
      "name":"top_sources",
      "arguments":{
        "from":"2026-05-01T00:00:00Z",
        "to":"2026-06-01T00:00:00Z",
        "breakdown":"source_medium",
        "limit":20
      }
    }
  }' | jq

Tools cheat sheet

Single-project (/mcp)

ToolScopePurpose
----------------------
track_eventingest (sk_*)Emit a single event.
query_eventsreadFilter raw events by date, event name, source, user.
get_statsreadAggregations with metric, group_by, interval.
top_sourcesreadTop sources/mediums with FB social-vs-paid split.
funnelreadStep conversion analysis.

Resources: events://recent, schema://events.

Account (/mcp/account)

Every read tool accepts optional project_id / project_slug / project_ids. Omit them to span every project the key can see — rows include a project_id column when the query is multi-project.

ToolPurpose
---------------
list_projectsEvery project the key can read.
query_eventsMulti-project event queries.
get_statsGroup by project_id to compare apps.
top_sourcesTop channels across one or all projects.
compare_projectsRank projects by count or uniques.

Resources: projects://all, schema://events (across all accessible projects).

Tool result shape

MCP tool results come back as content[] with stringified JSON:

{
  "jsonrpc": "2.0", "id": 1,
  "result": {
    "content": [
      { "type": "text", "text": "[{\"source\":\"facebook\",\"medium\":\"paid\",\"events\":6,...}]" }
    ]
  }
}

Agents JSON.parse the text to get rows.

Errors

CodeMeaningFix
--------------------
-32600invalid_requestBody isn't valid JSON-RPC.
-32601method_not_foundUnknown method.
-32602unknown_tool / unknown_resourceMisspelled tool/resource name.
-32000tool_failed / insufficient_scopeUse a higher-scope key (e.g. sk_* for track_event).
-32002plan_limitAccount-MCP requires Business; /mcp requires Pro+.
-32004unknown_project_id / unknown_project_slugAccount-MCP only — project doesn't exist or key can't see it.
-32005no_projects_visibleAccount-MCP key has zero accessible projects.
HTTP 403key_kind_not_allowedYou used pk_. Use rk_ / sk_ (or ak_ on /mcp/account).
HTTP 403account_key_required/mcp/account only takes ak_*.

Local dev

When running the Worker locally:

pnpm dev:api   # http://localhost:8787

Point your MCP client at http://localhost:8787/mcp with the same Bearer header.

See also

  • Single-shot ingest → millimetric-track
  • Single-shot reads → millimetric-query

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-21 14:04 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

data-analysis

Millimetric Query

soybelli
查询Millimetric分析——热门来源、聚合统计、原始事件及Facebook社交与付费拆分。用于用户询问'我的流量来源...'时。
★ 0 📥 403
ai-agent

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,404 📥 324,147
ai-agent

Find Skills

guipi888
场景驱动+关键词双模式技能发现工具。当用户用自然语言描述场景/需求(如"我想做一个海报""帮我分析股票"),或明确说"安装技能/find skills/找个skill"时,自动从官方内置、本地已安装、SkillHub、虾评、GitHub、C
★ 1,487 📥 550,730