# OpenPanel MCP

> OpenPanel lets your AI agent manage product analytics and user profiles without you writing code. Use this server to track user actions, identify specific users by ID, and adjust numeric properties like credits or points directly from a chat prompt. It's simple state management for complex behavioral data.

## Overview
- **Category:** marketing-automation
- **Price:** Free
- **Tags:** event-tracking, user-profiles, product-analytics, data-collection, customer-insights, behavioral-data

## Description

*OpenPanel lets your AI agent manage all that product analytics and user profile junk without you having to write a single line of backend code. Look, this thing tracks what users do and keeps their profiles tight, all right from a simple chat prompt. It’s basically state management for complex behavioral data, period.

*First up, when we talk about tracking activity, you gotta get your user identified. You use `identify_user` to register or update a known ID within OpenPanel. This is crucial because it links any anonymous activity the user generates—the clicks, the views—to their actual account. It makes sure that even if they log in from a different device tomorrow, we know exactly who they are talking about.

*Once you've got that identity locked down, tracking events is straightforward. You use `track_event` to record specific user actions, like when someone signs up or views a particular feature. When you call this tool, you don’t just log the event name; you attach custom properties too. This builds out a deep history of how people are actually using your app. For example, if the event is 'Feature Viewed,' you can immediately tag it with which feature page they were on or what device they used.

*When dealing with user profiles, sometimes you gotta adjust numbers—like credits or points. You never want to rely on manual math in a database query; that’s messy. Instead, you use `increment_property` when the score needs to go up, maybe because the user paid for something or earned bonus points. If they burn through resources, you call `decrement_property`. This reliably reduces a numeric property—like account credits or usage limits—on their profile. It keeps your math clean and accurate.

*Beyond just counting clicks and managing scores, OpenPanel lets you paint pictures of who the user is using metadata. You can use this server to apply specific traits—stuff like 'premium_user' or 'beta_tester'—to a profile. This advanced segmentation means you know exactly what kind of audience segment you’re dealing with when you run reports.

*Basically, you’re running the whole show from your chat prompt: You first call `identify_user` to nail down who they are. Then, you use `track_event` and attach properties to record their actions. If they earn something, you fire off `increment_property`. If they spend it, you hit them with `decrement_property`. And if they get a special status, you update that metadata profile right away. You keep all your user data—the history, the scores, the identity—in one place without writing any backend code.

## Tools

### decrement_property
Reduces a numeric property (like credits) on a specific user profile.

### identify_user
Registers or updates a known user ID within OpenPanel for consistent tracking.

### increment_property
Raises a numeric property (like points) on a specific user profile.

### track_event
Records a new, named event and its associated properties for an individual user.

## Prompt Examples

**Prompt:** 
```
Track a 'Sign Up' event for user 'user_99' with property 'source' as 'web'.
```

**Response:** 
```
I've recorded the 'Sign Up' event for user_99. The event has been sent to OpenPanel with the source property set to web.
```

**Prompt:** 
```
Identify user 'alex_123' and set their email to 'alex@example.com'.
```

**Response:** 
```
User alex_123 has been identified and their profile has been updated with the email alex@example.com.
```

**Prompt:** 
```
Increment the 'credits' property by 50 for profile 'pro_user_01'.
```

**Response:** 
```
Successfully incremented the 'credits' property by 50 for profile pro_user_01.
```

## Capabilities

### Track User Actions
Records specific user events (like 'Sign Up' or 'Feature Viewed') along with custom properties, building a history of application usage.

### Link Anonymous Activity to Users
Assigns unique identifiers to event streams, linking anonymous activity to known user accounts for accurate profile tracking.

### Adjust Numeric Profile Scores
Increments or decrements numerical properties on a user's profile. Use this when points, credits, or usage limits need precise math updates.

### Set Custom User Metadata
Applies specific traits (like 'premium_user' or 'beta_tester') to a user's profile for advanced segmentation and filtering.

## Use Cases

### A user completes a tutorial.
The PM wants to log this milestone. Instead of writing logging code, they prompt: 'Track an event called 'Tutorial Complete' for user X.' The agent runs `track_event`, capturing the action and letting the team build reports immediately.

### A user earns a reward.
The system triggers a bonus. The Dev calls: 'Increment property 'points' by 50 for user Y.' This runs `increment_property` instantly, updating the user's score without needing to hit a custom API endpoint.

### An anonymous session converts.
The service detects an unknown user who just signed up. The agent first calls `identify_user` with the new email and then follows it up by calling `track_event` for 'Sign Up' to ensure everything is linked correctly.

### A paid trial expires.
The system needs to downgrade a user. The Growth Hacker prompts: 'Decrement property 'credits' by 10.' This runs `decrement_property`, accurately reducing the usage counter and flagging the profile status.

## Benefits

- You don't need to write code just to log a feature view. Calling `track_event` lets you record specific user actions and custom properties instantly, giving you better insights into app usage.
- Managing credits or points is simple math. Use `increment_property` and `decrement_property` to adjust numeric values on a profile without worrying about database transactions or complex endpoints.
- You maintain user identity across sessions. The `identify_user` tool links event data to specific individuals, ensuring that every action you track belongs to the right person.
- Quickly segment your audience by setting traits. By using OpenPanel's capabilities through the agent, you can enrich profiles with custom metadata for better analysis.
- It works across your whole stack. Whether you’re in VS Code or a CLI script, your agent sends data to OpenPanel via these tools—no matter where the call originates.

## How It Works

The bottom line is: your AI agent speaks to your analytics platform using predefined tools; you don't write code for the interaction.

1. Subscribe to the OpenPanel server and enter your API Key. This connects your AI client to your analytics dashboard.
2. Your agent sends a natural language prompt (e.g., 'Give user X 10 points').
3. The MCP Server translates that command into tool calls (`increment_property`), executes them against OpenPanel, and confirms the action.

## Frequently Asked Questions

**How do I track an event using the OpenPanel MCP Server?**
You call the `track_event` tool. You need to provide a specific name for the event and any custom properties (like 'source' or 'page') you want attached to it.

**Does OpenPanel MCP Server require I know the user ID beforehand?**
It's best practice to run `identify_user` first. This ensures that any subsequent calls, like those using `increment_property`, are linked to the correct and stable profile.

**Can I use OpenPanel MCP Server for anything other than numbers?**
The `increment_property` and `decrement_property` tools only handle numeric data. For non-numeric metadata, stick to setting traits or using custom properties within `track_event`.

**What if I need to reset a user's score?**
The available tools don't support a 'reset' function directly. You have to calculate the difference and use two calls: one for `decrement_property` (to reduce it) and then another call to set the new base value, if required.

**What credentials does OpenPanel MCP Server require for calling tools like `track_event`?**
You need an API Key from your OpenPanel account. This key authenticates the connection, ensuring that all actions—whether tracking events or updating properties—are tied back to your specific user organization.

**Are there any rate limits when using OpenPanel MCP Server's property management tools?**
The server enforces standard API rate limiting. If you send too many requests, the client will receive a 429 error code, telling you exactly how long to wait before trying again.

**When using `identify_user`, how does OpenPanel MCP Server handle profile consistency if the user's primary identifier changes?**
The server uses a combination of provided identifiers (email, name, etc.) and historical data to match profiles. If you provide multiple identifying markers, it prioritizes linking them to the most complete record.

**Does OpenPanel MCP Server validate parameters for tools like `increment_property` before execution?**
Yes, the server validates input types and required fields. If you attempt to use an invalid data type or omit a mandatory property name, it sends back a specific validation error instead of failing silently.

**How do I track a specific user action like a button click?**
Use the `track_event` tool. Provide the event name (e.g., 'Button Clicked') and optionally include a `profile_id` and custom `properties` to add context to the action.

**Can I update user profile information or traits?**
Yes! Use the `identify_user` tool with the user's `profile_id`. You can pass a JSON object of `properties` to set or update traits like email, name, or subscription status.

**How do I manage numeric counters like 'points' or 'credits' for a user?**
You can use `increment_property` to increase a value or `decrement_property` to decrease it. Just specify the `profile_id`, the `property` name, and the `value` to change.