by encoreshao
Provides a clean, type-safe interface to interact with the BambooHR API from Node.js or TypeScript applications.
BambooHR MCP offers a TypeScript‑first, promise‑based library that abstracts BambooHR’s REST endpoints into strongly‑typed functions. It simplifies fetching employee data, time‑off information, projects, and submitting work hours, while ensuring compile‑time safety.
git clone https://github.com/encoreshao/bamboohr-mcp.git
cd bamboohr-mcp
npm install
BAMBOOHR_TOKEN=your_api_token
BAMBOOHR_COMPANY_DOMAIN=yourcompany
BAMBOOHR_EMPLOYEE_ID=123
import { fetchEmployeeDirectory, fetchWhosOut, fetchProjects, submitWorkHours } from "bamboohr-mcp";
const directory = await fetchEmployeeDirectory(process.env.BAMBOOHR_TOKEN!, process.env.BAMBOOHR_COMPANY_DOMAIN!);
// work with the returned data
The library also exposes a BambooHRApi
class for custom extensions.src/apis/bamboohr.ts
and exporting from src/index.ts
.node-fetch
‑style HTTP client.Q: Do I need to run a server to use this library? A: No. It is a client‑side SDK that can be imported into any Node.js or TypeScript project.
Q: Which Node.js versions are supported? A: The repository uses modern ECMAScript syntax; Node.js 14+ is recommended.
Q: How are authentication credentials supplied?
A: Pass the API token and company domain as function arguments or set the BAMBOOHR_TOKEN
and BAMBOOHR_COMPANY_DOMAIN
environment variables.
Q: Can I extend the library with my own API calls?
A: Yes. Add new methods in src/apis/bamboohr.ts
and export them via src/index.ts
.
Q: Is there built‑in error handling? A: The helpers throw on HTTP errors; you can wrap calls in try/catch to handle them gracefully.
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.
Explore related MCPs that share similar capabilities and solve comparable challenges
by zed-industries
A high‑performance, multiplayer code editor designed for speed and collaboration.
by modelcontextprotocol
Model Context Protocol Servers
by modelcontextprotocol
A Model Context Protocol server for Git repository interaction and automation.
by modelcontextprotocol
A Model Context Protocol server that provides time and timezone conversion capabilities.
by cline
An autonomous coding assistant that can create and edit files, execute terminal commands, and interact with a browser directly from your IDE, operating step‑by‑step with explicit user permission.
by continuedev
Enables faster shipping of code by integrating continuous AI agents across IDEs, terminals, and CI pipelines, offering chat, edit, autocomplete, and customizable agent workflows.
by upstash
Provides up-to-date, version‑specific library documentation and code examples directly inside LLM prompts, eliminating outdated information and hallucinated APIs.
by github
Connects AI tools directly to GitHub, enabling natural‑language interactions for repository browsing, issue and pull‑request management, CI/CD monitoring, code‑security analysis, and team collaboration.
by daytonaio
Provides a secure, elastic infrastructure that creates isolated sandboxes for running AI‑generated code with sub‑90 ms startup, unlimited persistence, and OCI/Docker compatibility.