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
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。