Leave Manager
Leave Manager MCP Server
该项目是一个 Python MCP 服务器,用于通过 SQLite 管理员工、请假余额和请假请求。
1. 创建项目
打开 PowerShell 并创建一个项目目录:
mkdir D:\Coding\mcpserver\LeaveManager
cd D:\Coding\mcpserver\LeaveManager在 leave_manager_server 内创建一个 uv Python 项目:
uv init leave_manager_server
cd leave_manager_server
uv add "mcp[cli]>=2.1.1"该项目需要 Python 3.14 或更高版本。uv 会创建 pyproject.toml、uv.lock 以及用于运行服务器的虚拟环境。
Related MCP server: leave_manager
2. 实现服务器
创建 server.py 并添加以下部分:
从
mcp.server.mcpserver导入MCPServer。使用
MCPServer("Leave Manager")创建服务器。定义
Employee和LeaveRequest数据模型。使用绝对路径在
server.py旁边创建一个 SQLite 数据库。初始化
employees和leave_requests表,并在启动时插入示例数据。为员工目录和请假请求添加资源。
添加工具以提交和审批请假、检查余额、列出待审批事项、获取数据库统计信息以及添加员工。
从
__main__块启动服务器:
if __name__ == "__main__":
init_database()
mcp.run()该项目使用 MCP 2.x。旧的 MCP 1.x 导入不适用于此依赖项:
from mcp.server.fastmcp import FastMCP可用的 MCP 2.x 写法是:
from mcp.server.mcpserver import MCPServer
mcp = MCPServer("Leave Manager")3. 直接运行服务器
从项目目录:
cd D:\Coding\mcpserver\LeaveManager\leave_manager_server
uv run server.py服务器使用标准输入/输出进行 MCP 通信,因此在 MCP 客户端连接期间它会保持运行。按 Ctrl+C 停止它。
验证模块无需启动长时间运行的服务器即可正确导入:
uv run python -c "import server; print('Server import valid')"4. 使用 MCP Inspector 进行测试
支持的开发命令是:
cd D:\Coding\mcpserver\LeaveManager\leave_manager_server
uv run mcp dev server.pyMCP Inspector 使用 Node.js。在使用最新版 Inspector 之前,请安装 Node.js 22.19.0 或更高版本。使用以下命令检查版本:
node --version
npm --version不要在这个 Python 项目目录中运行 npm i,因为它没有 package.json。如果 Inspector 报告缺少原生绑定,请清除临时 npx 缓存并重试:
Remove-Item "$env:LOCALAPPDATA\npm-cache\_npx" -Recurse -Force
uv run mcp dev server.py5. 连接 Claude Desktop
Claude Desktop 从以下位置读取其配置:
%APPDATA%\Claude\claude_desktop_config.json添加此服务器条目。如果项目存储在其他位置,请替换路径:
{
"mcpServers": {
"leave-manager": {
"command": "uv",
"args": [
"run",
"--directory",
"D:\\Coding\\mcpserver\\LeaveManager\\leave_manager_server",
"server.py"
]
}
}
}保存配置后重启 Claude Desktop。服务器在首次启动时会在 server.py 旁边创建 leave_manager.db。
可用的 MCP 功能
资源:
employees://allemployee://{employee_id}leave-requests://allleave-requests://employee/{employee_id}leave-requests://status/{status}
工具:
submit_leave_requestapprove_leave_requestcheck_leave_balanceget_p_ending_approvalsget_database_statsadd_employeeThis will add my Config file automaticuv run mcp install server.py --name "leave_manager"
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
MCP server exposing klokin time-tracking operations (employees, time entries, stores) to AI clients.
Create, schedule, and publish social posts, manage accounts, and read analytics as MCP tools.
Remote MCP for AI waiver checks, exception approvals, expiry review, and audit receipts.
MCP server for public_holidays_mcp
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to manage employee leave by checking balances, applying for leave, and viewing history via MCP tools.
- FlicenseNot gradedqualityCmaintenanceEnables natural-language-based employee leave management including leave balance checks, leave applications, approvals, and history retrieval through an MCP-compatible client.
- FlicenseAqualityCmaintenanceExposes employee leave-management operations (add employees, check balance, apply/cancel leave, view history) as MCP tools for AI clients like Claude Desktop to call directly.6
- FlicenseNot gradedqualityBmaintenanceEnables managing employee information, tasks (todos), and company policies via MCP tools and resources.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/AniketDonode/LeaveManager'
If you have feedback or need assistance with the MCP directory API, please join our Discord server