HR MCP服务器添加福利群:解决AI开发者的「MCP实战痛点」一个用于HR操作的模型上下文协议(MCP)服务器,专为与Claude Desktop配合使用而构建。
https://github.com/user-attachments/assets/4cb89115-daf2-4647-81d2-aadd9e0dd29e
此服务器实现了模型上下文协议,为Claude提供结构化的员工数据和HR操作访问。
HR MCP 服务器使Claude能够:
有关详细的架构概述,请参阅 ARCHITECTURE.md。
服务器为Claude提供了以下工具:
get_employee_info通过ID检索特定员工的详细信息,包括个人信息、就业信息、技能、福利等更多内容。
// Example usage:
get_employee_info({ employee_id: "E001" })
// With sensitive information:
get_employee_info({ employee_id: "E001", include_sensitive: true })

search_employees根据各种条件灵活匹配选项来搜索员工。支持按姓名、部门、技能、地点等许多其他字段进行搜索。
// Basic search:
search_employees({
query: { department: "Engineering" }
})
// Advanced search:
search_employees({
query: {
location: "Seattle",
performance_rating: 5
},
options: {
sort_by: "hireDate",
output_format: "detailed"
}
})
// Search with sensitive information:
search_employees({
query: { salary_min: 100000 },
options: { include_sensitive: true }
})

request_global_leave为前往多个国家旅行的员工提交全球休假请求,附带审批链和合规提醒。
// Basic request:
request_global_leave({
employee_id: "E002",
start_date: "2025-05-01",
end_date: "2025-05-15",
reason: "Family vacation",
countries: ["USA", "UK"]
})
// With custom contact info:
request_global_leave({
employee_id: "E002",
start_date: "2025-05-01",
end_date: "2025-05-15",
reason: "Family vacation",
countries: ["USA", "UK"],
contact_info: {
email: "bob.vacation@example.com",
phone: "+1-555-123-4567"
}
})

translate_text自动检测源语言,并将文本从任何语言翻译成指定的目标语言,特别关注HR/HCM术语。
// Basic translation:
translate_text({
text: "Les employés doivent soumettre leurs feuilles de temps avant la fin de la période.",
target_language: "English"
})

该翻译系统处理具有上下文感知的HR特定术语,保留如“福利”、“期间”、“检查”、“职位”等在人力资本管理环境中具有特殊含义的技术术语的意思。
# Clone the repository
git clone https://github.com/yourusername/hr-mcp-server.git
cd hr-mcp-server
# Install dependencies
npm install
# Build the project
npm run build

npm start
通过选择“本地工具(通过stdio)”作为工具类型,并使用指向服务器启动脚本的路径,将Claude Desktop连接到服务器。
通过Claude的界面访问员工数据和HR工具。
/src 目录/src/data/employees.ts要在开发模式下运行:
npx ts-node-esm src/index.ts
服务器组织重点在于干净且易于维护的代码:
MIT
版权所有 (c) 2024
在此授予任何人免费获得本软件及其相关文档文件(“软件”)副本的权利,可以不受限制地使用该软件,包括但不限于使用、复制、修改、合并、发布、分发、再许可和/或销售软件副本,并允许向其提供软件的人在遵守以下条件的前提下这样做:
上述版权声明和本许可声明应包含在软件的所有副本或重要部分中。
本软件按“原样”提供,不附带任何明示或暗示的担保,包括但不限于适销性、特定用途适用性和不侵权的担保。在任何情况下,作者或版权持有者均不对因使用本软件或无法使用本软件而引起的任何索赔、损害或其他责任负责,无论是在合同诉讼、侵权行为或其他方面。