Sponsored by Deepsite.site

LeaveManager MCP Server

Created By
Jay-Vala7 months ago
A minimal MCP server providing a structured API for a simple leave management system.
Content

LeaveManager MCP Server

A Model Context Protocol (MCP) server for managing employee leave requests, balances, and history. This server provides a simple and efficient way to handle leave management operations through standardized API endpoints.

Features

  • Leave Balance Management: Check remaining leave days for employees
  • Leave Application: Apply for leave on specific dates
  • Leave History: View complete leave history for employees
  • Date Range Support: Apply for multiple consecutive or non-consecutive leave dates
  • Real-time Balance Updates: Automatic balance updates after leave applications

Available Functions

1. Get Leave Balance

Check the remaining leave days for a specific employee.

{
  "function": "get_leave_balance",
  "parameters": {
    "employee_id": "string"
  }
}

Response: Returns the number of leave days remaining for the employee.

2. Apply Leave

Submit a leave application for specific dates.

{
  "function": "apply_leave",
  "parameters": {
    "employee_id": "string",
    "leave_dates": ["2025-06-03", "2025-06-04"]
  }
}

Response: Confirms leave application and returns updated balance.

3. Get Leave History

Retrieve the complete leave history for an employee.

{
  "function": "get_leave_history",
  "parameters": {
    "employee_id": "string"
  }
}

Response: Returns chronological list of all leave applications and their status.

Usage Examples

Check Leave Balance

curl -X POST http://localhost:3000/mcp \
  -H "Content-Type: application/json" \
  -d '{
    "method": "get_leave_balance",
    "params": {
      "employee_id": "E001"
    }
  }'

Apply for Single Day Leave

curl -X POST http://localhost:3000/mcp \
  -H "Content-Type: application/json" \
  -d '{
    "method": "apply_leave",
    "params": {
      "employee_id": "E001",
      "leave_dates": ["2025-06-03"]
    }
  }'

Apply for Multiple Days Leave

curl -X POST http://localhost:3000/mcp \
  -H "Content-Type: application/json" \
  -d '{
    "method": "apply_leave",
    "params": {
      "employee_id": "E001",
      "leave_dates": ["2025-06-03", "2025-06-04", "2025-06-05"]
    }
  }'

Date Format

All dates should be provided in ISO 8601 format: YYYY-MM-DD

Examples:

  • 2025-06-03 (June 3rd, 2025)
  • 2025-12-25 (December 25th, 2025)

Error Handling

The server provides detailed error responses for common scenarios:

  • Invalid Employee ID: Returns error if employee doesn't exist
  • Insufficient Leave Balance: Prevents leave application if insufficient days remaining
  • Invalid Date Format: Returns error for malformed dates
  • Past Date Application: Prevents application for dates in the past
  • Duplicate Leave Application: Prevents applying for already approved dates

API Response Format

Success Response

{
  "success": true,
  "data": {
    "message": "Leave applied for 1 day(s). Remaining balance: 17."
  }
}

Error Response

{
  "success": false,
  "error": {
    "code": "INSUFFICIENT_BALANCE",
    "message": "Insufficient leave balance. Required: 3, Available: 2"
  }
}

License

This project is licensed under the MIT License - see the LICENSE file for details.

Changelog

v1.0.0

  • Initial release
  • Basic leave management functionality
  • Employee balance tracking
  • Leave application system
  • Leave history retrieval

Note: This is an MCP (Model Context Protocol) server designed to work with AI assistants and automation tools.

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Serper MCP ServerA Serper MCP Server
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
CursorThe AI Code Editor
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Amap Maps高德地图官方 MCP Server
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
DeepChatYour AI Partner on Desktop
ChatWiseThe second fastest AI chatbot™
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Playwright McpPlaywright MCP server
WindsurfThe new purpose-built IDE to harness magic
Tavily Mcp
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.