by encoreshao
BambooHR MCP is a Node.js and TypeScript library that provides a type-safe interface for interacting with the BambooHR API. It simplifies access to employee data, time tracking, and HR management features.
BambooHR MCP (Model Context Protocol) is a Node.js and TypeScript library that provides a type-safe interface for interacting with the BambooHR API. It simplifies access to employee data, time tracking, and HR management features.
Installation:
git clone https://github.com/encoreshao/bamboohr-mcp.git
cd bamboohr-mcp
npm install
Usage:
Import the necessary functions and classes from bamboohr-mcp
.
import {
BambooHRApi,
fetchWhosOut,
fetchProjects,
submitWorkHours,
getMe,
fetchEmployeeDirectory,
fetchTimeEntries,
} from "bamboohr-mcp";
const token = process.env.BAMBOOHR_TOKEN!;
const companyDomain = process.env.BAMBOOHR_COMPANY_DOMAIN!;
const employeeID = process.env.BAMBOOHR_EMPLOYEE_ID!;
// Example: List all employees
const directory = await fetchEmployeeDirectory(token, companyDomain);
directory.employees.forEach((emp) => {
console.log(`${emp.displayName} — ${emp.workEmail} — ${emp.jobTitle}`);
});
// Example: Fetch "who's out today"
const whosOut = await fetchWhosOut(token, companyDomain);
whosOut.forEach((out) => {
console.log(`${out.employeeName}: ${out.startDate} to ${out.endDate}`);
});
Environment Variables:
Set the following environment variables or pass them directly to the methods:
BAMBOOHR_TOKEN
: Your BambooHR API token.BAMBOOHR_COMPANY_DOMAIN
: Your BambooHR company domain (e.g., yourcompany
if your URL is https://yourcompany.bamboohr.com
).BAMBOOHR_EMPLOYEE_ID
: Your BambooHR employee ID.Example .env
file:
BAMBOOHR_TOKEN=your_api_token_here
BAMBOOHR_COMPANY_DOMAIN=yourcompany
BAMBOOHR_EMPLOYEE_ID=123
fetchWhosOut
, fetchProjects
, submitWorkHours
, getMe
, fetchEmployeeDirectory
, and fetchTimeEntries
.How to create a BambooHR API Token?
How to find your BambooHR Company Domain?
Your company domain is the subdomain in your BambooHR URL. For https://yourcompany.bamboohr.com
, the domain is yourcompany
.
How to get your Employee ID?
You can find your employee ID in your profile URL (e.g., https://yourcompany.bamboohr.com/employees/employee.php?id=123
).
How to extend BambooHR MCP?
Add new methods in src/apis/bamboohr.ts
and export them from src/index.ts
.
A Model Context Protocol (MCP) library for BambooHR, built with Node.js and TypeScript. This library provides a clean, type-safe interface to interact with the BambooHR API from your Node.js or TypeScript applications.
# Clone the repository
git clone https://github.com/encoreshao/bamboohr-mcp.git
# Navigate to the project directory
cd bamboohr-mcp
# Install dependencies
npm install
import {
BambooHRApi,
fetchWhosOut,
fetchProjects,
submitWorkHours,
getMe,
fetchEmployeeDirectory,
fetchTimeEntries,
} from "bamboohr-mcp";
const token = process.env.BAMBOOHR_TOKEN!;
const companyDomain = process.env.BAMBOOHR_COMPANY_DOMAIN!;
const employeeID = process.env.BAMBOOHR_EMPLOYEE_ID!;
// List all employees with name, email, and job title
const directory = await fetchEmployeeDirectory(token, companyDomain);
directory.employees.forEach((emp) => {
console.log(`${emp.displayName} — ${emp.workEmail} — ${emp.jobTitle}`);
});
// Fetch "who's out today"
const whosOut = await fetchWhosOut(token, companyDomain);
whosOut.forEach((out) => {
console.log(`${out.employeeName}: ${out.startDate} to ${out.endDate}`);
});
// Submit work hours (find project/task IDs first)
const projects = await fetchProjects(token, companyDomain, employeeID);
const bambooHR = projects.find((p) => p.name.includes("BambooHR"));
const devTask = bambooHR?.tasks.find((t) => t.name.includes("Development"));
if (bambooHR && devTask) {
await submitWorkHours(
token,
companyDomain,
employeeID,
bambooHR.id,
devTask.id,
"2024-06-01",
1,
"Development work on BambooHR"
);
}
All methods return Promises and use the types defined in src/utils/models.d.ts
.
BambooHRApi
class: Encapsulates all API methods.fetchWhosOut
, fetchProjects
, submitWorkHours
, getMe
, fetchEmployeeDirectory
, fetchTimeEntries
.You can pass your BambooHR API token and company domain directly to the methods, or use environment variables:
Required:
BAMBOOHR_TOKEN
— Your BambooHR API tokenBAMBOOHR_COMPANY_DOMAIN
— Your BambooHR company domain (the part before .bamboohr.com)BAMBOOHR_EMPLOYEE_ID
— Your BambooHR employee IDTo use this library, you'll need to create a BambooHR API token:
Your company domain is the subdomain used in your BambooHR URL:
https://yourcompany.bamboohr.com
, then your company domain is yourcompany
BAMBOOHR_COMPANY_DOMAIN
environment variable or passed directly to the API methodsYou can find your employee ID in several ways:
https://yourcompany.bamboohr.com/employees/employee.php?id=123
)Example .env file:
BAMBOOHR_TOKEN=your_api_token_here
BAMBOOHR_COMPANY_DOMAIN=yourcompany
BAMBOOHR_EMPLOYEE_ID=123
Add new methods in src/apis/bamboohr.ts
and export them from src/index.ts
.
This project is licensed under the MIT License. See the LICENSE file for details.
Please log in to share your review and rating for this MCP.
Discover more MCP servers with similar functionality and use cases
by Skyvern-AI
Skyvern automates browser-based workflows using LLMs and computer vision, offering a robust solution for repetitive online tasks.
by PipedreamHQ
Connect APIs quickly, run event‑driven automations, and execute custom code in Node.js, Python, Go, or Bash on a hosted platform.
by czlonkowski
Provides AI assistants with structured access to n8n node documentation, properties, and operations, enabling automated workflow creation, validation, and management.
by executeautomation
mcp-playwright is a Model Context Protocol (MCP) server that enables large language models (LLMs) to perform browser automation and web scraping tasks using Playwright.
by browserbase
Provides cloud browser automation capabilities for LLMs, enabling web navigation, interaction, screenshot capture, and data extraction through Browserbase and Stagehand.
by haris-musa
excel-mcp-server is a Python-based Model Context Protocol (MCP) server that enables AI agents to programmatically create, read, and modify Excel files without requiring Microsoft Excel to be installed.
by mobile-next
Mobile-mcp is a Model Context Protocol (MCP) server designed for scalable mobile automation, app scraping, and development across iOS and Android devices, including physical devices, simulators, and emulators.
by anaisbetts
mcp-installer is an MCP server designed to automate the installation of other MCP servers, simplifying the process for users.
by leonardsellem
An MCP server that enables AI assistants to interact with n8n workflows through natural language.