leave-manager-mcp-server

leave-manager-mcp-server

Enables LLMs to manage employee leave by checking balances, applying for leave, and viewing history.

Category
Visit Server

README

📅 Leave Manager MCP Server

A modern model context protocol (MCP) server built with FastMCP in Python for managing employee leave balances and history. It allows LLMs to query leave balances, submit leave applications, and view leave history for employees.


📂 Project Structure

To maintain clean modularity and scale features independently, tools and resources are separated:

  • [server.py](file:///d:/practice/Mcp-server/first-mcp-server/server.py): Instantiates the FastMCP server object.
  • [tools/](file:///d:/practice/Mcp-server/first-mcp-server/tools): Package directory holding all server tools.
    • [leave_tools.py](file:///d:/practice/Mcp-server/first-mcp-server/tools/leave_tools.py): Defines MCP tools (get_leave_balance, apply_leave, get_leave_history).
  • [resources/](file:///d:/practice/Mcp-server/first-mcp-server/resources): Package directory holding all server resources.
    • [greeting_resources.py](file:///d:/practice/Mcp-server/first-mcp-server/resources/greeting_resources.py): Defines MCP resources.
  • [main.py](file:///d:/practice/Mcp-server/first-mcp-server/main.py): Entrypoint file which registers the tools and resources, and launches the server.

🛠️ Features & API Surface

This MCP server exposes the following tools and resources to LLMs:

Tools

  • get_leave_balance(employee_id: str): Checks how many leave days are remaining for the given employee (e.g., "E001").
  • apply_leave(employee_id: str, leave_dates: list[str]): Submits a leave request for specific dates (e.g., ["2025-04-17", "2025-05-01"]). Validates leave balance and updates the mock database.
  • get_leave_history(employee_id: str): Fetches the log of past leave dates for the employee.

Resources

  • greeting://{name}: A personalized greeting resource that provides instructions on how to use the server.

📋 Prerequisites

Before setting up the project, make sure you have the following installed:

  1. Python (version 3.13 or higher)
  2. uv - An extremely fast Python package manager and resolver.
    • Windows (PowerShell):
      powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
      
    • macOS/Linux:
      curl -LsSf https://astral.sh/uv/install.sh | sh
      
  3. Claude Desktop (optional, for testing the desktop application integration)

🚀 Setup & Usage

1. Install Dependencies

The project uses uv to manage dependencies. Run the following command to add and install required dependencies:

uv add mcp[cli]

2. Run the MCP Server

You have three ways to run and test the server:

A. Basic Run

To run the server directly via standard Python (for testing basic initialization):

uv run python main.py

B. Development & Local Testing (MCP Inspector)

The recommended way to test and debug your tools locally is using the MCP Inspector:

uv run mcp dev main.py

This command starts the server and spins up the web-based MCP Inspector. You can use it to view, call, and debug your tools/resources in a browser UI.

C. Installation into Claude Desktop

To integrate this server directly with your Claude Desktop client:

  1. Ensure Claude Desktop is installed and you've switched it to Developer Mode.
  2. Run the following installation helper command:
uv run mcp install main.py

This automatically locates your Claude Desktop MCP configuration file and adds this server setup. 3. Open or restart Claude Desktop. 4. Click the + (plus) icon/selector in the chat window. You should see LeaveManager listed as an active connector. Claude will now query the server automatically to answer your leave management questions!


📊 Mock Database

The project contains pre-configured mock data for employees (E001 to E010) located in [employeeLeaveData.py](file:///d:/practice/Mcp-server/first-mcp-server/mock_data/employeeLeaveData.py).

Example Employee records:

  • E001: 18 leave days remaining.
  • E002: 20 leave days remaining.
  • E003: 16 leave days remaining.

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
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
Qdrant Server

Qdrant Server

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

Official
Featured