Skip to main content
Glama
gabrielrojasnyc

HR MCP Server

HR MCP 服务器

为配合 Claude Desktop 使用而构建的人力资源操作模型上下文协议 (MCP) 服务器。

https://github.com/user-attachments/assets/4cb89115-daf2-4647-81d2-aadd9e0dd29e

概述

该服务器实现了模型上下文协议,为 Claude 提供对员工数据和人力资源操作的结构化访问。

HR MCP 服务器使 Claude 能够:

  • 查找详细的员工信息

  • 按各种条件搜索员工

  • 提交和管理全球休假申请

  • 利用 HR/HCM 语境感知功能翻译文本

有关详细的架构概述,请参阅ARCHITECTURE.md 。

系统设计

Related MCP server: LeaveManager

工具

服务器为Claude提供了以下工具:

1. get_employee_info

通过 ID 检索特定员工的详细信息,包括个人信息、就业信息、技能、福利等。

// Example usage:
get_employee_info({ employee_id: "E001" })

// With sensitive information:
get_employee_info({ employee_id: "E001", include_sensitive: true })

2. 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 } 
})

3. 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" 
  } 
})

4. 翻译提示: 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" 
})

该翻译系统通过语境感知来处理人力资源特定术语,保留“福利”、“时期”、“检查”、“职位”等在人力资本管理语境中具有特殊含义的术语的技术含义。

安装

# 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

用法

  1. 启动服务器:

npm start
  1. 通过选择“本地工具(通过 stdio)”作为工具类型并使用服务器启动脚本的路径将 Claude Desktop 连接到服务器。

  2. 通过 Claude 的界面访问员工数据和人力资源工具。

发展

  • 源代码位于/src目录中

  • 员工数据存储在/src/data/employees.ts

  • 服务器使用 TypeScript 并进行严格类型设置

要在开发模式下运行:

npx ts-node-esm src/index.ts

技术栈

代码结构

该服务器的组织重点是干净、可维护的代码:

  • 集中日志记录- 一致的 JSON-RPC 格式日志记录

  • 基于工具的架构——每个工具都有明确的职责

  • 模式验证- 使用 Zod 对所有输入进行强类型验证

  • 错误处理——通过清晰的错误消息进行全面验证

  • 文档- 解释复杂逻辑的内联注释

执照

麻省理工学院

版权所有 (c) 2024

特此授予获得此软件和相关文档文件(“软件”)副本的任何人免费许可,以无限制方式处理软件,包括但不限于使用、复制、修改、合并、发布、分发、再授权和/或销售软件副本的权利,并允许向其提供软件的人员这样做,但须遵守以下条件:

上述版权声明和本许可声明均应包含在软件的所有副本或实质性部分中。

本软件按“原样”提供,不附带任何形式的明示或暗示保证,包括但不限于适销性、适用于特定用途和非侵权性的保证。在任何情况下,作者或版权所有者均不对因本软件或使用或以其他方式处理本软件而引起的或与之相关的任何索赔、损害或其他责任承担责任,无论是合同、侵权或其他诉讼。

Available Tools

3 tools
get_employee_infoD
ParametersJSON Schema
NameRequiredDescriptionDefault
employee_idYesThe ID of the employee to retrieve information for
include_sensitiveNoWhether to include sensitive information like SSN (default: false)

TDQS

D1/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Tool has no description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness1/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Tool has no description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Tool has no description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Tool has no description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose1/5

Does the description clearly state what the tool does and how it differs from similar tools?

Tool has no description.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Tool has no description.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

request_global_leaveD
ParametersJSON Schema
NameRequiredDescriptionDefault
contact_infoNoContact information during leave
countriesYesCountries for which leave is being requested (e.g., ["USA", "UK"])
employee_idYesThe ID of the employee requesting leave
end_dateYesEnd date of the leave (YYYY-MM-DD)
reasonYesReason for the leave request
start_dateYesStart date of the leave (YYYY-MM-DD)

TDQS

D1/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Tool has no description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness1/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Tool has no description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Tool has no description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Tool has no description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose1/5

Does the description clearly state what the tool does and how it differs from similar tools?

Tool has no description.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Tool has no description.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_employeesD
ParametersJSON Schema
NameRequiredDescriptionDefault
optionsNoSearch options
queryYesSearch parameters - provide at least one field

TDQS

D1/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Tool has no description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness1/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Tool has no description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Tool has no description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Tool has no description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose1/5

Does the description clearly state what the tool does and how it differs from similar tools?

Tool has no description.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Tool has no description.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 3 tool updatesv1.0.0
    • First observedget_employee_info
    • First observedrequest_global_leave
    • First observedsearch_employees

TDQS

D1.8/5.0

Scored across 3 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: get_employee_info retrieves specific employee details, request_global_leave handles leave requests, and search_employees finds employees based on criteria. There is no overlap in functionality, making tool selection straightforward.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern (get_employee_info, request_global_leave, search_employees). The naming is uniform and predictable, with no deviations in style or convention.

Tool Count2/5

With only 3 tools, the server feels thin for an HR domain, which typically requires more operations like updating employee info, managing leave approvals, or handling payroll. The count is too low for comprehensive HR functionality.

Completeness2/5

The tool set is severely incomplete for an HR server. It lacks essential CRUD operations (e.g., update or delete employee info), leave management workflows (e.g., approve/reject leave), and other HR functions like onboarding or performance reviews, leading to significant gaps.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • F
    license
    B
    quality
    D
    maintenance
    A Model Context Protocol server that enables users to manage employee leave through natural language. It provides tools to check leave balances, apply for leave, and view leave history via Claude integration.
    3
    -
  • A
    license
    A
    quality
    D
    maintenance
    A Model Context Protocol server that enables Claude to interact with a Lucca instance to list employees, departments, and view absences in natural language.
    3
    MIT
  • F
    license
    D
    quality
    D
    maintenance
    An AI-powered HR assistant that automates employee management, leave handling, ticket creation, meeting scheduling, and email notifications through natural language conversations using the Model Context Protocol.
    11
    -