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


Related MCP server: Attendance Management MCP Server

🧠 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

Available Tools

3 tools
apply_leaveC
Apply leave for specific dates (e.g., ["2025-04-17", "2025-05-01"])

Inputs: employee_id (required), leave_dates (required). Returns: result

get_leave_balanceC

Check how many leave days are left for the employee

Inputs: employee_id (required). Returns: result

get_leave_historyC

Get leave history for the employee

Inputs: employee_id (required). Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3/5.0

    Scored across 3 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: apply_leave is for submitting new leave requests, get_leave_balance shows remaining leave days, and get_leave_history retrieves past leave records. There is no overlap in functionality, making tool selection straightforward for an agent.

    Naming Consistency5/5

    All tools follow a consistent verb_noun naming pattern (apply_leave, get_leave_balance, get_leave_history) with clear, descriptive names. The pattern is uniform throughout, enhancing readability and predictability.

    Tool Count3/5

    With only 3 tools, the server feels thin for a leave management domain, as it lacks operations like updating or canceling leave requests, viewing team leave calendars, or approving/rejecting leave. While the tools cover basic needs, the scope is borderline minimal.

    Completeness2/5

    The tool set has significant gaps for a leave management system. It includes apply, balance, and history but misses critical operations such as update_leave, delete_leave, list_pending_requests, or approve_leave. This incomplete coverage will likely cause agent failures in real-world workflows.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      D
      quality
      D
      maintenance
      A Model Context Protocol server that enables Claude Desktop to access structured employee data and perform HR operations including employee lookups, searches, and global leave requests.
      3
      1
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      A Model Context Protocol server that enables Claude to interact with a Lucca instance to list employees, departments, and view absences in natural language.
      3
      MIT