Skip to main content
Glama
Surya-KF

Enterprise Expense Automation System

by Surya-KF

🏒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

-
security - not tested
F
license - not found
-
quality - not tested

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Surya-KF/Enterprise-Expense-Automation-System-using-MCP-NLP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server