Enterprise Expense Automation System
Enables users to manage company departments, employees, expenses, and performance ratings through a natural language interface in Claude Desktop. It features 12 specialized tools for comprehensive CRUD operations and AI-powered organizational analysis using Google Gemini.
README
🏢Enterprise Expense Automation System using MCP & NLP
A professional Model Context Protocol (MCP) server for tracking company expenses, employees, departments, and performance through natural language conversations with Claude Desktop.
✨ Features
- 12 MCP Tools for complete CRUD operations
- Natural Language Interface through Claude Desktop chatbot
- Employee Management with unique employee numbers (EMP0001, EMP0002, etc.)
- Expense Tracking with categorization and department assignment
- Performance Management with ratings and comments
- AI-Powered Analysis using Google Gemini 2.0 Flash (Latest 2025 Model)
- Duplicate Detection and automatic cleanup
- Safe Delete Operations with cascade support
🏗️ System Architecture

The architecture shows the complete flow from Claude Desktop through the MCP Server to the SQLite database, with AI-powered analysis via Google Gemini.
📊 Database Schema
departments employees expenses performance
├── id ├── id ├── id ├── id
├── name ├── employee_number ├── date ├── employee_id
└── description ├── name ├── amount ├── rating
├── role ├── category ├── month
├── department_id ├── note └── comments
├── salary └── department_id
└── join_date
Current Data:
- 4 Departments (Admin, HR, Tech, BPO)
- 18 Employees with unique employee numbers
- 34 Expense records
- 20 Performance ratings
🚀 Quick Start
Prerequisites
- Python 3.11 or higher
- UV package manager or pip
- Claude Desktop application
- Google Gemini API key
Installation
- Create virtual environment
cd "C:\Users\VH0000812\Desktop\Expense Tracker"
uv venv
.\.venv\Scripts\activate
- Install dependencies
uv pip install -r requirements.txt
- Set up environment variables
Create .env file:
GEMINI_API_KEY=your_google_gemini_api_key_here
- Initialize database with sample data
python scripts\populate_data.py
- Configure Claude Desktop
Add to %APPDATA%\Claude\claude_desktop_config.json:
{
"mcpServers": {
"company-expense-tracker": {
"command": "C:\\Users\\VH0000812\\Desktop\\Expense Tracker\\.venv\\Scripts\\python.exe",
"args": [
"C:\\Users\\VH0000812\\Desktop\\Expense Tracker\\main.py"
],
"env": {
"GEMINI_API_KEY": "your_api_key_here"
}
}
}
}
- Restart Claude Desktop
🛠️ MCP Tools (12 Total)
➕ Create Operations (4)
| Tool | Description | Example |
|---|---|---|
add_department |
Create new departments | "Create Marketing department" |
add_employee |
Add employees with auto employee numbers | "Hire John as Developer in Tech at $100k" |
add_expense |
Track expenses by department | "Add $500 AWS expense to Tech" |
add_performance |
Add performance ratings | "Give Alice 5 stars this month" |
🗑️ Delete Operations (4)
| Tool | Description | Example |
|---|---|---|
delete_employee |
Remove employees by number/name | "Delete employee EMP0015" |
delete_expense |
Delete expense records | "Delete expense ID 45" |
delete_department |
Remove departments (force mode available) | "Force delete Marketing with all data" |
delete_duplicate_employees |
Auto-detect and remove duplicates | "Remove all duplicate employees" |
📋 Query Operations (3)
| Tool | Description | Example |
|---|---|---|
list_employees |
View employees (all or by department) | "Show all HR employees" |
list_expenses |
List expenses with filters | "Show Tech expenses last 30 days" |
get_department_summary |
Comprehensive department stats | "Give me HR summary" |
🤖 AI Analysis (1)
| Tool | Description | Example |
|---|---|---|
analyze_company_with_ai |
AI-powered insights via Gemini | "Which department spends most?" |
💬 Usage Examples
Employee Management
✅ "Hire Sarah as Marketing Manager in Admin at $75,000"
✅ "Show me all Tech department employees"
✅ "Delete employee EMP0017"
✅ "Find and remove all duplicate employees"
Expense Tracking
✅ "Add $1,500 office furniture expense to Admin"
✅ "Show all expenses from last month"
✅ "Delete expense ID 32"
Performance & Analysis
✅ "Give John Smith a 5-star rating with comment 'Excellent work'"
✅ "Show me complete HR department summary"
✅ "Which department has highest salary burden?"
✅ "Analyze expense trends across departments"
📁 Project Structure
Expense Tracker/
├── src/ # Source code modules
│ ├── operations/ # Business logic
│ ├── ai/ # AI integration
│ ├── tools/ # MCP tool definitions
│ ├── database.py # Database config
│ └── __init__.py
├── tests/ # All test files
│ ├── test_tools.py
│ ├── test_delete_functions.py
│ └── test_employee_numbers.py
├── scripts/ # Utility scripts
│ ├── populate_data.py # Initialize data
│ ├── migrate_employee_numbers.py
│ └── db_viewer.py # Interactive viewer
├── docs/ # Documentation
│ ├── QUICK_REFERENCE.md
│ ├── DELETE_TOOLS.md
│ └── COMPLETE_SUMMARY.md
├── config/ # Configuration
│ └── departments.json
├── data/ # Database
│ └── company.db
├── main.py # Entry point
├── requirements.txt
├── .env
├── .gitignore
└── README.md
🧪 Testing
Run tests:
python tests\test_tools.py
python tests\test_delete_functions.py
python tests\test_employee_numbers.py
Interactive database viewer:
python scripts\db_viewer.py
🔧 Configuration
Expense Categories
- Infrastructure, Software Licenses, Training
- Office Supplies, Utilities, Salaries
- Recruitment, Events, Equipment, Maintenance
Employee Number Format
- Auto-generated:
EMP0001,EMP0002, etc. - Unique identifier for each employee
- Used for quick lookups and operations
🔒 Security Features
- ✅ API keys in environment variables
- ✅ Foreign key constraints in database
- ✅ Input validation on all operations
- ✅ Safe delete mode (force flag required for cascade)
- ✅ Duplicate detection and prevention
🆘 Troubleshooting
Claude Desktop not showing tools
- Restart Claude Desktop (right-click tray icon → Quit)
- Check config path in
claude_desktop_config.json - Verify database exists at
data/company.db
Database errors
# Migrate employee numbers
python scripts\migrate_employee_numbers.py
# Reinitialize database
python scripts\populate_data.py
Import errors
# Reinstall dependencies
uv pip install -r requirements.txt
# Check Python version (must be 3.11+)
python --version
📚 Documentation
- Quick Reference:
docs/QUICK_REFERENCE.md - Complete Summary:
docs/COMPLETE_SUMMARY.md - Delete Tools Guide:
docs/DELETE_TOOLS.md - Getting Started:
docs/GETTING_STARTED.md
🎯 Roadmap
- [ ] Update/edit operations for employees and expenses
- [ ] Bulk import/export functionality
- [ ] Monthly and yearly report generation
- [ ] Budget tracking with alerts
- [ ] Employee search by skills/role
- [ ] Expense approval workflow
- [ ] Department budget management
- [ ] API endpoint version
📈 Statistics
🏢 Departments: 4 (Admin, HR, Tech, BPO)
👥 Employees: 18 (with unique employee numbers)
💰 Total Salary: $1,288,000 annually
💳 Expense Records: 34 tracked
⭐ Performance: 20 ratings (avg 4.2/5.0)
🤝 Development
Adding New Tools
- Define function in appropriate module
- Add MCP tool wrapper in
main.py - Test with
tests/test_*.py - Update documentation
Code Style
- Follow PEP 8 guidelines
- Use type hints
- Add docstrings to all functions
- Include error handling
📝 License
Internal use only - Company Expense Tracker
Version: 1.0.0
Last Updated: October 15, 2025
Status: ✅ Production Ready
Maintained by: Company Development Team
For support or questions, see docs/COMPLETE_SUMMARY.md
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。