prphub/EmpLeaveMgmt-Claude-MCP-Server
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.
get_leave_balance
Check remaining leave days
get_leave_history
View historical leave dates
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
Tool | Description |
---|---|
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 |
Resource | Description |
---|---|
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 IDbalance
: 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