🚀 SmartHR MCP 服务器
本项目针对 SmartHR API 实现了 MCP(模型上下文协议)服务器。借助该服务器,能够将 SmartHR 中的员工、部门、职位、雇佣形式和等级等信息当作 MCP 工具来处理。
🚀 快速开始
克隆或下载仓库
设置环境变量(.env)
为了与 SmartHR API 通信,需要以下环境变量:
SMARTHR_API_BASE_URL=https://app.smarthr.jp/api
SMARTHR_API_KEY=YOUR_SMARTHR_API_TOKEN
Claude for Desktop 的配置
在 claud_desktop_config.json 中追加 smarthr_mcp_server.json 的内容。
重启 Claude for Desktop
% killall "Claude"
% open -a Claude
✨ 主要特性
本项目能够将 SmartHR 的员工、部门、职位、雇佣形式和等级等信息作为 MCP 工具进行处理,为相关信息的管理提供了便捷的途径。
🏗️ 组件结构
smarthr-mcp-server/
│
├── .env_sample
├── .gitignore
├── main.py
├── pyproject.toml
├── README.md
├── requirements.txt
├── smarthr_mcp_server.json # MCP 工具的定义和命令信息(供 MCP 兼容客户端使用)
├── uv.lock
│
└── smarthr_mcp_server/
├── server.py # 基于 FastMCP 的 MCP 服务器实现
├── smarthr_client.py # 负责与 SmartHR API 进行通信的客户端模块
└── smarthr_mcp_server.egg-info/
📄 支持工具列表
注册 相关
| 函数名 |
描述 |
smarthr_create_crew() |
创建员工 |
smarthr_create_department() |
创建部门 |
smarthr_create_position() |
创建职位 |
smarthr_create_employment_type() |
创建雇佣形式 |
smarthr_create_grade() |
创建等级 |
删除 相关
| 函数名 |
描述 |
smarthr_delete_crew() |
删除员工 |
smarthr_delete_department() |
删除部门 |
smarthr_delete_position() |
删除职位 |
smarthr_delete_employment_type() |
删除雇佣形式 |
smarthr_delete_grade() |
删除等级 |
获取 相关
| 函数名 |
描述 |
smarthr_get_crew() |
获取员工信息 |
smarthr_get_departments() |
获取所有部门 |
smarthr_get_positions() |
获取所有职位 |
smarthr_get_employment_types() |
获取所有雇佣形式 |
smarthr_get_grades() |
获取所有等级 |
列表 相关
| 函数名 |
描述 |
smarthr_list_relations() |
获取关系列表 |
搜索 相关
| 函数名 |
描述 |
smarthr_search_crews() |
搜索员工 |
更新 相关
| 函数名 |
描述 |
smarthr_update_crew() |
更新员工信息 |
smarthr_update_department() |
更新部门信息 |
smarthr_update_position() |
更新职位信息 |
smarthr_update_employment_type() |
更新雇佣形式 |
smarthr_update_grade() |
更新等级信息 |
部分更新 相关
| 函数名 |
描述 |
smarthr_partial_update_department() |
部分更新部门信息 |
smarthr_partial_update_position() |
部分更新职位信息 |
smarthr_partial_update_employment_type() |
部分更新雇佣形式 |
smarthr_partial_update_grade() |
部分更新等级信息 |
📄 许可证
本项目采用 MIT 许可证。
⚠️ 免责声明
使用本程序进行的一切行为及由此产生的一切损害和损失,均由使用者自行负责,项目方不承担任何责任。