# BambooHR MCP Server

A Model Context Protocol (MCP) server for interacting with BambooHR's API.

## Features

### Employee Management
- **Get All Employees**: Retrieve a list of all employees with customizable fields
- **Get Employee Details**: Get detailed information about a specific employee
- **Create Employee**: Add new employees to the system
- **Update Employee**: Modify existing employee information

### Time Off Management
- **Get Time Off Requests**: List time off requests with filtering options
- **Create Time Off Request**: Submit new time off requests
- **Update Time Off Request**: Approve, deny, or cancel time off requests
- **Get Time Off Balance**: Check employee time off balances

## Installation

```bash
npm install
npm run build
```

## Configuration

Create a `.env` file based on `.env.example`:

```env
BAMBOOHR_COMPANY_DOMAIN=your_company_subdomain
BAMBOOHR_BEARER_TOKEN=your_api_token
```

### Getting Your API Token

1. Log into BambooHR as an administrator
2. Click your profile picture in the upper right corner
3. Choose "API Keys"
4. Click "Add New Key"
5. Give it a name and click "Generate Key"
6. Copy the API key immediately (you won't be able to see it again)

## Usage

### As an MCP Server

```bash
npm start
```

### Development Mode

```bash
npm run dev
```

## Available Tools

### Employee Tools

#### bamboohr_get_all_employees
Get all employees with specified fields.

Parameters:
- `fields` (optional): Array of field names to retrieve

#### bamboohr_get_employee
Get detailed information about a specific employee.

Parameters:
- `employeeId`: The unique ID of the employee

#### bamboohr_create_employee
Create a new employee.

Parameters:
- `firstName`: Employee's first name
- `lastName`: Employee's last name
- `email` (optional): Email address
- `department` (optional): Department name
- `jobTitle` (optional): Job title
- `hireDate` (optional): Hire date (YYYY-MM-DD)
- `supervisorId` (optional): Supervisor's employee ID
- `location` (optional): Work location
- `workPhone` (optional): Work phone number

#### bamboohr_update_employee
Update an existing employee's information.

Parameters:
- `employeeId`: The unique ID of the employee
- All other parameters from create (optional)

### Time Off Tools

#### bamboohr_get_time_off_requests
Get time off requests with filtering options.

Parameters:
- `employeeId` (optional): Filter by employee
- `startDate` (optional): Start date (YYYY-MM-DD)
- `endDate` (optional): End date (YYYY-MM-DD)
- `status` (optional): Filter by status

#### bamboohr_create_time_off_request
Create a new time off request.

Parameters:
- `employeeId`: Employee ID
- `start`: Start date (YYYY-MM-DD)
- `end`: End date (YYYY-MM-DD)
- `timeOffTypeId`: Time off type ID
- `amount`: Amount of time off
- `unit`: 'days' or 'hours'
- `notes` (optional): Request notes

#### bamboohr_update_time_off_request
Update a time off request status.

Parameters:
- `requestId`: Request ID
- `status`: 'approved', 'denied', or 'canceled'
- `note` (optional): Decision note

#### bamboohr_get_time_off_balance
Get time off balance for an employee.

Parameters:
- `employeeId`: Employee ID

## License

MIT