leave_manager

leave_manager

Enables natural-language-based employee leave management including leave balance checks, leave applications, approvals, and history retrieval through an MCP-compatible client.

Category
Visit Server

README

Scope of Work - MCP (Model Context Protocol) Server

Project Overview

leave_manager is a Model Context Protocol (MCP) server that exposes a complete employee leave management workflow as a set of callable tools, enabling natural-language interaction with an HR system through any MCP-compatible client (demonstrated here with Claude Desktop). The project demonstrates hands-on agentic tool-use architecture, going beyond simple request/response patterns to implement a stateful, multi-step approval workflow.

Objectives

  • Design and implement an MCP server using the official Python MCP SDK (FastMCP) to expose backend business logic as LLM-callable tools.
  • Model a realistic two-step HR workflow (request → approval) rather than a single-step CRUD operation, requiring in-memory state management across tool calls.
  • Integrate the server with Claude Desktop via claude_desktop_config.json, using uv for environment and dependency management.
  • Validate end-to-end tool invocation through natural language prompts, confirming correct parameter extraction, state mutation, and error handling.

Core Features / Tools Implemented

  • get_leave_balance(employee_id) — Retrieves an employee's current leave balance and leave history; handles invalid employee IDs gracefully.
  • apply_leave(employee_id, leave_dates) — Submits a leave request for one or more dates; validates against available balance and creates a pending request rather than auto-approving, enabling a manager-review step.
  • get_pending_requests() — Lists all outstanding leave requests awaiting manager approval, supporting the manager-facing side of the workflow.
  • approve_leave(request_id) — Approves a pending request by ID, deducting the leave balance and updating history only at the point of approval (not at submission), modeling a real-world authorization gate.
  • get_leaves_history(employee_id) — Returns an employee's full leave history.

product screenshot product screenshot product screenshot product screenshot product screenshot

Technical Implementation

  • Protocol & SDK: Built using the Model Context Protocol (MCP) Python SDK (mcp[fastmcp]), exposing typed, schema-validated tools (input/output schemas auto-generated from Python type hints).
  • State Management: In-memory data store with a request-ID-based pending-requests queue, separating "submission" state from "approved" state to mirror real HR approval flows.
  • Environment Management: Project dependencies and execution managed via uv (pyproject.toml-based), with the server launched through uv run for reproducible environment isolation.
  • Client Integration: Configured as a local stdio-based MCP server in Claude Desktop (claude_desktop_config.json), verified via Claude Desktop's MCP developer logs (tools/list, initialize, and live tool-call traces).
  • Error Handling: Defensive checks for invalid employee IDs, insufficient leave balance, duplicate/invalid request IDs, and already-processed requests.

Skills Demonstrated

  • Agentic AI / Tool-Calling architecture (MCP protocol, tool schema design)
  • Python backend development (state machines, data validation, error handling)
  • AI client integration and debugging (Claude Desktop config, MCP server logs, uv-based environment isolation)
  • API/tool design principles applicable to production agentic systems (idempotency, separation of request vs. approval state)

Future Enhancements (Optional Roadmap)

  • Persist data to a real database (SQLite/MongoDB) instead of in-memory storage.
  • Add role-based access control (employee vs. manager permissions per tool).
  • Add a reject_leave tool and notification/audit logging for approvals and rejections.
  • Expose as a remote MCP server (HTTP/SSE transport) for multi-user access beyond local Claude Desktop.

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