Skip to main content
Glama

LeaveManager – MCP Server with Claude Integration

LeaveManager is a custom Model Context Protocol (MCP) server built using FastMCP.
It allows Claude to interact with a backend Leave Management System using natural language.

This project demonstrates how Claude can automatically select and execute backend tools based on user queries.


πŸš€ Features

  • Check employee leave balance

  • Apply leave for specific dates

  • View leave history

  • In-memory state management

  • Claude Desktop integration via MCP

  • Automatic tool selection from natural language


🧠 Tech Stack

  • Python 3.10+

  • FastMCP

  • MCP CLI

  • Claude Desktop (for tool invocation)

  • uv (Python package manager)


πŸ“‚ Project Structure

my-first-mcp-server/ β”‚ β”œβ”€β”€ main.py β”œβ”€β”€ pyproject.toml β”œβ”€β”€ README.md β”œβ”€β”€ .gitignore β”œβ”€β”€ uv.lock └── .venv/


πŸ› οΈ MCP Tools

1️⃣ get_leave_balance

Checks remaining leave days for an employee.

Input:

  • employee_id (string)


2️⃣ apply_leave

Applies leave for given dates and updates balance.

Input:

  • employee_id (string)

  • leave_dates (list of YYYY-MM-DD)


3️⃣ get_leave_history

Returns all leave dates taken by an employee.

Input:

  • employee_id (string)


πŸ’‘ Example Claude Queries

  • β€œCheck leave balance for employee E001”

  • β€œApply leave for employee E001 on 2025-04-17 and 2025-05-01”

  • β€œShow leave history for employee E001”

Claude automatically selects and executes the correct MCP tool.


⚠️ Important Note on Data Storage

  • This project uses in-memory storage

  • Data resets when the MCP server restarts

  • This is intentional for simplicity

  • Can be extended with SQLite for persistence


▢️ Running Locally (Without Claude)

uv run main.py 🎯 Learning Outcomes Built a real MCP server Exposed backend tools to Claude Understood stateful MCP behavior Integrated Python backend with LLM tool calling πŸ“Œ Future Improvements SQLite persistence Date validation & duplicate checks Employee creation & reset tools FastAPI + MCP hybrid architecture πŸ§‘β€πŸ’» Author Uma Maheswara Rao Aspiring AI Engineer / Data Analyst

Latest Blog Posts

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/umamaheswararao04/leavemanager-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server