leave_manager
Enables natural-language-based employee leave management including leave balance checks, leave applications, approvals, and history retrieval through an MCP-compatible client.
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, usinguvfor 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.

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 throughuv runfor 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_leavetool 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.
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。