Tracking Plan MCP Server
MCP server for creating, listing, inspecting, and validating tracking plans for ecommerce and lead-generation businesses, with JSON storage and TypeScript implementation.
README
Tracking Plan MCP Server
Beginner-friendly Model Context Protocol (MCP) server built with TypeScript + Node.js to create, list, inspect, and validate tracking plans for Ecommerce and Lead-Generation / Service Businesses.
š Project Overview
The Tracking Plan MCP Server allows AI assistants (such as Cursor, Claude Desktop, and Antigravity) to manage analytics tracking specifications locally.
It supports two distinct business models out-of-the-box:
- Ecommerce Businesses: Product views, cart activity, checkout steps, payment info, revenue, and purchase transactions.
- Lead Generation & Service Businesses: Service views, form starts, form submissions, lead generation, phone clicks, email clicks, WhatsApp clicks, appointment bookings, and quote requests.
šļø Architecture & Data Flow
AI Assistant (Cursor / Claude Desktop / Antigravity)
ā
MCP Client
ā
MCP Server (stdio transport)
ā
MCP Tools (create_tracking_plan, get_tracking_plan, list_tracking_plans, validate_tracking_event)
ā
Tracking Plan Service (Business logic & Validation)
ā
JSON Storage (fs/promises)
ā
data/tracking-plans.json
š¼ Supported Business Types
š 1. Ecommerce
Tracks:
- Product page views (
view_item) - Cart interactions (
add_to_cart,remove_from_cart,view_cart) - Checkout flow (
begin_checkout,add_payment_info) - Purchases & revenue (
purchase)
Purchase Event Required Parameters: transaction_id, value, currency, items.
š 2. Lead Generation / Service Businesses
Tracks:
- Service page views (
view_service) - Form interactions (
form_start,form_submit) - Lead submissions (
generate_lead) - Direct contacts (
contact,phone_click,email_click,whatsapp_click) - Appointment bookings (
appointment_start,appointment_booked) - Quote requests (
quote_request)
Lead Submission Required Parameters: form_id, form_name.
š ļø MCP Tools Reference
| Tool Name | Parameters | Description |
|---|---|---|
create_tracking_plan |
id, name, description, business_type, platform, events |
Creates a new tracking plan after validating business_type and checking duplicate IDs. |
get_tracking_plan |
plan_id |
Retrieves complete tracking plan definition. |
list_tracking_plans |
business_type (optional) |
Lists all tracking plans, optionally filtered by ecommerce or lead_generation. |
validate_tracking_event |
plan_id, event |
Validates a tracking payload against plan schemas, returning errors and warnings. |
š Project Structure
tracking-plan-mcp/
āāā data/
ā āāā tracking-plans.json # JSON persistence storage
āāā dist/ # Compiled JavaScript output
āāā src/
ā āāā index.ts # MCP Server entry point & tool registration
ā āāā models/
ā ā āāā tracking.ts # TypeScript types, Zod schemas, & ErrorCodes
ā āāā services/
ā ā āāā trackingPlanService.ts # Business logic & event validator
ā āāā storage/
ā ā āāā jsonStorage.ts # Safe JSON storage reader/writer
ā āāā tools/
ā āāā createTrackingPlan.ts # create_tracking_plan tool handler
ā āāā getTrackingPlan.ts # get_tracking_plan tool handler
ā āāā listTrackingPlans.ts # list_tracking_plans tool handler
ā āāā validateTrackingEvent.ts # validate_tracking_event tool handler
āāā tests/
ā āāā createTrackingPlan.test.ts
ā āāā getTrackingPlan.test.ts
ā āāā listTrackingPlans.test.ts
ā āāā validateTrackingEvent.test.ts
āāā .gitignore
āāā package.json
āāā tsconfig.json
āāā vitest.config.ts
āāā README.md
š Quick Start & Development
1. Installation
npm install
2. Run Vitest Unit Tests
npm test
3. Build Project
npm run build
4. Start Server
npm start
āļø MCP Client Configuration
Cursor IDE Configuration
Add to .cursor/mcp.json or Cursor MCP settings:
{
"mcpServers": {
"tracking-plan-mcp": {
"command": "node",
"args": ["C:/Users/FLS/.gemini/antigravity/scratch/tracking-plan-mcp/dist/index.js"]
}
}
}
Antigravity Configuration
Add to .gemini/antigravity/mcp_config.json:
{
"mcpServers": {
"tracking-plan-mcp": {
"command": "node",
"args": ["C:/Users/FLS/.gemini/antigravity/scratch/tracking-plan-mcp/dist/index.js"]
}
}
}
š¬ Example AI Prompts
- "Create an ecommerce GA4 tracking plan."
- "Create a lead generation tracking plan for an HVAC business."
- "Show me all ecommerce tracking plans."
- "Show me all lead generation tracking plans."
- "Validate this purchase event against the ecommerce tracking plan:
{ name: 'purchase', value: 99.99, currency: 'USD' }" - "Validate this lead form submission against the lead generation tracking plan:
{ name: 'generate_lead', form_id: 'f1', form_name: 'Contact Form' }"
š License
Licensed under the MIT License.
Recommended Servers
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.
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.
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.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
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.
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.
Neon Database
MCP server for interacting with Neon Management API and databases
E2B
Using MCP to run code via e2b.
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.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.