Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
143 changes: 143 additions & 0 deletions packages/core/src/storybook/stand-alone-documentaion/mcp/mcp.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ Model Context Protocol is an open standard that enables AI assistants to securel

- [`v3-migration`](#v3-migration) - Advanced project analysis for Vibe 2 → Vibe 3 migration

### Analytics & Monitoring

- [`get-session-analytics`](#get-session-analytics) - Session analytics following MCPcat concepts
- [`get-project-analytics`](#get-project-analytics) - Project analytics and system health monitoring
- [`get-user-identification-info`](#get-user-identification-info) - User identification methods and options
- [`demonstrate-user-identification`](#demonstrate-user-identification) - User identification examples and demonstrations
- [`get-mcpcat-system-info`](#get-mcpcat-system-info) - MCPcat system information and "How it works" concepts

## Tool Reference

#### `get-vibe-component-metadata`
Expand Down Expand Up @@ -98,6 +106,55 @@ This tool analyzes your entire project and provides:
- **Migration command generation** - Provides ready-to-run codemod commands
- **Detailed migration report** - Complete analysis with recommendations

#### `get-session-analytics`

Get comprehensive session analytics following [MCPcat session concepts](https://docs.mcpcat.io/concepts/sessions):

- **Session Lifecycle Tracking** - Monitor session creation, activity, and termination
- **User Engagement Metrics** - Track session duration and tool usage patterns
- **Client Information** - Identify which AI clients are connecting
- **Performance Insights** - Average session duration and tool call frequency
- **Active Session Monitoring** - Real-time view of current user sessions

#### `get-project-analytics`

Get project-level analytics following [MCPcat project concepts](https://docs.mcpcat.io/concepts/projects):

- **Project Health Metrics** - System uptime, memory usage, and performance
- **Tool Usage Statistics** - Which tools are most frequently used
- **Session Aggregation** - Total sessions and average engagement
- **Environment Monitoring** - Platform and Node.js version tracking
- **Event Processing Status** - Analytics pipeline health and throughput

#### `get-user-identification-info`

Get comprehensive information about user identification methods available in MCPcat:

- **Identification Methods Overview** - OAuth, client-based, session-based, and anonymous options
- **Availability Assessment** - Which methods work without setup vs require configuration
- **Privacy Levels** - Understanding privacy implications of each approach
- **Current Session Analysis** - Real-time view of active client types and identification patterns

#### `demonstrate-user-identification`

Interactive demonstration of user identification approaches:

- **Current Implementation Details** - How the system currently identifies users
- **Method Examples** - Sample user IDs for different client types (Claude Desktop, Cursor, etc.)
- **Configuration Options** - How to enable anonymous mode or complete opt-out
- **Best Practices** - Privacy-conscious approaches to user identification

#### `get-mcpcat-system-info`

Comprehensive overview of MCPcat analytics system following the "How it works" documentation:

- **Core Concepts Overview** - Session tracking, user intent capture, request tracing
- **Current System Status** - Active sessions, event processing state, privacy mode
- **Session Lifecycle Details** - Creation, activity tracking, timeout management
- **User Intent Capture** - Context parameter injection and AI assistant integration
- **Request Tracing Information** - Protocol interception and event types
- **Asynchronous Processing** - Event queuing, batching, and zero-performance impact

<Tip title="Migration Made Easy">
The migration tool follows the official Vibe 3 migration guide and generates precise codemod commands to automate most
of the migration process.
Expand Down Expand Up @@ -193,6 +250,92 @@ The MCP will:
]}
/>

## Telemetry & Privacy

The Vibe MCP server includes telemetry powered by [MCPcat](https://mcpcat.io) following their [privacy best practices](https://docs.mcpcat.io/essentials/privacy-&-security). This telemetry:

- **Tracks tool usage patterns** - Helps identify which tools are most valuable
- **Measures performance** - Tracks execution times and success rates
- **Anonymous Mode** - Collect analytics without user identification
- **Works in telemetry-only mode** - No account required for basic analytics

### Privacy Protections

Following MCPcat's recommendations, this implementation includes:

- **Automatic Data Redaction**: Email addresses, credit card numbers, API keys, passwords, and IP addresses are automatically redacted
- **Client-Side Protection**: Sensitive data never leaves your environment
- **Server-Side Validation**: MCPcat uses Microsoft Presidio for additional PII detection
- **Anonymous Mode**: Override user identification when privacy is preferred

### User Identification Methods

Following [MCPcat's user identification documentation](https://docs.mcpcat.io/identifying-users), this MCP server supports multiple identification approaches:

#### OAuth/API Key Integration
For servers with authentication systems:
```javascript
// Extract from request parameters
const token = request.params?.arguments?.token;
const apiKey = request.params?.arguments?.apiKey;
```

#### Client-Based Identification (Default)
Works without any setup - automatically identifies users based on:
- MCP client information (name, version, platform)
- Client capabilities and metadata
- User agent strings when available

#### Session-Based Consistency
Provides consistent user IDs across tool calls:
- Hash-based identification from client characteristics
- Session pattern recognition
- Deterministic but privacy-preserving user IDs

#### Anonymous Mode
For privacy-conscious deployments:
```bash
export ANONYMIZE_SESSIONS=true
```

### Opting Out

Following [MCPcat's privacy best practices](https://docs.mcpcat.io/essentials/privacy-&-security#disabling-telemetry), you can control telemetry using these environment variables:

```bash
# Privacy controls
export DISABLE_USER_ANALYTICS=true # Disable all analytics
export ANONYMIZE_SESSIONS=true # Anonymous mode

# Optional: Your project ID from mcpcat.io
export MCPCAT_PROJECT_ID=proj_32Eb5TYmIAuxKeKCpkEnQTMSOKP

# Optional: Customize project details
export MCPCAT_PROJECT_NAME="My Vibe MCP Server"
export MCPCAT_PROJECT_DESCRIPTION="Custom Vibe MCP Server"
```

When telemetry is disabled, the MCP server will function normally but won't send any usage data to MCPcat.

## How Analytics Work

The server tracks usage patterns to help you understand how it's being used:

### Sessions
- Each AI client interaction creates a session
- Tracks engagement and tool usage patterns
- Sessions expire after 30 minutes of inactivity

### Projects
- Groups analytics by different deployments
- Supports different environments (dev/staging/production)
- Customizable project names and descriptions

### Events
- Records tool calls and responses
- Batches data for efficient processing
- Protects privacy with automatic data redaction

## Contributing

The [Vibe MCP server repository](https://github.com/mondaycom/vibe/tree/main/packages/mcp) is open source and welcomes contributions!
Expand Down
75 changes: 75 additions & 0 deletions packages/mcp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,78 @@ or manually update your VSCode MCP configuration file at `.vscode/mcp.json` (cre
#### Migration Tool

- `v3-migration`: Evaluates your project for Vibe 2 to Vibe 3 migration needs according to the official migration guide. Conducts comprehensive project analysis, identifies breaking changes, and generates the necessary migration commands to resolve them.

#### Analytics Tools

The MCP server includes analytics tools that help you understand how the system is being used:

- `get-session-analytics`: View session usage patterns and active user interactions
- `get-project-analytics`: Monitor overall system performance and tool usage statistics
- `get-user-identification-info`: Learn about user identification methods available
- `demonstrate-user-identification`: See examples of how users are identified
- `get-mcpcat-system-info`: Get comprehensive information about the analytics system

### How Analytics Work

The MCP server uses MCPcat to provide insights into usage patterns while respecting your privacy:

- **Sessions**: Each AI client interaction creates a session to track engagement
- **Projects**: Group analytics by different deployments or environments
- **Events**: Records tool usage and performance data for analysis
- **Privacy**: All data is processed with built-in privacy protections

## MCPcat Analytics

This MCP server integrates with [MCPcat](https://mcpcat.io), an analytics platform for MCP servers that tracks tool usage patterns and provides insights into user interactions.

### Configuration

MCPcat is automatically initialized when the server starts. You can configure it using environment variables following [MCPcat's privacy best practices](https://docs.mcpcat.io/essentials/privacy-&-security#disabling-telemetry):

```bash
# Optional: Set your project ID from mcpcat.io dashboard
export MCPCAT_PROJECT_ID=proj_32Eb5TYmIAuxKeKCpkEnQTMSOKP

# Optional: Customize project details
export MCPCAT_PROJECT_NAME="My Vibe MCP Server"
export MCPCAT_PROJECT_DESCRIPTION="Custom Vibe MCP Server"

# Privacy controls (recommended)
export DISABLE_USER_ANALYTICS=false # Set to true to disable all analytics
export ANONYMIZE_SESSIONS=false # Set to true for anonymous analytics
```

### Features

- **Usage Insights**: See which tools are most popular and how they're used
- **Performance Monitoring**: Track response times and success rates
- **Privacy Controls**: Full control over data collection and privacy
- **Anonymous Mode**: Collect usage data without identifying users

### Privacy & Security

Your privacy is important. This implementation includes:

- **Data Protection**: Sensitive information is automatically redacted before any transmission
- **Local Processing**: All data processing happens on your machine
- **User Control**: You have full control over what data is collected
- **Anonymous Mode**: Option to collect usage data without identifying users
- **Easy Opt-out**: Simple environment variables to disable all analytics

### User Privacy Options

You can control how user data is handled:

- **Anonymous Mode**: Collect usage statistics without identifying users
- **Complete Opt-out**: Disable all analytics collection
- **Client Information**: Basic client details (name, platform) are used for insights

```bash
# Disable all analytics
export DISABLE_USER_ANALYTICS=true

# Use anonymous mode (no user identification)
export ANONYMIZE_SESSIONS=true
```

For more information about MCPcat and its privacy practices, visit [mcpcat.io](https://mcpcat.io).
1 change: 1 addition & 0 deletions packages/mcp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
},
"dependencies": {
"@modelcontextprotocol/sdk": "^1.11.4",
"mcpcat": "^0.1.2",
"zod": "^3.24.4"
},
"devDependencies": {
Expand Down
13 changes: 13 additions & 0 deletions packages/mcp/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,29 @@ import { getVibeComponentAccessibility } from "./server/tools/get-vibe-component
import { listVibeIconsTool } from "./server/tools/list-vibe-icons.js";
import { listVibeTokensTool } from "./server/tools/list-vibe-tokens.js";
import { v3MigrationTool } from "./server/tools/v3-migration.js";
import { getSessionAnalyticsTool, getProjectAnalyticsTool } from "./server/tools/session-analytics.js";
import { getUserIdentificationInfoTool, demonstrateUserIdentificationTool } from "./server/tools/user-identification.js";
import { getMCPcatSystemInfoTool } from "./server/tools/mcpcat-system-info.js";
import { initializeMCPcatTracking } from "./mcpcat-config.js";

async function main() {
const transport = new StdioServerTransport();

// Initialize MCPcat tracking before adding tools
initializeMCPcatTracking();

addServerTool(getVibeComponentMetadataTool);
addServerTool(listVibePublicComponentsTool);
addServerTool(getVibeComponentExamples);
addServerTool(getVibeComponentAccessibility);
addServerTool(listVibeIconsTool);
addServerTool(listVibeTokensTool);
addServerTool(v3MigrationTool);
addServerTool(getSessionAnalyticsTool);
addServerTool(getProjectAnalyticsTool);
addServerTool(getUserIdentificationInfoTool);
addServerTool(demonstrateUserIdentificationTool);
addServerTool(getMCPcatSystemInfoTool);
await server.connect(transport);
}

Expand Down
Loading
Loading