leave-management

leave-management

Enables employees to check leave balance, apply for leave, and view leave history through natural language using Claude Desktop.

Category
Visit Server

README

Leave Management MCP Server

An MCP (Model Context Protocol) server for employee leave management, built with FastMCP and Python.

Features

  • Check leave balance — query remaining leave days for an employee
  • Apply for leave — submit leave requests for specific dates
  • View leave history — retrieve past leave records
  • Greeting resource — personalized greeting endpoint

Prerequisites


Environment Setup

1. Install uv

curl -LsSf https://astral.sh/uv/install.sh | sh

Verify the installation:

uv --version

2. Clone the repository

git clone <your-repo-url>
cd mcp1_leave_management

3. Install Python 3.14

uv will read the .python-version file and auto-install the correct Python version:

uv python install

4. Create a virtual environment

uv venv

5. Activate the virtual environment

# macOS / Linux
source .venv/bin/activate

# Windows
.venv\Scripts\activate

6. Install the mcp dependency

uv add mcp

7. Verify the installation

python -c "from mcp.server.fastmcp import FastMCP; print('MCP installed successfully')"

Running the Server

Standalone (for testing)

python main.py

With MCP Inspector (interactive testing)

npx @modelcontextprotocol/inspector python main.py

Then open http://localhost:5173 in your browser to interact with the tools.


Connecting to Claude Desktop

1. Find your Claude Desktop config file

OS Path
macOS ~/Library/Application Support/Claude/claude_desktop_config.json
Windows %APPDATA%\Claude\claude_desktop_config.json

2. Add the server configuration

Open the config file and add an entry under mcpServers:

{
  "mcpServers": {
    "leave-management": {
      "command": "uv",
      "args": [
        "run",
        "--directory",
        "/absolute/path/to/mcp1_leave_management",
        "python",
        "main.py"
      ]
    }
  }
}

Replace /absolute/path/to/mcp1_leave_management with the actual path on your machine.

3. Restart Claude Desktop

Quit and relaunch Claude Desktop. The leave management tools will appear in the tool panel.


Available Tools

Tool Description Parameters
get_leave_balance Returns remaining leave days employee_id: str
apply_leave Applies leave for given dates employee_id: str, leave_dates: List[str]
get_leave_history Returns past leave dates employee_id: str

Example usage (in Claude)

Check leave balance for employee E001
Apply leave for E002 on 2025-06-10 and 2025-06-11
Show leave history for E001

Mock Data

The server starts with two pre-seeded employees:

Employee ID Initial Balance Pre-existing Leaves
E001 18 days 2024-12-25, 2025-01-01
E002 20 days None

Data is held in memory and resets each time the server restarts.


Project Structure

mcp1_leave_management/
├── main.py           # MCP server and tool definitions
├── pyproject.toml    # Project metadata and dependencies
├── uv.lock           # Locked dependency versions
├── .python-version   # Pinned Python version (3.14)
└── README.md

Terminal setup steps from zero

uv venv --python 3.14 .venv
source .venv/bin/activate
which python
python --version
uv pip install mcp
uv
uv init
uv pip show mcp
uv run mcp install main.py

Recommended Servers

playwright-mcp

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.

Official
Featured
TypeScript
Magic Component Platform (MCP)

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.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

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.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

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.

Official
Featured
TypeScript
Kagi MCP Server

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.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Exa Search

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.

Official
Featured