@asanstefanski/hrlab-mcp-server
v1.0.0
Published
MCP Server for HRLab API integration
Downloads
8
Maintainers
Readme
HRLab MCP Server
A Model Context Protocol (MCP) server for integrating with the HRLab API. This server provides comprehensive access to all HRLab endpoints for HR data management.
Features
This MCP server provides access to all HRLab API endpoints organized into categories:
Absences (4 tools)
getAllVacations- Get all vacation recordsgetAllSicknesses- Get all sickness recordsgetAllTravels- Get all travel recordsgetAllHomeOffices- Get all home office records
Organisation (11 tools)
getAllUsers- Get all user recordsgetAllDepartments- Get all department recordsgetAllTeams- Get all team recordsgetAllCompanies- Get all company recordsgetAllAbsenceTypes- Get all absence type recordsgetAllBranchOffices- Get all branch office recordsgetAllCostUnits- Get all cost unit recordsgetAllEquipments- Get all equipment recordsgetAllProjects- Get all project recordsgetAllQualificationTypes- Get all qualification type recordsgetAllTasks- Get all task records
Remuneration (4 tools)
getAllBonusTargets- Get all bonus target recordsgetAllHourlyWages- Get all hourly wage recordsgetAllPerks- Get all perk recordsgetAllSalaryTypes- Get all salary type records
Family (3 tools)
getAllChildren- Get all children recordsgetAllMaternities- Get all maternity recordsgetAllParentalLeaves- Get all parental leave records
Recruiting (4 tools)
getAllAnnouncements- Get all job announcement recordsgetAllCandidatures- Get all candidature recordsgetAllCandidatureStatuses- Get all candidature status recordsgetAllStatuses- Get all status records
UserData (5 tools)
getAllAppointments- Get all appointment recordsgetAllBankAccounts- Get all bank account recordsgetAllCertificates- Get all certificate recordsgetAllContactData- Get all contact data recordsgetAllBudgets- Get all budget records
Benefits (3 tools)
getAllBenefits- Get all benefit recordsgetAllCapitalFormingBenefits- Get all capital forming benefit recordsgetAllCompanyPensions- Get all company pension records
Installation
Via NPX (Recommended)
npx @asanstefanski/hrlab-mcp-serverVia NPM Global Install
npm install -g @asanstefanski/hrlab-mcp-server
hrlab-mcp-serverLocal Development
Clone and install dependencies:
git clone https://github.com/asanstefanski/hrlab-mcp-server.git cd hrlab-mcp-server npm installBuild the project:
npm run buildStart the server:
npm start
Configuration
The server requires an HRLab API token to authenticate with the HRLab API. You can obtain this token from your HRLab account settings.
Set the environment variable:
export HRLAB_API_TOKEN="your-hrlab-api-token"Or create a .env file in your project root:
HRLAB_API_TOKEN=your-hrlab-api-tokenDevelopment
Watch mode for development:
npm run devClean build directory:
npm run clean
API Features
- Automatic pagination - Handles large datasets by automatically fetching all pages
- Rate limiting - Respects HRLab's rate limits (60 requests per minute)
- Filtering support - Most endpoints support filtering by user ID, date ranges, and other parameters
- Error handling - Comprehensive error handling for API failures
- TypeScript support - Full TypeScript interfaces for all HRLab data types
Usage with Claude Code
After setting up the server, you can use it with Claude Code or other MCP clients:
- Configure your MCP client to connect to this server
- Use the available tools to query HRLab data
- All tools support optional filtering parameters
Example Tool Usage
// Get all vacations for the last 3 months
getAllVacations({
start_date: "01-04-2024" // DD-MM-YYYY format
})
// Get all users in a specific department
getAllUsers({
department_id: "123"
})
// Get all appointments for a specific user
getAllAppointments({
user_id: "456",
start_date: "01-07-2024",
end_date: "31-07-2024"
})Rate Limiting
The server implements rate limiting to comply with HRLab's API limits:
- Maximum 60 requests per minute
- 1 second minimum interval between requests
- Automatic retry handling
Error Handling
The server includes comprehensive error handling for:
- Invalid API tokens
- Network connectivity issues
- API rate limit exceeded
- Invalid parameter values
- Server errors
License
MIT
