Enterprise Expense Automation System

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.

Category
Visit Server

README

🏒Enterprise Expense Automation System using MCP & NLP

Python 3.11+ FastMCP Status

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

System Design

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

  1. Create virtual environment
cd "C:\Users\VH0000812\Desktop\Expense Tracker"
uv venv
.\.venv\Scripts\activate
  1. Install dependencies
uv pip install -r requirements.txt
  1. Set up environment variables

Create .env file:

GEMINI_API_KEY=your_google_gemini_api_key_here
  1. Initialize database with sample data
python scripts\populate_data.py
  1. 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"
      }
    }
  }
}
  1. 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

  1. Restart Claude Desktop (right-click tray icon β†’ Quit)
  2. Check config path in claude_desktop_config.json
  3. 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

🎯 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

  1. Define function in appropriate module
  2. Add MCP tool wrapper in main.py
  3. Test with tests/test_*.py
  4. 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

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.

Official
Featured
TypeScript
Magic Component Platform (MCP)

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.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

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.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
Kagi MCP Server

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.

Official
Featured
Python
graphlit-mcp-server

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.

Official
Featured
TypeScript
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

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.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured