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.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Leave Management MCP ServerShow me all pending leave requests"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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 → PostgreSQLThis server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
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
- Flicense-qualityCmaintenanceEnables employees to check leave balance, apply for leave, and view leave history through natural language using Claude Desktop.
- FlicenseBqualityCmaintenanceEnables managing employee leave requests (apply, view, list leaves) through Claude desktop using natural language.6
- Flicense-qualityDmaintenanceEnables managing employee leave requests, balances, and approvals through natural language with Claude Desktop, using SQLite for persistence and fuzzy name matching.
Related MCP Connectors
Hosted Amazon Seller Central and Amazon Ads MCP server for Claude, ChatGPT, Cursor, and agents.
Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer
Hosted Amazon Seller and Vendor MCP server for Claude, ChatGPT, Cursor, Codex, Gemini, Copilot.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/rshinde02/leave_management'
If you have feedback or need assistance with the MCP directory API, please join our Discord server