Customer Health Analyzer MCP Server
Connects to Airtable to discover bases and table schemas, switch between bases, detect customer-related tables, list customers, and read customer/usage/CRM data for health analysis.
Connects to HubSpot CRM as a data source to read contact, deal, and engagement data for customer health scoring and recommendations.
Connects to Zapier webhooks as a data source to aggregate customer data from multiple platforms for health analysis.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Customer Health Analyzer MCP Server
An MCP (Model Context Protocol) server that provides AI-powered customer health analysis tools for GTM (Go-To-Market) teams. Analyzes customer usage, CRM, and support data to provide health scores and actionable recommendations.
Features
AI-Powered Analysis: Uses CrewAI agents with OpenAI GPT for intelligent customer health scoring
Comprehensive Scoring: Analyzes usage, relationship, and support metrics
Actionable Recommendations: Provides specific next steps with priorities and timelines
MCP Integration: Works seamlessly with Claude Desktop and other MCP clients
Real-time Analysis: Process customer data on-demand through MCP tools
Dynamic Data Sources: Connects to HubSpot, Airtable, Zapier, or static data
π Airtable Discovery: Automatically discover all accessible bases and table schemas
π Base Switching: Easily switch between different Airtable bases with one command
π Smart Table Detection: AI-powered identification of customer data tables
Related MCP server: Nous MCP Server
Architecture
CrewAI Multi-Agent System
Data Integration Agents: HubSpot, Airtable, Zapier specialists
Health Analysis Agent: Calculates comprehensive health scores
AI Recommendation Agent: Generates personalized action plans
Orchestrator: Coordinates workflow and data synthesis
Data Sources (Dynamic)
HubSpot CRM: Contact data, deals, engagement metrics
Airtable: Custom customer databases and usage tracking
Zapier: Multi-platform data aggregation via webhooks
Static Data: CSV files for demo/development
Scoring Model
Usage Score (40%): Login frequency, session duration, feature adoption, usage trends
Relationship Score (30%): Contact recency, sentiment, contract status
Support Score (30%): Open tickets, resolution times, sentiment, escalations
Health Status
Healthy (80-100): Customer is engaged and satisfied
At Risk (60-79): Customer needs attention to prevent churn
Critical (0-59): Customer requires immediate intervention
Installation
1. Clone the Repository
git clone https://github.com/tushar-badhwar/gtm-agent-user-health-analyzer.git
cd gtm-agent-user-health-analyzer2. Setup Python Environment
Option A: Using Virtual Environment (Recommended)
# Create virtual environment
python3 -m venv venv
# Activate virtual environment
# Linux/macOS:
source venv/bin/activate
# Windows:
venv\Scripts\activate
# Install dependencies
pip install -r requirements.txtOption B: Using Conda
# Create conda environment
conda create -n customer-health python=3.9
conda activate customer-health
# Install dependencies
pip install -r requirements.txtOption C: System-wide Installation
# Install dependencies globally (not recommended for production)
pip install -r requirements.txt3. Setup Environment Variables
# Copy environment template
cp .env.example .env
# Edit .env file and add your API keys
nano .env # or use your preferred editorRequired environment variables:
OPENAI_API_KEY=your_openai_api_key_here
OPENAI_MODEL=gpt-4o-mini
# Optional - for Airtable integration
AIRTABLE_API_KEY=your_airtable_api_key_here
AIRTABLE_BASE_ID=your_airtable_base_id_here4. Test the Installation
# Test the server starts correctly
python3 server.py
# You should see output like:
# π Customer Health Analyzer MCP Server starting...
# π‘ Server is ready to handle requests from Claude DesktopIf the server starts without errors, press Ctrl+C to stop it and proceed to configuration.
Quick Start
1. Configure MCP Client
Add this server to your MCP client configuration (e.g., Claude Desktop):
For Windows with WSL:
{
"mcpServers": {
"customer-health-analyzer": {
"command": "C:\\Windows\\System32\\wsl.exe",
"args": ["python3", "/home/tbadhwar/gtm-agent-user-health-analyzer/server.py"],
"env": {
"OPENAI_API_KEY": "your_openai_api_key_here",
"OPENAI_MODEL": "gpt-4o-mini",
"USE_STATIC_DATA": "true",
"DEFAULT_DATA_SOURCE": "static",
"AIRTABLE_API_KEY": "your_airtable_api_key_here",
"AIRTABLE_BASE_ID": "your_airtable_base_id_here"
}
}
}
}For Linux/macOS:
{
"mcpServers": {
"customer-health-analyzer": {
"command": "python3",
"args": ["/path/to/gtm-agent-user-health-analyzer/server.py"],
"env": {
"OPENAI_API_KEY": "your_openai_api_key_here",
"OPENAI_MODEL": "gpt-4o-mini",
"USE_STATIC_DATA": "true",
"DEFAULT_DATA_SOURCE": "static",
"AIRTABLE_API_KEY": "your_airtable_api_key_here",
"AIRTABLE_BASE_ID": "your_airtable_base_id_here"
}
}
}
}2. Start the Server
# Start the MCP server
python3 server.py
# Server should start and show:
# π Customer Health Analyzer MCP Server starting...
# π‘ Server is ready to handle requests from Claude Desktop
# Keep this terminal open - the server must run while using Claude Desktop3. Test with Claude Desktop
Once both the server is running and Claude Desktop is configured:
Test data source switching:
"What data sources do I have available?"
"Switch to static data and list all customers"
Test customer analysis:
"Analyze the health of all customers"
"Show me details for customer CUST001"
Test recommendations:
"Give me recommendations for improving customer health"
Available MCP Tools
Core Customer Health Tools
1. set_data_source
Select which data source to use for customer health analysis.
Parameters:
data_source(required): "static", "airtable", "hubspot", or "zapier"
Example:
Use the set_data_source tool with data_source "airtable" to switch to your Airtable database2. get_data_source_status
Show current data source configuration and available options.
Example:
Use the get_data_source_status tool to see which data sources are configured3. analyze_customer_health
Analyze customer health scores for all customers or a specific customer from the currently selected data source.
Parameters:
customer_id(optional): Specific customer ID to analyze (e.g., 'CUST001')format(optional): Output format - 'detailed' or 'summary' (default: 'detailed')
Example:
Use the analyze_customer_health tool to get a complete health analysis for all customers4. list_customers
List all available customers in the currently selected data source.
Example:
Use the list_customers tool to see what customers are available for analysis5. get_customer_details
Get detailed information about a specific customer.
Parameters:
customer_id(required): Customer ID to get details for
Example:
Use the get_customer_details tool with customer_id "CUST001" to see detailed customer information6. get_recommendations
Get AI-powered recommendations for improving customer health.
Parameters:
customer_id(required): Customer ID to get recommendations for
Example:
Use the get_recommendations tool with customer_id "CUST003" to get specific action items for this at-risk customerπ Airtable Discovery & Management Tools
7. discover_airtable_bases
Discover all accessible Airtable bases for the configured API token.
Example:
Use the discover_airtable_bases tool to see all your accessible Airtable bases8. discover_airtable_schema
Discover complete schema (tables and fields) for a specific Airtable base.
Parameters:
base_id(required): Airtable base ID to analyze (e.g., 'appXXXXXXXXXXXXXX')format(optional): Output format - 'summary', 'detailed', or 'json'
Example:
Use the discover_airtable_schema tool with base_id "appXXXXXXXXXXXXXX" to analyze base structure9. find_airtable_customer_tables
Find tables in an Airtable base that likely contain customer data.
Parameters:
base_id(required): Airtable base ID to analyze
Example:
Use the find_airtable_customer_tables tool with base_id "appXXXXXXXXXXXXXX" to find customer tables10. connect_to_airtable_base
π― Key Feature: Connect to a specific Airtable base - all subsequent operations will use this base.
Parameters:
base_id(required): Airtable base ID to connect to
Example:
Use the connect_to_airtable_base tool with base_id "appXXXXXXXXXXXXXX" to switch to this base11. get_current_airtable_base
Show information about the currently connected Airtable base.
Example:
Use the get_current_airtable_base tool to check which base you're currently usingTypical Workflow
Discover bases:
discover_airtable_basesβ See all available basesConnect to base:
connect_to_airtable_baseβ Switch to chosen baseList customers:
list_customersβ See customers in that baseAnalyze health:
analyze_customer_healthβ Get health scoresGet recommendations:
get_recommendationsβ Get action items
Sample Data
The server includes sample data for demonstration:
5 customers with different health profiles:
CUST001: TechCorp Inc (Healthy)
CUST002: DataSolutions LLC (Healthy)
CUST003: StartupXYZ (At Risk)
CUST004: Enterprise Global (Healthy)
CUST005: SmallBiz Co (Critical)
Usage data: Login patterns, feature adoption, session durations
CRM data: Contact history, sentiment, contract details
Support data: Tickets, resolution times, sentiments
Configuration
Environment Variables
# OpenAI Configuration
OPENAI_API_KEY=your_openai_api_key_here
OPENAI_MODEL=gpt-4o-mini
# CRM Integration API Keys
HUBSPOT_API_KEY=your_hubspot_api_key_here
AIRTABLE_API_KEY=your_airtable_api_key_here
AIRTABLE_BASE_ID=your_airtable_base_id_here
ZAPIER_API_KEY=your_zapier_api_key_here
# Data Source Configuration
USE_STATIC_DATA=true # Set to false to use real CRM integrations
DEFAULT_DATA_SOURCE=static # static, hubspot, airtable, zapierData Source Modes
Static Mode (Default): Uses CSV demo data for testing Dynamic Mode: Connects to real CRM systems via CrewAI agents
To switch to dynamic mode:
Add your CRM API keys to .env
Set
USE_STATIC_DATA=falseConfigure your preferred
DEFAULT_DATA_SOURCE
Example Usage with Claude Desktop
π Enhanced Airtable Workflow
Discover and Connect to Your Data:
"Show me all my Airtable bases"
Uses
discover_airtable_basestoolLists all accessible bases with IDs and names
"Connect to my customer database (appXXXXXXXXXXXXXX)"
Uses
connect_to_airtable_basetoolAutomatically analyzes base and recommends customer tables
Switches all tools to use this base
"What's in this base and which tables have customer data?"
Uses
discover_airtable_schematool for complete base analysisUses
find_airtable_customer_tablestool for smart table detection
Classic Health Analysis Workflow
"List all customers in the connected base"
Uses
list_customerstoolShows customers from currently connected Airtable base
"Analyze the health of all our customers"
Uses
analyze_customer_healthtoolReturns comprehensive health scores and recommendations
"Show me details for customer CUST003"
Uses
get_customer_detailstoolReturns usage, CRM, and support data
"What should we do to help our at-risk customers?"
Uses
analyze_customer_healthwith summary formatProvides prioritized action items
"Give me specific recommendations for StartupXYZ"
Uses
get_recommendationstoolReturns AI-generated action plan
Base Management
"Which Airtable base am I currently using?"
Uses
get_current_airtable_basetoolShows current base info and connection status
"Switch to a different base for analysis"
Uses
connect_to_airtable_basewith new base IDAll subsequent tools operate on new base
Example Output
Customer Health Summary Report
================================
Total Customers Analyzed: 4
Average Health Score: 73.5/100
Health Status Distribution:
- Healthy: 2 customers (50.0%)
- At Risk: 1 customers (25.0%)
- Critical: 1 customers (25.0%)
StartupXYZ (ID: CUST003)
Health Score: 45/100 - At Risk
Detailed Scores:
- Usage: 30/100
- Relationship: 25/100
- Support: 70/100
Recommended Actions:
1. Schedule product training session
Priority: HIGH
Timeline: Within 1 week
Reasoning: Low usage indicates need for better product understanding
2. Schedule check-in call with CSM
Priority: HIGH
Timeline: Within 3 days
Reasoning: Poor relationship score indicates need for immediate outreachProject Structure
gtm-agent-user-health-analyzer/
βββ server.py # Main MCP server
βββ src/
β βββ orchestrator.py # CrewAI workflow orchestrator
β βββ agents/
β β βββ data_integration_agents.py # HubSpot, Airtable, Zapier agents
β β βββ health_analysis_agents.py # Health scoring and recommendation agents
β βββ models/
β βββ customer_health.py # Pydantic models
βββ data/
β βββ sample_usage_data.csv # Sample usage metrics
β βββ sample_crm_data.csv # Sample CRM data
β βββ sample_support_data.csv # Sample support data
βββ requirements.txt # Python dependencies
βββ pyproject.toml # Package configuration
βββ mcp.json # MCP server configuration
βββ .env.example # Environment template
βββ README.md # This fileDevelopment
Adding New Data Sources
To integrate with real CRM/support systems:
Extend the
CustomerHealthAnalyzerclass inserver.pyAdd new collection methods for your data sources
Update scoring algorithms as needed
Add new MCP tools for specific integrations
Customizing Scoring
Modify the scoring methods in server.py:
calculate_usage_score()calculate_relationship_score()calculate_support_score()
Testing
# Install in development mode
pip install -e .
# Run the server
python server.py
# Test with MCP client or direct JSON-RPC callsIntegration Roadmap
Phase 2: Real Data Sources
HubSpot CRM integration
Salesforce integration
Support system APIs (Zendesk, Intercom)
Product analytics (Mixpanel, Amplitude)
Phase 3: Advanced Features
Predictive churn modeling
Historical trend analysis
Custom scoring models
Automated alerting via MCP
Troubleshooting
Server won't start:
Check that all dependencies are installed:
pip install -r requirements.txtVerify OPENAI_API_KEY is set in .env file or Claude Desktop config
Ensure Python path is correct in MCP configuration
For WSL: Verify
C:\\Windows\\System32\\wsl.exepath is correct
Tools disappear after usage:
This indicates server crashed due to unhandled exceptions
Restart server: Stop (Ctrl+C) and run
python3 server.pyagainCheck server logs for error details
No customer data:
Verify data files exist in
data/directoryCheck file permissions and format
Use
get_data_source_statustool to verify configurationUse
set_data_sourcetool to switch between static and Airtable
Data inconsistency between tools:
All tools now use consistent data source routing
Use
set_data_sourceto change data source for all toolsRestart server if switching between data sources
AI recommendations not working:
Verify OPENAI_API_KEY is valid
Check internet connectivity
Server will fall back to rule-based recommendations if AI fails
License
This project is licensed under the MIT License - see the LICENSE file for details.
Feel free to use, modify, and distribute this software for any purpose.
Built with MCP, CrewAI, OpenAI GPT, and Python.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
This server cannot be deployed
Maintenance
Related MCP Connectors
Read-only account intelligence for Customer Success and Account Management teams.
AI-native GTM OS for B2B SaaS β account health, pipeline, renewals, territories, and benchmarks.
First Light GTM Engine β B2B market intelligence, account research, and outbound drafting MCP.
Governed data discovery, exact queries, decisions, simulations, and runtime utilities over MCP.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceProvides ML-powered revenue intelligence for sales and customer success teams, enabling lead scoring, churn risk detection, and conversion predictions with explainable feature attribution and production monitoring capabilities.-
- AlicenseNot gradedqualityBmaintenanceProvides a context graph for GTM teams, centralizing data from multiple tools into unified person and company records, and offers MCP tools to retrieve account context, full entity details, and filtered queries.5AGPL 3.0
- AlicenseNot gradedqualityDmaintenanceProduction-oriented customer-retention intelligence that uses deterministic machine learning to predict churn and generate prioritized rescue reports, governed through MCP tools.1MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to query internal business data for insights into customers, revenue, subscriptions, sales, and churn through controlled, read-only MCP tools.-