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
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.
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.
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.
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.