Skip to main content
Glama

openpanel-mcp-server

npm version License: MIT

MCP server for OpenPanel — the open-source analytics platform. Enables LLMs to track events, manage user profiles, and query analytics data.

Works with self-hosted and cloud OpenPanel instances.

Quick Start

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "openpanel": {
      "command": "npx",
      "args": ["-y", "openpanel-mcp-server"],
      "env": {
        "OPENPANEL_CLIENT_ID": "your-client-id",
        "OPENPANEL_CLIENT_SECRET": "your-client-secret",
        "OPENPANEL_API_URL": "https://your-domain.com/api"
      }
    }
  }
}

Claude Code

claude mcp add openpanel \
  -e OPENPANEL_CLIENT_ID=your-client-id \
  -e OPENPANEL_CLIENT_SECRET=your-client-secret \
  -e OPENPANEL_API_URL=https://your-domain.com/api \
  -- npx -y openpanel-mcp-server

Other MCP Clients

npx openpanel-mcp-server

Related MCP server: posthog-mcp

Configuration

Environment Variable

Required

Default

Description

OPENPANEL_CLIENT_ID

Yes

—

Client ID from your OpenPanel project

OPENPANEL_CLIENT_SECRET

Yes

—

Client secret from your OpenPanel project

OPENPANEL_API_URL

No

https://api.openpanel.dev

API URL (set for self-hosted instances)

Get credentials from your OpenPanel dashboard: Settings → Projects → Select project → Create client (Root type).

Tools

Write Operations

Tool

Description

openpanel_track_event

Track a custom analytics event with properties

openpanel_identify_profile

Create or update a user profile

openpanel_increment_property

Increment a numeric profile property

openpanel_decrement_property

Decrement a numeric profile property

openpanel_alias_profile

Link two profile IDs (e.g. anonymous → authenticated)

Read Operations

Tool

Description

openpanel_get_events

Query events with filters, date ranges, and pagination

openpanel_get_chart

Aggregated analytics: metrics, trends, breakdowns, comparisons

openpanel_health_check

Verify OpenPanel instance connectivity

Usage Examples

Track events:

"Track a purchase event for user-123 with amount 99.99 and currency USD"

Query analytics:

"Show me page views for the last 7 days broken down by country"

Get raw events:

"Get the last 20 signup events from this month"

Chart with filters:

"Compare screen_view counts this week vs last week, broken down by browser"

Development

git clone https://github.com/ubeytd/open-panel-mcp.git
cd open-panel-mcp
npm install
npm test        # 42 tests
npm run build   # compile TypeScript
npm run dev     # watch mode

Architecture

src/
├── index.ts              # Entry point (stdio transport)
├── constants.ts          # Config constants
├── types.ts              # TypeScript interfaces
├── schemas/index.ts      # Zod input validation
├── services/api-client.ts # OpenPanel HTTP client
├── tools/register.ts     # MCP tool definitions
└── __tests__/            # Unit tests
  • Transport: stdio

  • Auth: openpanel-client-id + openpanel-client-secret headers

  • API: OpenPanel public REST API (/track, /export/events, /export/charts, /healthcheck)

  • Validation: Zod schemas with descriptive errors

  • Zero deps: Uses native fetch (Node 18+), no axios/node-fetch

License

MIT

Available Tools

8 tools
openpanel_alias_profileAlias Profile
Idempotent

Link two profile IDs together. Useful for merging anonymous and authenticated profiles.

Args:

  • profile_id (string, required): The primary profile ID

  • project_id (string, required): OpenPanel project ID

  • alias (string, required): The alias profile ID to link (e.g. anonymous session ID)

Returns: Confirmation that the profiles were linked.

Example: Link an anonymous session to a logged-in user.

Inputs: alias (required), profile_id (required), project_id (required).

openpanel_decrement_propertyDecrement Profile Property

Decrement a numeric property on a user profile.

Args:

  • profile_id (string, required): User profile ID

  • project_id (string, required): OpenPanel project ID

  • property (string, required): Property name to decrement (e.g. 'credits')

  • value (number, optional): Amount to decrement by (default: 1)

Returns: Confirmation that the property was decremented.

Inputs: property (required), profile_id (required), project_id (required), value.

openpanel_get_chartGet Chart / Analytics Data
Read-onlyIdempotent

Query aggregated analytics data from OpenPanel. Use this for metrics, trends, and breakdowns.

Args:

  • project_id (string, optional): OpenPanel project ID. If omitted, uses the project linked to your client credentials.

  • events (array, required): Events to analyze. Each: { name, segment?, filters? }

    • name (string): Event name (e.g. 'page_view', 'purchase')

    • segment (string, optional): 'event' | 'user' | 'session' | 'property_sum' | 'property_average'

    • filters (array, optional): [{ name, operator, value[] }]

      • operator: 'is' | 'isNot' | 'contains' | 'doesNotContain' | 'gt' | 'gte' | 'lt' | 'lte' | 'regex'

  • breakdowns (array, optional): [{ name }] - Properties to break down by (e.g. 'browser', 'country')

  • interval (string, optional): 'minute' | 'hour' | 'day' | 'week' | 'month' (default: 'day')

  • range (string, optional): Time range, e.g. '7d', '30d', '90d', '1y' (default: '30d')

  • start_date (string, optional): Custom start date (ISO). Overrides range.

  • end_date (string, optional): Custom end date (ISO). Overrides range.

  • previous (boolean, optional): Include previous period comparison (default: false)

Returns: Chart data with time series, aggregated values, and breakdowns.

Examples:

  • Page views last 7 days: events=[{name:"page_view"}], range="7d"

  • Signups by country: events=[{name:"signup"}], breakdowns=[{name:"country"}]

  • Unique users per week: events=[{name:"session_start", segment:"user"}], interval="week"

Inputs: events (required), range, end_date, interval, +4 more.

openpanel_get_eventsGet Events
Read-onlyIdempotent

Query tracked events from OpenPanel with filtering and pagination.

Args:

  • project_id (string, optional): OpenPanel project ID. If omitted, uses the project linked to your client credentials.

  • event (string | string[], optional): Event name(s) to filter by

  • profile_id (string, optional): Filter events by user profile ID

  • start (string, optional): Start date in ISO format (e.g. '2025-01-01')

  • end (string, optional): End date in ISO format (e.g. '2025-01-31')

  • page (number, optional): Page number (default: 1)

  • limit (number, optional): Events per page (default: 50, max: 200)

Returns JSON: { "meta": { "count": number, "totalCount": number, "pages": number, "current": number }, "data": [{ "id", "name", "profileId", "properties", "createdAt", "country", "browser", ... }] }

Use 'page' to paginate through large result sets.

Inputs: end, page, event, limit, +3 more.

openpanel_health_checkCheck OpenPanel Health
Read-onlyIdempotent

Check if the OpenPanel instance is healthy and responding.

Returns: { "status": "ok" } if the instance is running.

Use this to verify connectivity before running other tools.

Inputs: no named parameters.

openpanel_identify_profileIdentify User Profile
Idempotent

Create or update a user profile in OpenPanel.

Args:

  • profile_id (string, required): Unique user identifier

  • project_id (string, required): OpenPanel project ID

  • first_name (string, optional): User's first name

  • last_name (string, optional): User's last name

  • email (string, optional): User's email address

  • avatar (string, optional): URL to user's avatar image

  • properties (object, optional): Custom profile properties

Returns: Confirmation that the profile was updated.

Inputs: profile_id (required), project_id (required), email, avatar, +3 more.

openpanel_increment_propertyIncrement Profile Property

Increment a numeric property on a user profile.

Args:

  • profile_id (string, required): User profile ID

  • project_id (string, required): OpenPanel project ID

  • property (string, required): Property name to increment (e.g. 'login_count')

  • value (number, optional): Amount to increment by (default: 1)

Returns: Confirmation that the property was incremented.

Inputs: property (required), profile_id (required), project_id (required), value.

openpanel_track_eventTrack Event

Track a custom analytics event in OpenPanel.

Args:

  • name (string, required): Event name (e.g. 'button_click', 'purchase', 'signup')

  • project_id (string, required): OpenPanel project ID

  • profile_id (string, optional): User profile ID to associate this event with

  • properties (object, optional): Custom key-value properties for the event

Returns: Confirmation that the event was accepted (202 Accepted).

Example: Track a purchase event with amount and currency properties.

Inputs: name (required), project_id (required), profile_id, properties.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      Not graded
      maintenance
      Enables ChatGPT to query and analyze Mixpanel analytics data in real-time. Provides live access to event segmentation and detailed analytics data from your Mixpanel project through natural language.
      -
    • A
      license
      B
      quality
      D
      maintenance
      Enables AI agents to query PostHog analytics data directly via tool calls, including insights, events, feature flags, trends, and persons.
      5
      MIT
    • A
      license
      B
      quality
      B
      maintenance
      Enables AI agents to query self-hosted product analytics, investigate changes with evidence and coverage checks, and use optional management tools for saved reports, goals, and keys.
      20
      1
      MIT