Employee Leave Management MCP Server
Manages employee leave with Claude Desktop via natural language. Enables checking balances, applying, approving, and reviewing leave requests through a Supabase-backed MCP server.
README
Employee Leave Management ā MCP Server
š Check out GenAI and System Design videos
An MCP (Model Context Protocol) server built with FastMCP that connects to a Supabase PostgreSQL database and lets Claude Desktop manage employee leave ā checking balances, applying for leave, approvals, history, and more.
Architecture
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā Claude Desktop (MCP Host) ā
ā ā
ā "How many leaves does EMP001 have left this year?" ā
ā ā
ā Claude āāāŗ get_leave_balance("EMP001", 2025) ā
ā āāā [{Annual: 13 remaining}, {Sick: 8}, ā¦] ā
ā ā
ā Claude: "Aditya has 13 Annual, 8 Sick, and 5 Casual ā
ā leave days remaining for 2025." ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā stdio (subprocess)
ā¼
āāāāāāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāāāāāāā
ā server.py ā ā Supabase (Postgres) ā
ā FastMCP + tools āāāāāāāāāŗā employees ā
ā ā REST ā leave_types ā
ā ā API ā leave_balances ā
āāāāāāāāāāāāāāāāāāāāāāā ā leave_requests ā
āāāāāāāāāāāāāāāāāāāāāāāā
Exposed Tools
| Tool | What it does |
|---|---|
list_leave_types |
All leave categories (Annual, Sick, Casual, ā¦) with default allocation |
list_employees |
Active employees, optional department filter |
get_employee_info |
Look up one employee by code or email |
get_leave_balance |
Remaining / used / total days by employee & year |
apply_for_leave |
Submit a leave request (validates balance & date overlaps) |
get_leave_history |
All requests for an employee, filterable by year/status |
get_leave_request |
Full details of a single request by ID |
cancel_leave_request |
Employee withdraws a pending request |
approve_leave_request |
Manager approves ā auto-deducts days from balance |
reject_leave_request |
Manager rejects with optional note |
Resources
leave://schemaā full schema overview attachable as context
Prompts
leave_assistantā structured conversation starter for the HR assistant
Quick Start
Step 1 ā Create a Supabase project
- Go to https://supabase.com and create a free project.
- After the project is ready, go to Project Settings ā API and copy:
- Project URL ā
SUPABASE_URL - Project API Keys ā
anonpublic key (orservice_rolekey for full access) āSUPABASE_KEY
- Project URL ā
Step 2 ā Set up the database
- In the Supabase Dashboard, open the SQL Editor ā New Query.
- Paste the full contents of
setup_database.sqland click Run.
This creates four tables (employees, leave_types, leave_balances, leave_requests) plus a convenience view (leave_balances_view) and seeds 8 employees with realistic 2025 balances.
Step 3 ā Configure environment variables
cd demo_projects/mcp
cp .env.example .env
# Edit .env with your Supabase URL and Key
.env contents:
SUPABASE_URL=https://your-project-ref.supabase.co
SUPABASE_KEY=your-anon-or-service-role-key
Step 4 ā Install dependencies
uv sync
Step 5 ā Test interactively (without Claude Desktop)
#uv run fastmcp dev server.py
uv run python server.py
# Opens MCP Inspector at http://localhost:6274
Connect to Claude Desktop
Locate the config file
| OS | Path |
|---|---|
| macOS | ~/Library/Application Support/Claude/claude_desktop_config.json |
| Windows | %APPDATA%\Claude\claude_desktop_config.json |
| Linux | ~/.config/Claude/claude_desktop_config.json |
Add the server block
{
"mcpServers": {
"employee-leave": {
"command": "uv",
"args": [
"--directory",
"/absolute/path/to/project_root",
"run",
"python",
"server.py"
]
}
}
}
Important: Use the absolute path in
--directory. You can get it by runningpwdin the project folder.
Note: You may need to provide the full path to the
uvexecutable in thecommandfield. Runwhich uv(macOS/Linux) orwhere uv(Windows) to find it.
Restart Claude Desktop
Quit and reopen Claude Desktop. Click the + ("Add files, connectors, and more") icon in the chat input area, then hover over Connectors ā you should see employee-leave listed there.
Note: Claude for Desktop is not yet available on Linux. Linux users can use the MCP Inspector or build a custom MCP client instead.
Connect to VS Code (GitHub Copilot)
VS Code supports MCP servers natively through GitHub Copilot agent mode. The config format is different from Claude Desktop.
Locate / create the config file
| Scope | File |
|---|---|
| Workspace (team-shared) | .vscode/mcp.json in your project root |
| User profile (all workspaces) | Run MCP: Open User Configuration from the Command Palette |
Add the server block
Create or edit .vscode/mcp.json:
{
"servers": {
"employee-leave": {
"command": "uv",
"args": [
"--directory",
"/absolute/path/to/project_root",
"run",
"python",
"server.py"
]
}
}
}
Note: VS Code uses
"servers"(not"mcpServers") and requires the"type": "stdio"field. Use the absolute path in--directory.
Tip: You may need to provide the full path to
uvin"command". Runwhich uvto find it.
Start the server
- Open the Command Palette (
Ctrl+Shift+P) and run MCP: List Servers. - Select
employee-leaveand choose Start. - When prompted, confirm you trust the server.
- Open the Chat view (
Ctrl+Alt+I), switch to Agent mode, and theemployee-leavetools will be available.
Verify tools are loaded
In the Chat view, select Configure Tools (or the tools icon) to see all tools provided by the employee-leave server and toggle individual tools on/off.
Troubleshooting
If the server fails to start, run MCP: List Servers ā select the server ā Show Output to view logs.
Example Conversations with Claude
You: How many leaves does Aditya have left for 2025?
Claude: [calls get_employee_info("EMP001"), then get_leave_balance("EMP001", 2025)]
Aditya Sharma (EMP001) has:
⢠Annual leave : 13 days remaining (5 used of 18)
⢠Sick leave : 8 days remaining (2 used of 10)
⢠Casual leave : 5 days remaining (1 used of 6)
You: Apply for annual leave for EMP002 from 10th July to 18th July 2025.
Claude: [calls apply_for_leave("EMP002", "Annual", "2025-07-10", "2025-07-18")]
Leave request submitted!
⢠Employee : Priya Nair (EMP002)
⢠Type : Annual
⢠Dates : 10 Jul ā 18 Jul 2025 (7 business days)
⢠Status : Pending
⢠Remaining after approval: 8 Annual days
You: Approve request ID 3.
Claude: [calls approve_leave_request(3)]
Leave request #3 has been approved. 7 days deducted from Priya's Annual balance.
Database Schema
employees -- employee_code, full_name, email, department, position
leave_types -- name, description, default_days
leave_balances -- one row per (employee, leave_type, year)
leave_balances_view -- denormalised view with remaining_days computed
leave_requests -- status: pending | approved | rejected | cancelled
Project Files
demo_projects/mcp/
āāā server.py ā FastMCP server (all tools, resources, prompts)
āāā setup_database.sql ā Run once in Supabase SQL Editor
āāā pyproject.toml ā Dependencies (fastmcp, supabase, python-dotenv)
āāā .env.example ā Copy to .env and fill in credentials
āāā README.md ā This file
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.