# Keen MCP

> Keen MCP connects your AI agent directly to event streams and analytics data. Instead of building complex dashboards or writing SQL, you talk to the system and get metrics back instantly. Use this MCP to record custom events, count total actions, calculate averages, and pull specific business insights from all your application activity.

## Overview
- **Category:** developer-tools
- **Price:** Free
- **Tags:** event-streaming, data-aggregation, analytics-api, real-time-data, business-intelligence

## Description

Need to understand what's happening inside your app without pulling up a dozen different dashboard tabs? This MCP lets you do that using nothing but natural conversation. You connect it through Vinkius and give your AI client access to all your event data, treating it like a live chat window for business intelligence. It’s built to handle everything from basic activity tracking—sending custom records the second they happen—to deep dives into performance metrics. Your agent can count total users who completed a step, calculate the average purchase value across different regions, or find out how many unique product IDs were viewed last month. This turns complicated data analysis into simple prompts.

## Tools

### average_property
Calculates the mathematical average of a specified numeric property across events.

### list_collections
Retrieves a list of all event data collections available in your project.

### count_events
Returns the total number of events recorded within a specific collection.

### count_unique
Counts how many distinct, non-repeating values exist for a chosen property.

### list_datasets
Displays all cached datasets that have been saved or generated within your project.

### get_project_details
Retrieves comprehensive metadata and configuration details for the entire Keen project.

### record_event
Sends a custom event payload to a specified collection, logging user actions immediately.

### list_saved_queries
Shows all previously saved analytical queries you can reference by name.

### select_unique
Lists all unique values found for a specific property, helping understand data distribution.

### sum_property
Calculates the total sum of numeric values associated with a chosen property.

## Prompt Examples

**Prompt:** 
```
Record a 'purchase' event with price 99.99 and user 'user_123' in Keen.
```

**Response:** 
```
I've recorded the 'purchase' event to your Keen project. The data has been successfully sent to the 'purchase' collection.
```

**Prompt:** 
```
What is the total count of 'page_view' events?
```

**Response:** 
```
I've run the query. There are a total of 15,432 events in your 'page_view' collection.
```

**Prompt:** 
```
Show me all saved queries in my project.
```

**Response:** 
```
I found 8 saved queries, including 'Daily-Revenue-Summary', 'User-Retention-Analysis', and 'Checkout-Conversion-Funnel'.
```

## Capabilities

### Track and send custom events
Send specific records detailing user actions (like clicks or purchases) to designated collections.

### Calculate event totals and unique counts
Determine the total number of events that occurred, or how many distinct values exist for any given property.

### Compute average and sum metrics
Run calculations to find the arithmetic average or the total sum of numeric properties across your event data.

### View project metadata
Retrieve configuration details, list all existing collections, and see saved queries within your Keen project.

## Use Cases

### Debugging a new feature launch
A developer needs to confirm that the 'checkout' funnel is logging events correctly. They ask their agent to run `record_event` with mock data, and then immediately use `count_events` on the collection to verify the entry exists.

### Quarterly business review prep
A BI Manager needs total revenue figures. They prompt their agent for the `sum_property` of the 'price' field, getting a precise number without ever opening the backend database console.

### Identifying user bottlenecks
A Product Analyst wants to see if users are viewing specific product types. They ask their agent to use `count_unique` on the 'product_category' property, immediately spotting an underutilized category.

### Checking project health and scope
A CTO needs a quick overview of data assets. They prompt for `get_project_details`, instantly seeing the overall status and metadata of every integrated system.

## Benefits

- Stop writing boilerplate SQL queries. Instead, ask your agent for the `sum_property` of revenue last quarter; it runs the calculation instantly, giving you immediate answers without code.
- Never get lost in dashboards again. You can use this MCP to first run a `list_collections` command and see exactly what data streams are available before asking any questions.
- Quickly verify your app's status by using `record_event`. This lets you test if custom event logging is working correctly without needing a dedicated development environment.
- Get deep insights into user behavior. Running `select_unique` shows you every unique value for a property, letting you understand data distribution beyond just counts.
- It saves time by automating the discovery phase. You can use `list_saved_queries` to see what analysis has already been done and reuse those results instead of starting from scratch.

## How It Works

The bottom line is that you get immediate answers about your application's performance without ever touching a database console or writing complex code.

1. First, subscribe to this MCP and provide your unique Keen Project ID and Master Key.
2. Next, connect your AI agent via any compatible client. Your agent now has access to all the event data tools.
3. Finally, ask your agent a question like, 'What was the average order value last week?' and it runs the query for you.

## Frequently Asked Questions

**How do I start tracking new user actions with Keen MCP?**
You use the `record_event` tool. You tell your agent what data to send—like a 'login' event and the associated user ID—and it writes that record directly to the correct collection.

**Can I calculate revenue totals using Keen MCP?**
Yes, you use `sum_property`. You simply ask your agent for the sum of a property like 'price' across all relevant events. It handles the aggregation automatically.

**What is the difference between count_events and count_unique in Keen MCP?**
The `count_events` tool tells you how many total actions happened; `count_unique` tells you how many distinct values exist for a specific field, like unique user IDs.

**Does Keen MCP help me see what data I already have?**
Absolutely. You can use `list_collections` to see every stream of events, and `list_saved_queries` shows you all the existing reports available for reuse.

**Is Keen MCP only for analyzing purchases?**
No. It's designed for any event data. You can use it to track anything from 'page views' to 'support ticket submissions', making it versatile for any app type.