Skip to main content
Glama

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.

Build Status Vitest TypeScript MCP SDK License


šŸ“Œ 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:

  1. Ecommerce Businesses: Product views, cart activity, checkout steps, payment info, revenue, and purchase transactions.

  2. Lead Generation & Service Businesses: Service views, form starts, form submissions, lead generation, phone clicks, email clicks, WhatsApp clicks, appointment bookings, and quote requests.


Related MCP server: Knowledge Graph MCP Server

šŸ›ļø 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.

F
license - not found
-
quality - not tested
C
maintenance

Maintenance

–Maintainers
–Response time
–Release cycle
–Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

View all related MCP servers

Related MCP Connectors

  • MCP server for interacting with the Supabase platform

  • MCP server for generating rough-draft project plans from natural-language prompts.

  • MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/webanalyticsprobd-maker/tracking-plan-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server