leave-manager-mcp-server
Enables LLMs to manage employee leave by checking balances, applying for leave, and viewing history.
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
FastMCPserver 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).
- [leave_tools.py](file:///d:/practice/Mcp-server/first-mcp-server/tools/leave_tools.py): Defines MCP tools (
- [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:
- Python (version
3.13or higher) - 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
- Windows (PowerShell):
- 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:
- Ensure Claude Desktop is installed and you've switched it to Developer Mode.
- 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.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。