anupn121/lifesight_mcp_server
If you are the rightful owner of lifesight_mcp_server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
A direct MCP server integration for Claude Desktop accessing Lifesight Marketing Mix Modeling APIs.
Lifesight MCP Claude
A direct MCP (Model Context Protocol) server integration for Claude Desktop accessing Lifesight Marketing Mix Modeling APIs.
Features
- Direct Claude Desktop Integration: Seamless integration with Claude Desktop via MCP protocol
- 15+ Marketing Analytics Tools: Access to comprehensive Lifesight MMM APIs
- Simple Authentication: Works with API keys or session cookies
- TypeScript: Fully typed for better development experience
- Pure MCP Server: Clean, focused implementation without additional complexity
Quick Start
-
Install dependencies:
npm install -
Set up authentication:
Option A - Auto-Refresh (Recommended):
export FIREBASE_AUTH_URL="https://identitytoolkit.googleapis.com/v1/accounts:signInWithPassword?key=YOUR_API_KEY" export FIREBASE_EMAIL="your-email@example.com" export FIREBASE_PASSWORD="your-password"Option B - Manual Token:
export LIFESIGHT_BEARER_TOKEN="your-jwt-bearer-token" -
Build the server:
npm run build -
Configure Claude Desktop: Add to your
claude_desktop_config.json:With Auto-Refresh (Recommended):
{ "mcpServers": { "lifesight": { "command": "node", "args": ["/path/to/lifesight-mcp-claude/dist/index.js"], "env": { "FIREBASE_AUTH_URL": "https://identitytoolkit.googleapis.com/v1/accounts:signInWithPassword?key=YOUR_API_KEY", "FIREBASE_EMAIL": "your-email@example.com", "FIREBASE_PASSWORD": "your-password", "LIFESIGHT_BASE_URL": "https://console.platform.lifesight.io" } } } }With Manual Token:
{ "mcpServers": { "lifesight": { "command": "node", "args": ["/path/to/lifesight-mcp-claude/dist/index.js"], "env": { "LIFESIGHT_BEARER_TOKEN": "your-jwt-bearer-token", "LIFESIGHT_BASE_URL": "https://console.platform.lifesight.io" } } } }
Authentication
The server supports two authentication methods:
Option 1: Automatic Token Refresh (Recommended)
Configure Firebase authentication credentials and the server will automatically:
- Fetch a fresh token on startup
- Refresh the token every 15 minutes
- Handle authentication transparently
export FIREBASE_AUTH_URL="https://identitytoolkit.googleapis.com/v1/accounts:signInWithPassword?key=YOUR_API_KEY"
export FIREBASE_EMAIL="your-email@example.com"
export FIREBASE_PASSWORD="your-password"
Benefits:
- ✅ No manual token management
- ✅ Tokens never expire during use
- ✅ Transparent to Claude Desktop
- ✅ Works indefinitely without restarts
Option 2: Manual Bearer Token
Provide a JWT token directly (expires in 1 hour):
export LIFESIGHT_BEARER_TOKEN="your-jwt-bearer-token"
Note: You'll need to update the token and restart the server every hour.
Base URL Configuration:
export LIFESIGHT_BASE_URL="https://console.platform.lifesight.io" # Production
# or
export LIFESIGHT_BASE_URL="https://console-platform-stg.lifesight.io" # Staging
Available Tools (15 Total)
Model Management (2 tools)
Essential for discovering and configuring models:
lifesight_list_models- Discover available models and get mmmRequestId for other APIslifesight_get_model_config- Understand channel mappings and attribution configuration
Analytics (6 tools)
Core attribution and performance analysis:
lifesight_get_model_performance- Validate model accuracy (actual vs predicted)lifesight_get_channel_attribution- Incremental revenue attribution by channellifesight_get_marketing_efficiency- Compare spend share vs effect sharelifesight_get_channel_hierarchy- Channel organization and parent-child relationshipslifesight_get_campaign_insights- Campaign performance within date rangeslifesight_get_cost_structure- Business profitability and cost analysis
Advanced Analytics (8 tools)
Optimization and deep-dive analysis:
lifesight_calculate_marginal_roas- Incremental ROAS for budget optimizationlifesight_get_budget_recommendations- AI-powered budget allocation advicelifesight_get_seasonality_analysis- Time series decomposition and seasonal patternslifesight_get_model_quality_score- Model reliability and accuracy assessmentlifesight_get_validation_data- Holdout performance and model generalizationlifesight_get_correlation_analysis- Variable relationships and channel interactionslifesight_get_aggregated_insights- Executive summary and key findingslifesight_get_contribution_data- Detailed channel contribution breakdown
Common Workflows
The tools are designed to work together in logical sequences. Here are the most common workflows:
1. Complete MMM Analysis
Perfect for quarterly reviews and comprehensive analysis:
lifesight_list_models → lifesight_get_model_performance →
lifesight_get_channel_attribution → lifesight_get_marketing_efficiency →
lifesight_calculate_marginal_roas → lifesight_get_aggregated_insights
2. Budget Optimization
Focused on reallocation and investment decisions:
lifesight_list_models → lifesight_get_marketing_efficiency →
lifesight_calculate_marginal_roas → lifesight_get_budget_recommendations
3. Model Validation
Ensuring model quality before business decisions:
lifesight_list_models → lifesight_get_model_performance →
lifesight_get_model_quality_score → lifesight_get_validation_data
4. Campaign Analysis
Deep-diving into specific time periods:
lifesight_list_models → lifesight_get_campaign_insights →
lifesight_get_channel_attribution → lifesight_get_contribution_data
📖 See for detailed workflow documentation with step-by-step guides and parameter examples.
Key Parameters
Most APIs require these common parameters:
mmmRequestId- Model identifier (get fromlifesight_list_models)modelId- Also fromlifesight_list_models(used in advanced analytics)solId- Solution ID (commonly "10_301_2" or from model config)- Date formats - Always YYYY-MM-DD (e.g., "2024-01-01")
- Granularity - "weekly" (default), "daily", "monthly"
Testing
Test the MCP server connection:
npm test
Example Usage with Claude Desktop
Once configured, you can ask Claude questions like:
Model Discovery & Validation
- "Show me all available MMM models and their training periods"
- "Validate the performance of model 5393546988224512 and check its quality score"
- "What channels are included in the latest model configuration?"
Attribution Analysis
- "Which marketing channels are driving the most incremental revenue?"
- "Compare spend efficiency across all channels - which ones are over or under-invested?"
- "Show me the channel hierarchy and attribution breakdown"
Budget Optimization
- "Calculate marginal ROAS for all channels and recommend budget reallocation"
- "What budget allocation would you recommend for next quarter?"
- "Which channels have the best next-dollar returns?"
Campaign Analysis
- "Analyze campaign performance from 2024-01-01 to 2024-03-31"
- "How did seasonality affect our Q4 performance vs other quarters?"
- "Show me the detailed contribution analysis for our recent campaigns"
Executive Reporting
- "Give me an executive summary of our MMM analysis with key insights"
- "What are the top 3 marketing recommendations based on the model?"
- "Create a high-level report on our marketing efficiency and attribution"
The MCP server automatically provides rich context about when to use each API, what parameters are required, and how the results should be interpreted for business decisions.
Development
npm run dev: Build and watch for changesnpm run build: Compile TypeScriptnpm test: Run test suite