Sponsored by Deepsite.site

BambooHR MCP

Created By
encoreshao7 months ago
A Model Context Protocol (MCP) library for BambooHR, built with Node.js and TypeScript.
Content

BambooHR MCP

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.

Features

  • TypeScript types for all models and API responses
  • Simple, promise-based API for all major BambooHR endpoints
  • Easy to extend and integrate into your own projects

Installation

# Clone the repository
git clone https://github.com/encoreshao/bamboohr-mcp.git

# Navigate to the project directory
cd bamboohr-mcp

# Install dependencies
npm install

Usage

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"
  );
}

API

All methods return Promises and use the types defined in src/utils/models.d.ts.

  • BambooHRApi class: Encapsulates all API methods.
  • Helper functions: fetchWhosOut, fetchProjects, submitWorkHours, getMe, fetchEmployeeDirectory, fetchTimeEntries.

Environment Variables

You can pass your BambooHR API token and company domain directly to the methods, or use environment variables:

Required:

  • BAMBOOHR_TOKEN — Your BambooHR API token
  • BAMBOOHR_COMPANY_DOMAIN — Your BambooHR company domain (the part before .bamboohr.com)
  • BAMBOOHR_EMPLOYEE_ID — Your BambooHR employee ID

Creating a BambooHR API Token

To use this library, you'll need to create a BambooHR API token:

  1. Log in to your BambooHR account
  2. Click on your profile picture in the bottom-left corner
  3. Select "API Keys" from the dropdown menu
  4. Click "Add New Key"
  5. Enter a API Key Name for your key (e.g., "MCP Server"), and click "Generate Key"
  6. Copy the generated token immediately (it will only be shown once)

Finding Your Company Domain

Your company domain is the subdomain used in your BambooHR URL:

  • If you access BambooHR at https://yourcompany.bamboohr.com, then your company domain is yourcompany
  • This value should be used for the BAMBOOHR_COMPANY_DOMAIN environment variable or passed directly to the API methods

Getting Your Employee ID

You can find your employee ID in several ways:

  1. From your profile URL: When viewing your profile, the URL will contain your employee ID (e.g., 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

Extending

Add new methods in src/apis/bamboohr.ts and export them from src/index.ts.

Contributors

License

This project is licensed under the MIT License. See the LICENSE file for details.

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Amap Maps高德地图官方 MCP Server
Tavily Mcp
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Playwright McpPlaywright MCP server
CursorThe AI Code Editor
DeepChatYour AI Partner on Desktop
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
WindsurfThe new purpose-built IDE to harness magic
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
ChatWiseThe second fastest AI chatbot™
Serper MCP ServerA Serper MCP Server
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.