分析查询服务器

Himetrica的MCP服务器,用于从Claude、Cursor或任何支持模型上下文协议的AI助手中查询分析数据。

  • by himetrica
  • TypeScript
  • 混合部署
  • 1 星标
  • 更新于
在 GitHub 查看 himetrica/himetrica-mcp

使用说明

@himetrica/mcp服务器

MCP服务器 Himetrica --从Claude、Cursor或任何支持 模型上下文协议.

设置

您需要:

  • 希米特里卡 密钥 (hm_sk_...)从项目设置
  • A. 启动计划 或以上

远程(推荐)

无需安装,直接连接到Himetrica的服务器。

克劳德代码

claude mcp add himetrica https://app.himetrica.com/api/v1/mcp \
  --transport http --header "X-API-Key: hm_sk_..."

克劳德桌面

添加 ~/Library/Application Support/Claude/claude_desktop_config.json (macOS)或 %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "himetrica": {
      "url": "https://app.himetrica.com/api/v1/mcp",
      "headers": {
        "X-API-Key": "hm_sk_..."
      }
    }
  }
}

光标

添加 .cursor/mcp.json 在您的项目中:

{
  "mcpServers": {
    "himetrica": {
      "url": "https://app.himetrica.com/api/v1/mcp",
      "headers": {
        "X-API-Key": "hm_sk_..."
      }
    }
  }
}

本地(通过npx)

或者,在本地运行MCP服务器。需要 Node.js 18+.

claude mcp add himetrica -e HIMETRICA_SECRET_KEY=hm_sk_... -- npx @himetrica/mcp-server

可用工具

工具 说明
get_analytics 概述统计数据:访客、页面浏览量、跳出率,以及同期比较
get_timeseries 用于绘制图表的时间序列趋势
get_realtime 当前活跃访客
get_top_pages 按浏览量排名的页面
get_traffic_sources 流量来源细分(引用者,UTM)
get_top_locations 按国家或城市分列的地理分布
get_events 自定义事件指标
get_revenue 收入概述:MRR、客户流失、订阅
get_revenue_timeseries 收入随时间变化
get_top_customers 收入最高的客户
get_channel_roi 渠道投资回报率:收入、广告支出、CAC、LTV

所有工具均接受可选 startDate 和 endDate 参数(ISO 8601)。你的AI助手会根据你的问题自动设置这些。

示例问题

  • “这周我接待了多少访客?”
  • “我的MRR是什么?”
  • “哪些页面最受欢迎?”
  • “我的客人从哪里来?”
  • “哪个营销渠道的投资回报率最高?”
  • “现在有人在我的网站上吗?”
  • “我的主要客户是谁?”
  • “过去90天的收入趋势如何?”

运作原理

远程MCP服务器在Himetrica的基础设施上运行。当您的AI助手需要分析数据时,它会向发送请求 https://app.himetrica.com/api/v1/mcp 并返回结果。不存储任何数据,它实时查询您的分析。

本地版本(npx @himetrica/mcp-server)在您的机器上运行并调用 Himetrica Read API 通过HTTP。

许可证

麻省理工学院