Leave Management MCP Server
Allows managing employees and leave requests through the Flask REST API, including employee CRUD operations, leave application, approval/rejection of leave requests, and retrieval of leave balances and history.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Leave Management — Flask + PostgreSQL
Backend for the leave-management application. Flask exposes REST APIs, SQLAlchemy handles persistence, and PostgreSQL stores employees and leave requests.
Architecture
Claude Desktop
|
| MCP / stdio
v
MCP Server
|
| HTTP
v
Flask API
|
| SQLAlchemy
v
PostgreSQL :5433Related MCP server: leave-management
Prerequisites
Windows
Python 3.12+
PostgreSQL 17+
PowerShell
1. Create Project and Virtual Environment
mkdir C:\ai_workspace\leave_management
cd C:\ai_workspace\leave_management
python -m venv .venv
.\.venv\Scripts\Activate.ps1If PowerShell blocks activation:
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
.\.venv\Scripts\Activate.ps12. Install Dependencies
python -m pip install Flask Flask-SQLAlchemy Flask-Migrate psycopg2-binary python-dotenv
python -m pip freeze > requirements.txtFor an existing checkout:
.\.venv\Scripts\Activate.ps1
python -m pip install -r requirements.txt3. PostgreSQL Setup
Check PostgreSQL:
psql --version
Get-Service *postgres*This project uses PostgreSQL on port 5433.
Connect:
psql -h localhost -p 5433 -U postgresCreate the database:
CREATE DATABASE leave_management;4. Configure .env
Create .env in the project root:
FLASK_APP=run.py
FLASK_ENV=development
DB_HOST=localhost
DB_PORT=5433
DB_NAME=leave_management
DB_USER=postgres
DB_PASSWORD=YOUR_POSTGRES_PASSWORDDo not commit .env.
Recommended .gitignore:
.venv/
.env
__pycache__/
*.pyc5. Test Database Connection
db_test.py:
from sqlalchemy import create_engine, text
from dotenv import load_dotenv
import os
load_dotenv()
url = (
f"postgresql+psycopg2://"
f"{os.getenv('DB_USER')}:"
f"{os.getenv('DB_PASSWORD')}@"
f"{os.getenv('DB_HOST')}:"
f"{os.getenv('DB_PORT')}/"
f"{os.getenv('DB_NAME')}"
)
engine = create_engine(url)
with engine.connect() as connection:
result = connection.execute(text("SELECT version()"))
print("Database connection successful!")
print(result.scalar())Run:
python db_test.py6. Flask-Migrate
Initialize once:
flask --app run.py db initCreate/apply migrations:
flask --app run.py db migrate -m "Create employees table"
flask --app run.py db upgradeAfter adding the leave-request model:
flask --app run.py db migrate -m "Create leave requests table"
flask --app run.py db upgrade7. Sample Employees
Connect:
psql -h localhost -p 5433 -U postgres -d leave_managementInsert:
INSERT INTO employees
(employee_id, name, email, department, designation, leave_balance, created_at, updated_at)
VALUES
('EMP001', 'Rohit Shinde', 'rohit@example.com', 'Engineering', 'Team Lead', 20, NOW(), NOW()),
('EMP002', 'Amit Sharma', 'amit@example.com', 'HR', 'HR Manager', 15, NOW(), NOW()),
('EMP003', 'Priya Patel', 'priya@example.com', 'Marketing', 'Marketing Executive', 10, NOW(), NOW());Verify:
SELECT employee_id, name, department, leave_balance
FROM employees;8. Run Flask
cd C:\ai_workspace\leave_management
.\.venv\Scripts\Activate.ps1
python run.pyExpected:
Running on http://127.0.0.1:50009. Test Employee API
Invoke-RestMethod `
-Uri "http://127.0.0.1:5000/employees/EMP003" `
-Method GETExpected data includes:
employee_id : EMP003
name : Priya Patel
department : Marketing
leave_balance : 1010. Test Leave API
Apply two days:
$body = @{
employee_id = "EMP003"
start_date = "2026-08-10"
end_date = "2026-08-11"
days = 2
reason = "Personal leave"
leave_type = "Personal"
} | ConvertTo-Json
Invoke-RestMethod `
-Uri "http://127.0.0.1:5000/leave/apply" `
-Method POST `
-ContentType "application/json" `
-Body $bodyThe request should initially have:
status : PendingCheck pending requests:
Invoke-RestMethod `
-Uri "http://127.0.0.1:5000/leave/pending" `
-Method GETApprove using the returned request_id:
$body = @{
approved_by = "EMP001"
} | ConvertTo-Json
Invoke-RestMethod `
-Uri "http://127.0.0.1:5000/leave/request/YOUR_REQUEST_ID/approve" `
-Method POST `
-ContentType "application/json" `
-Body $bodyVerify:
Invoke-RestMethod `
-Uri "http://127.0.0.1:5000/employees/EMP003" `
-Method GETAfter approving 2 days:
leave_balance : 8API Summary
Method | Endpoint | Purpose |
GET |
| List employees |
GET |
| Employee details |
POST |
| Create employee |
PUT |
| Update employee |
DELETE |
| Delete employee |
POST |
| Apply for leave |
GET |
| Employee leave history |
GET |
| Pending leave requests |
GET |
| Leave request details |
POST |
| Approve leave |
POST |
| Reject leave |
Database Verification
SELECT employee_id, name, leave_balance
FROM employees
WHERE employee_id = 'EMP003';SELECT request_id, employee_id, days, status
FROM leave_requests
WHERE employee_id = 'EMP003';Design Principle
The Flask application owns business logic and database access. The MCP server calls Flask APIs instead of directly manipulating PostgreSQL:
MCP → Flask Services → SQLAlchemy → PostgreSQLTool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
CharlieHR MCP server for ChatGPT, Claude and any AI agent: list team members, list time off requests, approve time off request, deny time off request, book time off, record sick day, adjust time off allowance and cancel time off booking in your own CharlieHR account. Cotlet works in the account through your Cloud Browser, a real Chrome where you sign in to CharlieHR yourself; Cotlet does not store your password and you need no CharlieHR API key. About the official CharlieHR API: CharlieHR has an API, but a narrow one, and no official MCP server (checked 20 Oct 2026). A Super Admin creates a Client ID and Client Secret under Company > Integrations > API Access; the API covers team members, leave, offices and teams. Setup and FAQ: https://cotlet.dev/integrations/charliehr-api-mcp-server
MCP server unifying ERPs, CRMs, APIs and knowledge base for Claude, ChatGPT and Gemini.
Timetastic MCP server for ChatGPT, Claude and any AI agent: list wallchart absences, list pending leave requests, approve leave request, decline leave request, book time off, cancel booking, get monthly leave summary and get annual allowance summary in your own Timetastic account. Cotlet works in the account through your Cloud Browser, a real Chrome where you sign in to Timetastic yourself; Cotlet does not store your password and you need no Timetastic API key. About the official Timetastic API: Yes, Timetastic has a REST API with a bearer token, and no official MCP server (checked 20 Oct 2026). Only admin users can get a token, and the API has no endpoints for the monthly and annual summary reports. Setup and FAQ: https://cotlet.dev/integrations/timetastic-api-mcp-server
MCP server exposing klokin time-tracking operations (employees, time entries, stores) to AI clients.
Related MCP Servers
- FlicenseBqualityDmaintenanceA Model Context Protocol server that enables users to manage employee leave through natural language. It provides tools to check leave balances, apply for leave, and view leave history via Claude integration.3-
- FlicenseNot gradedqualityDmaintenanceEnables employees to check leave balance, apply for leave, and view leave history through natural language using Claude Desktop.-
- FlicenseBqualityDmaintenanceEnables managing employee leave requests (apply, view, list leaves) through Claude desktop using natural language.6-
- FlicenseNot gradedqualityDmaintenanceEnables managing employee leave requests, balances, and approvals through natural language with Claude Desktop, using SQLite for persistence and fuzzy name matching.-