Track MCP

Track MCP

A professional tool for automatically generating enterprise-standard tracking code for H5, mini-programs, and native applications. It streamlines event tracking for API calls, user clicks, and UI interactions while supporting JIRA integration for task-specific tracking.

Category
Visit Server

README

埋点 MCP 工具

基于 Model Context Protocol (MCP) 的专业埋点代码生成工具,自动生成符合企业级标准的跟踪代码。

🚀 快速开始

安装配置

在支持 MCP 的客户端中添加服务器配置:

{
  "mcpServers": {
    "mcp-ai-track": {
      "command": "npx",
      "args": ["-y", "mcp-ai-track"],
      "env": {
        "ENVIRONMENT": "h5",
        "BUSINESS": "jk"
      }
    }
  }
}

本地配置

{
  "mcpServers": {
    "mcp-ai-track": {
      "command": "node",
      "args": ["/path/to/mcp-ai-track/dist/server.js"],
      "env": {
        "ENVIRONMENT": "h5",
        "BUSINESS": "jk"
      }
    }
  }
}

不同环境配置示例

通过环境变量设置默认的 environment 和 business 参数:

微信小程序:

{
  "mcpServers": {
    "mcp-ai-track": {
      "command": "node",
      "args": ["/path/to/mcp-ai-track/dist/server.js"],
      "env": {
        "ENVIRONMENT": "wxmp",
        "BUSINESS": "jk"
      }
    }
  }
}

支付宝小程序:

{
  "mcpServers": {
    "mcp-ai-track": {
      "command": "node",
      "args": ["/path/to/mcp-ai-track/dist/server.js"],
      "env": {
        "ENVIRONMENT": "alipaymp",
        "BUSINESS": "bx"
      }
    }
  }
}

原生应用:

{
  "mcpServers": {
    "mcp-ai-track": {
      "command": "node",
      "args": ["/path/to/mcp-ai-track/dist/server.js"],
      "env": {
        "ENVIRONMENT": "app",
        "BUSINESS": "jkyx"
      }
    }
  }
}

🛠️ 核心工具

1. api_data - API 调用埋点

  • 事件类型: api_data
  • 参数: state(pre/success/failed) + action(order/login/get 等) + description(自定义)
  • 用途: API 调用前后的状态跟踪

2. web_click - 页面点击埋点

  • 事件类型: $WebClick
  • 参数: subject(page/pop) + scene(order/banner 等) + description(submit/close 等)
  • 用途: 用户点击行为跟踪

3. popup - 弹窗显示埋点

  • 事件类型: Popup
  • 参数: scene(splash/collection 等) + description(自定义)
  • 用途: 弹窗展示事件跟踪

4. focus_related - 焦点事件埋点

  • 事件类型: focus_related
  • 参数: subject(page/pop) + focus(focus/blur) + description(input*/select*等)
  • 用途: 表单元素焦点跟踪

📋 参数规范

固定参数值

环境 (environment): h5 | wxmp | alipaymp | ksmp | app 业务 (business): jk | bx | wa | qsgy | jkyx | mg |

API 埋点参数

状态 (state): pre | success | failed 动作 (action): order | login | imageupload | get | add | update | delete 描述 (description): 自定义,如 phone、userinfo、gominepage

点击埋点参数

主体 (subject): page | pop 场景 (scene): order | condition | banner | promotion | progress | recomm | tabbar 描述 (description): laststep | nextstep | continue | submit | receive | confirm | close

弹窗埋点参数

场景 (scene): splash | collection | remind | confirmationmodal 描述 (description): 自定义,描述弹窗用途

焦点埋点参数

主体 (subject): page | pop 焦点 (focus): focus | blur 描述 (description): input* | select* | search* + 上下文(如 inputname、selectcity)

⚙️ 高级功能

自动配置

  • 环境、业务默认值:环境:environment=h5,业务: business=jk (可手动指定 AI 更换)
  • JIRA 集成: 自动从 git 分支提取 JIRA Key (格式: XXXX-1234) (分支名必须包含 XXXX-1234,也可手动指定 AI 更换)

可选参数

  • jiraKey: JIRA 任务号
  • environment: 环境
  • business:业务

输出格式

window.sa.track("事件类型", {
  jiraKey: "BASESERVER-2411222", // 可选
  fileName: "环境_业务_参数组合", // 必需
  chineseDesc:'中文描述' //必须
  fileValue: window.sa.fv(), // 可选,当前路由
});

🔧 本地开发

# 克隆项目
git clone <repository-url>
cd mcp-ai-track

# 安装依赖
npm install

# 构建项目
npm run build

# 启动服务器
npm start

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured