EmpLeaveMgmt-Claude-MCP-Server

prphub/EmpLeaveMgmt-Claude-MCP-Server

3.2

If you are the rightful owner of EmpLeaveMgmt-Claude-MCP-Server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

A Claude-compatible MCP Server for managing employee leave data via natural language.

Tools
  1. get_leave_balance

    Check remaining leave days

  2. get_leave_history

    View historical leave dates

  3. apply_leave

    Apply for one or more leave dates

๐Ÿ—๏ธ Employee Leave Management - MCP Server

A Claude-compatible MCP Server for managing employee leave data via natural language.

Built with:

  • โœ… MCP (Model Context Protocol)
  • โœ… Python + Typer
  • โœ… CSV-based persistence (one source of truth)
  • โœ… Claude-compatible tool definitions

๐Ÿ“ฆ Features

ToolDescription
get_leave_balance(employee_id)Check remaining leave days
get_leave_history(employee_id)View historical leave dates
apply_leave(employee_id, leave_dates)Apply for one or more leave dates
ResourceDescription
greeting://{name}Friendly onboarding message

๐Ÿ“ Folder Structure

EmpLeaveMgmt-Claude-MCP-Server/
โ”œโ”€โ”€ data/
โ”‚   โ””โ”€โ”€ employee_leaves.csv      # Single CSV file for persistence
โ”œโ”€โ”€ main.py                      # MCP tool definitions
โ”œโ”€โ”€ .venv/                       # Virtual environment
โ”œโ”€โ”€ pyproject.toml               # Project metadata (via `uv`)
โ”œโ”€โ”€ uv.lock                      # Dependency lock file
โ””โ”€โ”€ README.md                    # You are here!

โš™๏ธ Pre-requisites

  • โœ… Python 3.10+
  • โœ… uv (pip install uv)
  • โœ… Claude Desktop App with Developer mode enabled

๐Ÿš€ Setup

1. Clone the repo and navigate into it:
git clone https://github.com/prphub/EmpLeaveMgmt-Claude-MCP-Server.git
cd EmpLeaveMgmt-Claude-MCP-Server
2. Create a virtual environment and activate it:
python -m venv .venv
.venv\Scripts\activate   # Windows
# or
source .venv/bin/activate  # Linux/macOS
3. Install dependencies:
pip install uv mcp typer
uv add "mcp[cli]"

๐Ÿ“„ CSV Format

Your employee_leaves.csv file should look like this:

employee_id,balance,history
E001,18,2024-12-25;2025-01-01
E002,20,
E003,15,2025-03-15;2025-03-16
  • employee_id: Unique ID
  • balance: Integer (leave days remaining)
  • history: Semicolon-separated list of dates

๐Ÿง  Running with Claude (MCP Install)

Make sure .venv is activated, then run:

uv run mcp install main.py

Once tools are installed, Claude can invoke them using natural language, for example:

๐Ÿ—ฃ๏ธ "How many leave days does E002 have left?" ๐Ÿ—ฃ๏ธ "Apply for leave on 2025-07-01 and 2025-07-02 for E003" ๐Ÿ—ฃ๏ธ "Show the leave history of E001"


๐Ÿงช Local Development (Optional)

To test locally with a REST UI:

uv run mcp dev main.py

Then visit: http://localhost:8000/docs


๐Ÿ› ๏ธ Notes

  • Leave data is persisted to employee_leaves.csv
  • Multiple leave dates must be passed as a list of ISO strings (e.g., ["2025-08-01", "2025-08-02"])
  • The CSV is reloaded each time a tool is called (ensures freshness)
  • Claude always sees up-to-date employee state