AI Sales Analytics MCP Server
Automates sales data analysis by cleaning CSV, generating AI insights, creating interactive HTML dashboards, exporting PDF reports, and emailing them, all via MCP tools and multi-model AI fallback.
README
β‘ AI Sales Analytics β MCP Automation System
No Power BI Login. No Manual Work. Just drop a CSV and AI does everything.
π― What This Does
| You Do | System Does Automatically |
|---|---|
Drop a .csv file |
Detects it instantly |
| Nothing | Cleans & validates data |
| Nothing | AI generates business insights |
| Nothing | Creates interactive HTML dashboard |
| Nothing | Exports professional PDF report |
| Nothing | Emails report to anyone |
π€ Multi-Model AI Fallback Chain
The system automatically tries each AI provider and falls back if unavailable:
1. π’ NVIDIA NIM β Free, 1000 credits (nvapi-...)
2. π’ Groq β Free, no credit card (gsk_...)
3. π‘ DeepSeek β Near-free credits (sk-...)
4. π΅ Rule-Based β 100% offline, always works
No internet? No API keys? β Rule-based insights still work perfectly!
π Quick Start (5 Minutes)
Step 1 β Install Dependencies
pip install -r requirements.txt
Step 2 β Generate Sample Data (or use your own CSV)
python generate_sample_data.py
Step 3 β Add API Keys (Optional but recommended)
Copy .env.example β .env and fill in your keys:
copy .env.example .env
# Edit .env with your keys
Step 4 β Run the Pipeline!
# Option A: Run once on existing data
python main.py
# Option B: Watch folder (auto-trigger on CSV drop)
python watcher.py
# Option C: Chat with AI agent
python agent.py
π How to Get FREE API Keys
NVIDIA NIM (Recommended β Best free models)
- Go to β https://build.nvidia.com
- Click Login / Sign Up (free account)
- Go to API Keys β Create API Key
- Copy key (starts with
nvapi-) - Add to
.env:NVIDIA_API_KEY=nvapi-xxxxx
Free tier: 1000 inference credits. Model:
meta/llama-3.3-70b-instruct
Groq (Fastest β No credit card)
- Go to β https://console.groq.com
- Sign up with Gmail or GitHub
- Go to API Keys β Create API Key
- Copy key (starts with
gsk_) - Add to
.env:GROQ_API_KEY=gsk_xxxxx
Free tier: Generous rate limits, no card needed. Model:
llama-3.3-70b-versatile
DeepSeek (Very cheap)
- Go to β https://platform.deepseek.com
- Sign up β Go to API Keys β Create
- Add to
.env:DEEPSEEK_API_KEY=sk-xxxxx
π§ Email Setup (Gmail)
- Go to myaccount.google.com
- Security β 2-Step Verification (enable)
- Security β App passwords β Select "Mail" β Generate
- Copy 16-char password (e.g.
abcd efgh ijkl mnop) - Add to
.env:EMAIL_SENDER=you@gmail.com EMAIL_PASSWORD=abcdefghijklmnop EMAIL_RECEIVER=boss@company.com
π Project Structure
AI-PowerBI-MCP-Automation/
β
βββ π data/
β βββ sales.csv β Your input CSV
β βββ cleaned_sales.csv β Auto-generated
β
βββ π reports/ β All outputs here
β βββ dashboard.html β π Open in browser!
β βββ report.pdf β π Professional report
β βββ insights.json β Raw KPI data
β
βββ π incoming/ β DROP CSV HERE for auto-trigger
β
βββ π src/
β βββ ai_engine.py β Multi-model AI fallback
β βββ clean_data.py β Data cleaning
β βββ insights.py β KPI + AI insights
β βββ dashboard.py β HTML dashboard (replaces Power BI)
β βββ export_pdf.py β PDF report
β βββ send_email.py β Email automation
β
βββ π mcp_server/
β βββ server.py β MCP server (AI agent tools)
β
βββ main.py β Run full pipeline
βββ watcher.py β Folder auto-watcher
βββ agent.py β Chat interface
βββ generate_sample_data.py β Generate test data
βββ config.py β All settings & API keys
βββ .env.example β Key template
βββ requirements.txt
π¬ Agent Chat Examples
python agent.py
You β analyze today's sales
π€ β Running FULL PIPELINE...
β
Data cleaned (1200 rows)
β
AI insights via NVIDIA NIM
β
Dashboard created
β
PDF exported
β
Email sent
You β show dashboard
π€ β Opening dashboard in browser...
You β status
π€ β Total Sales: βΉ45,23,400 | Profit: 18.3%
Top Product: Laptop Pro X | Region: West
You β send report
π€ β Email delivered to boss@company.com β
π MCP Server (For AI Agents like Claude)
Add to your Claude Desktop mcp_settings.json:
{
"mcpServers": {
"ai-sales-analytics": {
"command": "python",
"args": ["C:/path/to/mcp_server/server.py"]
}
}
}
Available MCP Tools:
| Tool | Description |
|---|---|
run_full_pipeline |
Run everything end-to-end |
clean_data |
Clean CSV file |
generate_insights |
Get AI insights + KPIs |
create_dashboard |
Build HTML dashboard |
export_pdf |
Generate PDF report |
send_email |
Email the report |
get_status |
Check system status |
π Dashboard Preview
The HTML dashboard includes:
- π° KPI Cards (Sales, Profit, Orders, Avg Order Value)
- π Monthly Sales Trend (interactive line chart)
- π Top 10 Products (horizontal bar chart)
- πΊοΈ Region-wise Sales (donut chart)
- π¦ Category Breakdown (bar chart)
- π§ AI-Generated Insights Panel
Opens in Chrome/Edge/Firefox β NO Power BI, NO Microsoft login!
π Resume Description
AI-Powered Sales Analytics Automation using MCP Server
β’ Built an end-to-end agentic AI pipeline using Python, MCP Server, and multi-model AI
β’ Implemented intelligent fallback: NVIDIA NIM β Groq β DeepSeek β Rule-based insights
β’ Automated CSV ingestion, data cleaning, KPI generation, and interactive dashboard creation
β’ Replaced Power BI with custom Plotly HTML dashboards (no login required)
β’ Integrated watchdog folder monitoring for zero-touch automation
β’ Delivered PDF reports and email notifications via SMTP automation
β’ Exposed pipeline as MCP tools enabling AI agents to analyze data through natural language
π Tech Stack
| Layer | Technology |
|---|---|
| Data | Python + Pandas |
| AI | NVIDIA NIM / Groq / DeepSeek / Rule-based |
| Dashboard | Plotly (interactive HTML) |
| ReportLab | |
| SMTP (Gmail) | |
| Automation | Watchdog |
| AI Protocol | MCP (Model Context Protocol) |
Built with β€οΈ β No Power BI login required. Works 100% locally.
π Web Interface (Addon)
A new interactive web interface is available!
- Run python app.py
- Open http://localhost:8000
- Enjoy Drag & Drop uploads, Multi-Domain support (Sales, Health, Trading), and automatic saving of API keys.
π‘ Power BI Integration (.pbids)
The pipeline now automatically generates an optimized .pbids file. Double-clicking this file opens Power BI instantly connected to your clean data, allowing you to bypass Power Query entirely.
π¨βπ» About the Developers
- Abhishek Maheshwari (Developer): Engineered this pipeline to showcase advanced AI agentic workflows, multi-model LLMs, and Python data engineering.
- Harshit Varshney (Mentor): Google, IBM, and HubSpot Certified. LinkedIn Profile
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.