BambooHR MCP 服务器

BambooHR MCP 服务器是一个全面的模型上下文协议(MCP)服务器,用于与BambooHR API集成,支持完整的CRUD操作,帮助AI助手管理员工、休假、文件、目标、培训、招聘、福利、时间跟踪和认证。

  • by twentytwokhz
  • TypeScript
  • 本地部署
  • 1 星标
  • 更新于
在 GitHub 查看 twentytwokhz/bamboohr-mcp

使用说明

BambooHR MCP服务器

用于BambooHR API集成的综合模型上下文协议(MCP)服务器 完整的CRUD操作该服务器使AI助手能够在BambooHR中管理员工、休假、文件、目标、培训、申请人跟踪、福利、时间跟踪和认证。

特性

  • 71工具 涵盖所有主要的BambooHR API终点
  • 完整的CRUD操作 -跨所有域创建、读取、更新、删除
  • 交叉平台的 -在macOS、Windows和Linux上运行
  • 安全确认 -破坏性操作需要明确 confirm: true
  • 双输出格式 -JSON或Markdown响应
  • 两种运输方式 -stdio(Claude Desktop)或HTTP(API服务器)

快速开始

先决条件

  • 已安装Node.js 18+
  • 具有API访问权限的BambooHR帐户
  • 您的BambooHR API密钥

通过npm安装(推荐)

npm install -g @twentytwokhz/bamboohr-mcp

或者直接与npx一起使用(无需安装):

npx @twentytwokhz/bamboohr-mcp

从源安装

git clone https://github.com/twentytwokhz/bamboohr-mcp.git
cd bamboohr-mcp
npm install
npm run build

获取您的BambooHR证书

在配置MCP服务器之前,您需要:

1.API密钥:

  1. 登录BambooHR
  2. 点击左下角的你的名字
  3. 选择“API密钥”
  4. 点击“添加新密钥”
  5. 复制生成的密钥

2.公司域名: BambooHR URL中的贵公司子域名。

  • 例子: https://acmecorp.bamboohr.com → use acmecorp

环境变量

变量 必填 描述
BAMBOOHR_API_KEY 是 您的BambooHR API密钥
BAMBOOHR_COMPANY_DOMAIN 是 您的公司子域名
TRANSPORT 没有 stdio (默认)或 http
PORT 无 HTTP端口(默认值:3000)

对于npm/npx用户: 在Claude Desktop配置中设置这些(见下文)。

对于当地发展: 创建一个 .env 文件:

BAMBOOHR_API_KEY=your_api_key_here
BAMBOOHR_COMPANY_DOMAIN=your_company_subdomain

Claude桌面集成

添加到您的Claude Desktop配置文件中:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json 窗户: %APPDATA%\Claude\claude_desktop_config.json Linux: ~/.config/Claude/claude_desktop_config.json

使用npx(推荐)

{
  "mcpServers": {
    "bamboohr": {
      "command": "npx",
      "args": ["@twentytwokhz/bamboohr-mcp"],
      "env": {
        "BAMBOOHR_API_KEY": "your_api_key_here",
        "BAMBOOHR_COMPANY_DOMAIN": "your_domain"
      }
    }
  }
}

使用全局安装

{
  "mcpServers": {
    "bamboohr": {
      "command": "bamboohr-mcp",
      "args": [],
      "env": {
        "BAMBOOHR_API_KEY": "your_api_key_here",
        "BAMBOOHR_COMPANY_DOMAIN": "your_domain"
      }
    }
  }
}

使用本地构建

{
  "mcpServers": {
    "bamboohr": {
      "command": "node",
      "args": ["/absolute/path/to/bamboohr-mcp/dist/index.js"],
      "env": {
        "BAMBOOHR_API_KEY": "your_api_key_here",
        "BAMBOOHR_COMPANY_DOMAIN": "your_domain"
      }
    }
  }
}

重要提示:

  • 保存配置更改后重新启动Claude Desktop

可用工具(共71个)

🧑‍💼 员工工具(9个工具)

工具 类型 描述
bamboohr_get_employee_directory 阅读 获取所有员工的基本信息
bamboohr_get_employee 阅读 获取特定员工的详细信息
bamboohr_get_employee_files 读取 获取与员工关联的文件
bamboohr_get_employee_enriched 阅读 获取员工技能、资历、培训数据
bamboohr_get_employee_table_rows 读取 获取表/历史数据(工作、薪酬等)
bamboohr_create_employee 创建 创建新员工记录
bamboohr_update_employee 更新 更新员工字段(包括自定义字段)
bamboohr_add_employee_table_row 创建 在员工表中添加行(职位信息、薪酬)
bamboohr_update_employee_table_row 更新 更新现有表行

员工创建/更新示例

"Create new employee John Doe in Engineering department"
"Update employee 123's job title to Senior Developer"
"Add new compensation record for employee 456"

📅 休假工具(9个工具)

工具 类型 描述
bamboohr_get_time_off_requests 阅读 通过过滤获取休假请求
bamboohr_get_whos_out 阅读 让员工暂时离职
bamboohr_get_time_off_types 阅读 获取所有休假类型/类别
bamboohr_get_time_off_policies 阅读 获取所有休假政策
bamboohr_get_employee_time_off_policies 阅读 获取分配给员工的策略
bamboohr_create_time_off_request 创建 提交新的休假申请
bamboohr_change_time_off_request_status 更新 批准、拒绝或取消请求
bamboohr_adjust_time_off_balance 更新 调整员工的PTO余额
bamboohr_assign_time_off_policy 更新 为员工分配休假政策

休假管理示例

"Create PTO request for employee 123 from Jan 15-17"
"Approve time off request 456"
"Add 5 vacation days to employee 789's balance"

📁 文件管理工具(6个工具)

工具 类型 描述
bamboohr_list_employee_files 读取 列出员工的文件
bamboohr_list_company_files 读取 列出公司范围内的文件
bamboohr_get_file_categories 读取 获取可用文件类别
bamboohr_upload_employee_file 创建 上传文件到员工记录
bamboohr_upload_employee_photo 创建 上传员工照片
bamboohr_delete_employee_file 删除 ⚠️ 删除员工档案(需要确认:true)

文件管理示例

"Upload performance review to employee 123's files"
"Update employee 456's profile photo"
"Delete file 789 from employee 123" (requires confirm: true)

🎯 目标和绩效工具(7个工具)

工具 类型 描述
bamboohr_get_employee_goals 阅读 为员工实现所有目标
bamboohr_get_goal 阅读 获取具体目标详细信息
bamboohr_get_goal_comments 阅读 获取对目标的评论
bamboohr_create_goal 创建 为员工设定新目标
bamboohr_update_goal 更新 更新目标详细信息或进度
bamboohr_delete_goal 删除 ⚠️ 删除目标(需要确认:true)
bamboohr_add_goal_comment 创建 为目标添加评论

目标示例

"Create Q1 sales target goal for employee 123"
"Update goal 456 progress to 75%"
"Add comment to goal 789: Great progress this month"

📚 元数据和培训工具(10个工具)

工具 类型 描述
bamboohr_get_fields 阅读 获取所有可用的员工字段
bamboohr_get_list_field_values 读取 获取列表/下拉字段的值
bamboohr_get_changed_employees 阅读 获取自时间戳以来员工的变更
bamboohr_get_employee_birthdays 阅读 获取所有员工的生日
bamboohr_get_training_types 阅读 获取可用的培训类型
bamboohr_get_training_categories 阅读 获取培训类别
bamboohr_add_training_record 创建 为员工添加培训记录
bamboohr_update_training_record 更新 更新现有培训记录
bamboohr_delete_training_record 删除 ⚠️ 删除培训记录(需要确认:true)
bamboohr_update_list_field_values 更新 更新列表字段选项

训练示例

"Add Azure AZ-104 certification for employee 123"
"Update training record 456 with completion date"
"Show all available training types"

👥 申请人跟踪工具(10个工具)

工具 类型 描述
bamboohr_get_job_summaries 阅读 获取所有职位空缺摘要
bamboohr_get_job_details 阅读 获取详细的工作信息
bamboohr_get_applications 阅读 获取工作申请
bamboohr_get_application_details 阅读 获取特定应用程序详细信息
bamboohr_get_applicant_statuses 阅读 获取可用的申请人状态
bamboohr_create_job_opening 创建 创建新的职位发布
bamboohr_create_candidate 创建 将候选人添加到职位空缺中
bamboohr_update_applicant_status 更新 更新候选人的申请状态
bamboohr_add_application_comment 创建 向应用程序添加注释
bamboohr_get_hiring_leads 阅读 获取招聘线索/经理

招聘示例

"Create job opening for Senior Developer position"
"Add candidate John Smith to job posting 123"
"Move applicant 456 to interview stage"

💊 福利和依赖工具(7个工具)

工具 类型 描述
bamboohr_get_employee_dependents 阅读 为员工获取家属
bamboohr_get_all_dependents 阅读 在全公司范围内获取所有员工家属
bamboohr_add_employee_dependent 创建 将受抚养人添加到员工
bamboohr_update_employee_dependent 更新 更新依赖信息
bamboohr_get_benefit_plans 阅读 获取可用的福利计划
bamboohr_get_employee_benefits 阅读 获取员工福利登记
bamboohr_get_benefit_coverage_levels 阅读 获取计划的覆盖级别

福利示例

"Add spouse dependent for employee 123"
"Show all dependents in the company"
"What benefit plans are available?"

⏱️ 时间跟踪工具(7个工具)

工具 类型 描述
bamboohr_get_timesheet_entries 读取 获取日期范围的时间表条目
bamboohr_get_hour_records 阅读 获取员工的小时记录
bamboohr_get_clock_status 读取 获取当前时钟输入/输出状态
bamboohr_clock_in 创建 员工时钟
bamboohr_clock_out 创建 给员工打卡
bamboohr_add_hour_record 创建 添加手动小时记录
bamboohr_update_hour_record 更新 更新现有小时记录
bamboohr_get_projects 阅读 获取可用的时间跟踪项目

时间跟踪示例

"Clock in employee 123"
"Clock out employee 123 with note 'Lunch break'"
"Add 8 hours for employee 456 on project XYZ"

📊 认证和评估工具(7个工具)

工具 类型 描述
bamboohr_get_certifications_due 阅读 查询员工到期/到期的证书
bamboohr_get_employee_certification_summary 阅读 获取员工的认证摘要
bamboohr_get_company_certifications_report 阅读 全公司认证合规报告
bamboohr_get_employees_with_assessments_due 阅读 让员工在规定日期内完成评估
bamboohr_get_training_records 阅读 通过过滤获取培训记录
bamboohr_get_goals_status_report 阅读 全公司目标进展报告
bamboohr_get_overdue_assessments 阅读 获取不同类型的所有逾期项目

认证与评估示例

"Which certifications are expiring in February 2026?"
"Show all Azure certifications due before end of Q1"
"Get company-wide certification compliance by department"
"What assessments are due this month?"
"Show overdue items for employee 123"
"Goal progress report grouped by status"

注: BambooHR的API没有公开正式的性能评估端点。此模块跟踪认证(通过自定义字段)、培训和目标,而不是审查周期或评级。


安全功能

破坏性操作需要确认

所有DELETE操作和敏感更改都需要明确的 confirm: true 参数:

{
  "employee_id": "123",
  "file_id": "456",
  "confirm": true  // Required for deletion
}

需要确认的操作:

  • bamboohr_delete_employee_file
  • bamboohr_delete_goal
  • bamboohr_delete_training_record
  • bamboohr_change_time_off_request_status (否认时)
  • bamboohr_adjust_time_off_balance (减少余额时)

响应格式

所有工具都支持两种输出格式 response_format 参数:

JSON格式

{
  "id": "123",
  "firstName": "John",
  "lastName": "Doe",
  "email": "john@example.com"
}

Markdown格式(默认)

# Employee: John Doe

**ID:** 123
**Email:** john@example.com
**Job Title:** Software Engineer

查询示例

员工管理

"Show me the employee directory"
"Get details for employee ID 123"
"Create new employee Jane Smith in Marketing"
"Update employee 456's department to Engineering"

休假管理

"Who's out today?"
"Show all pending time off requests"
"Approve time off request 789"
"What's employee 123's PTO balance?"

招聘

"Show all open job positions"
"Create a job posting for Backend Developer"
"Add candidate resume to job opening 456"
"Move applicant to final interview stage"

目标与绩效

"Create Q1 goals for employee 123"
"Show progress on all goals for employee 456"
"Update goal completion to 100%"

故障排除

“未设置所需的环境变量”

  1. 确保你有一个 .env 项目根目录中的文件
  2. 验证它是否包含 BAMBOOHR_API_KEY 和 BAMBOOHR_COMPANY_DOMAIN

“身份验证失败”

  • 验证API密钥是否正确(无额外空格)
  • 检查API密钥是否未在BambooHR中被撤销

“禁止访问”

  • 与API密钥关联的用户缺少权限
  • 使用管理员用户生成新的API密钥
  • 某些操作需要特定的BambooHR权限

Claude Desktop中出现“调用工具失败”错误

  1. 确保您运行的是最新版本: npm run build
  2. 完全重新启动克劳德桌面
  3. 检查日志以了解具体的错误详细信息

Claude Desktop未显示服务器

  1. 验证配置文件路径是否正确
  2. 检查JSON是否有效
  3. 使用绝对路径,而不是相对路径
  4. 完全退出并重新启动Claude Desktop

发展

项目结构

bamboohr-mcp-server/
├── src/
│   ├── index.ts                    # Main entry point
│   ├── constants.ts                # API constants
│   ├── types.ts                    # TypeScript types
│   ├── services/
│   │   ├── bamboohr-client.ts      # API client with auth & file uploads
│   │   └── formatting.ts           # Response formatting
│   ├── schemas/
│   │   └── common.ts               # Validation schemas
│   └── tools/
│       ├── employees.ts            # Employee CRUD (9 tools)
│       ├── timeoff.ts              # Time off CRUD (9 tools)
│       ├── files.ts                # File management (6 tools)
│       ├── goals.ts                # Goals & performance (7 tools)
│       ├── metadata.ts             # Metadata & training (10 tools)
│       ├── applicant-tracking.ts   # ATS (10 tools)
│       ├── benefits.ts             # Benefits & dependents (7 tools)
│       ├── time-tracking.ts        # Time tracking (7 tools)
│       └── assessments.ts          # Certifications & assessments (7 tools)
├── dist/                           # Compiled JavaScript (cross-platform)
├── .env                            # Your credentials (don't commit!)
└── README.md

构建命令

# Build the project
npm run build

# Development mode (watch for changes)
npm run dev

# Clean build artifacts
npm run clean

跨平台兼容性

编译 dist/ 文件夹可以在任何支持Node.js 18+的平台上运行:

  • macOS ✓
  • 视窗 ✓
  • Linux ✓

在任何平台上构建一次,在任何地方运行。


安全说明

  • 永远不要将API密钥提交到版本控制
  • 商店 .env 将文件安全地添加到 .gitignore
  • API密钥与生成该密钥的用户具有相同的权限
  • 为您的用例使用具有适当权限的API密钥
  • 破坏性操作需要明确确认

技术细节

API集成

  • 基本URL: https://{domain}.bamboohr.com/api/v1/
  • 身份验证: HTTP基本身份验证(API密钥作为用户名,“x”作为密码)
  • 文件上传: 照片和文档的多部分表单数据
  • 缓存: 读取操作的5分钟响应缓存
  • 重试逻辑: 速率限制的指数回退(429/503)

工具响应格式

{
  content: [{ type: 'text', text: '...' }],
  isError?: boolean
}

工具注释

所有工具均包含MCP注释:

  • readOnlyHint:读操作为true,写操作为false
  • destructiveHint:对于删除操作为true
  • idempotentHint:对于GET/PUT为true,对于POST为false
  • openWorldHint:true(外部API)

版本历史

1.1.0-API报告和数据集(当前)

  • 79工具 (8个新)
  • 自定义报表API: 列出并执行已保存的报告(包括“反馈状态”)
  • 数据集API: 使用过滤器、排序和聚合查询原始数据
  • 新工具: bamboohr_list_reports, bamboohr_run_report, bamboohr_list_datasets, bamboohr_get_dataset_fields, bamboohr_get_field_options, bamboohr_query_dataset, bamboohr_request_custom_report, bamboohr_get_company_info
  • 通过保存的报告访问反馈数据解决方法
  • 注: 性能评估/反馈仍然无法通过直接API访问,但可以执行保存的报告

1.0.2-认证和评估跟踪

  • 71工具
  • 所有员工的认证到期跟踪
  • 带日期过滤的批量认证查询
  • 全公司认证合规报告
  • 综合评估观点(认证+培训+目标)
  • 增强的目标状态报告
  • 注: 通过BambooHR API仍无法进入正式的绩效审查周期

1.0.1

  • 员工的完整CRUD操作、休假、目标、培训、文件、ATS、福利和时间跟踪
  • 破坏性作业安全确认模式

1.0.0

  • 带有读取操作的初始版本

资源

  • BambooHR API文件: https://documentation.bamboohr.com/docs
  • MCP协议文件: https://modelcontextprotocol.io

许可证

麻省理工学院