@pipeworx/mcp-bamboohr 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +39 -0
- package/package.json +20 -0
- package/server.json +18 -0
- package/src/index.ts +148 -0
- package/tsconfig.json +14 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Pipeworx
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# mcp-bamboohr
|
|
2
|
+
|
|
3
|
+
BambooHR MCP Pack — wraps the BambooHR API v1
|
|
4
|
+
|
|
5
|
+
Part of the [Pipeworx](https://pipeworx.io) open MCP gateway.
|
|
6
|
+
|
|
7
|
+
## Tools
|
|
8
|
+
|
|
9
|
+
| Tool | Description |
|
|
10
|
+
|------|-------------|
|
|
11
|
+
| `bamboohr_list_employees` | List employees from BambooHR. Returns a directory of all employees. |
|
|
12
|
+
| `bamboohr_get_employee` | Get details for a specific employee by ID. Specify which fields to retrieve. |
|
|
13
|
+
| `bamboohr_get_directory` | Get the employee directory from BambooHR with basic info for all employees. |
|
|
14
|
+
| `bamboohr_list_timeoff` | List time-off requests within a date range. |
|
|
15
|
+
| `bamboohr_get_employee_files` | Get a list of files associated with an employee. |
|
|
16
|
+
|
|
17
|
+
## Quick Start
|
|
18
|
+
|
|
19
|
+
Add to your MCP client config:
|
|
20
|
+
|
|
21
|
+
```json
|
|
22
|
+
{
|
|
23
|
+
"mcpServers": {
|
|
24
|
+
"bamboohr": {
|
|
25
|
+
"url": "https://gateway.pipeworx.io/bamboohr/mcp"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Or use the CLI:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npx pipeworx use bamboohr
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## License
|
|
38
|
+
|
|
39
|
+
MIT
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pipeworx/mcp-bamboohr",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "BambooHR MCP Pack — wraps the BambooHR API v1",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "src/index.ts",
|
|
7
|
+
"types": "src/index.ts",
|
|
8
|
+
"keywords": ["mcp", "mcp-server", "model-context-protocol", "pipeworx", "bamboohr"],
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/pipeworx-io/mcp-bamboohr"
|
|
13
|
+
},
|
|
14
|
+
"scripts": {
|
|
15
|
+
"typecheck": "tsc --noEmit"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"typescript": "^5.7.0"
|
|
19
|
+
}
|
|
20
|
+
}
|
package/server.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
3
|
+
"name": "io.github.pipeworx-io/bamboohr",
|
|
4
|
+
"title": "uamuoohr",
|
|
5
|
+
"description": "BambooHR MCP Pack — wraps the BambooHR API v1",
|
|
6
|
+
"version": "0.1.0",
|
|
7
|
+
"websiteUrl": "https://pipeworx.io/packs/bamboohr",
|
|
8
|
+
"repository": {
|
|
9
|
+
"url": "https://github.com/pipeworx-io/mcp-bamboohr",
|
|
10
|
+
"source": "github"
|
|
11
|
+
},
|
|
12
|
+
"remotes": [
|
|
13
|
+
{
|
|
14
|
+
"type": "streamable-http",
|
|
15
|
+
"url": "https://gateway.pipeworx.io/bamboohr/mcp"
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
interface McpToolDefinition {
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
inputSchema: {
|
|
5
|
+
type: 'object';
|
|
6
|
+
properties: Record<string, unknown>;
|
|
7
|
+
required?: string[];
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
interface McpToolExport {
|
|
12
|
+
tools: McpToolDefinition[];
|
|
13
|
+
callTool: (name: string, args: Record<string, unknown>) => Promise<unknown>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* BambooHR MCP Pack — wraps the BambooHR API v1
|
|
18
|
+
*
|
|
19
|
+
* BYO key: _apiKey + _subdomain.
|
|
20
|
+
* Auth: Basic auth with apiKey as username, "x" as password.
|
|
21
|
+
* Accept: application/json header on all requests.
|
|
22
|
+
* Tools: list/get employees, get directory, list time off, get employee files.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
function apiBase(subdomain: string): string {
|
|
27
|
+
return `https://api.bamboohr.com/api/gateway.php/${subdomain}/v1`;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
async function bhrFetch(apiKey: string, subdomain: string, path: string): Promise<unknown> {
|
|
31
|
+
const credentials = btoa(`${apiKey}:x`);
|
|
32
|
+
const res = await fetch(`${apiBase(subdomain)}${path}`, {
|
|
33
|
+
headers: {
|
|
34
|
+
Authorization: `Basic ${credentials}`,
|
|
35
|
+
Accept: 'application/json',
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
if (!res.ok) {
|
|
39
|
+
const text = await res.text();
|
|
40
|
+
throw new Error(`BambooHR API error (${res.status}): ${text}`);
|
|
41
|
+
}
|
|
42
|
+
return res.json();
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const tools: McpToolExport['tools'] = [
|
|
46
|
+
{
|
|
47
|
+
name: 'bamboohr_list_employees',
|
|
48
|
+
description: 'List employees from BambooHR. Returns a directory of all employees.',
|
|
49
|
+
inputSchema: {
|
|
50
|
+
type: 'object' as const,
|
|
51
|
+
properties: {
|
|
52
|
+
_apiKey: { type: 'string', description: 'BambooHR API key' },
|
|
53
|
+
_subdomain: { type: 'string', description: 'BambooHR subdomain (e.g., "mycompany" from mycompany.bamboohr.com)' },
|
|
54
|
+
},
|
|
55
|
+
required: ['_apiKey', '_subdomain'],
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: 'bamboohr_get_employee',
|
|
60
|
+
description: 'Get details for a specific employee by ID. Specify which fields to retrieve.',
|
|
61
|
+
inputSchema: {
|
|
62
|
+
type: 'object' as const,
|
|
63
|
+
properties: {
|
|
64
|
+
_apiKey: { type: 'string', description: 'BambooHR API key' },
|
|
65
|
+
_subdomain: { type: 'string', description: 'BambooHR subdomain' },
|
|
66
|
+
id: { type: 'number', description: 'Employee ID' },
|
|
67
|
+
fields: { type: 'string', description: 'Comma-separated field names (e.g., "firstName,lastName,department,jobTitle,workEmail")' },
|
|
68
|
+
},
|
|
69
|
+
required: ['_apiKey', '_subdomain', 'id', 'fields'],
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: 'bamboohr_get_directory',
|
|
74
|
+
description: 'Get the employee directory from BambooHR with basic info for all employees.',
|
|
75
|
+
inputSchema: {
|
|
76
|
+
type: 'object' as const,
|
|
77
|
+
properties: {
|
|
78
|
+
_apiKey: { type: 'string', description: 'BambooHR API key' },
|
|
79
|
+
_subdomain: { type: 'string', description: 'BambooHR subdomain' },
|
|
80
|
+
},
|
|
81
|
+
required: ['_apiKey', '_subdomain'],
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
name: 'bamboohr_list_timeoff',
|
|
86
|
+
description: 'List time-off requests within a date range.',
|
|
87
|
+
inputSchema: {
|
|
88
|
+
type: 'object' as const,
|
|
89
|
+
properties: {
|
|
90
|
+
_apiKey: { type: 'string', description: 'BambooHR API key' },
|
|
91
|
+
_subdomain: { type: 'string', description: 'BambooHR subdomain' },
|
|
92
|
+
start: { type: 'string', description: 'Start date (YYYY-MM-DD)' },
|
|
93
|
+
end: { type: 'string', description: 'End date (YYYY-MM-DD)' },
|
|
94
|
+
},
|
|
95
|
+
required: ['_apiKey', '_subdomain', 'start', 'end'],
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
name: 'bamboohr_get_employee_files',
|
|
100
|
+
description: 'Get a list of files associated with an employee.',
|
|
101
|
+
inputSchema: {
|
|
102
|
+
type: 'object' as const,
|
|
103
|
+
properties: {
|
|
104
|
+
_apiKey: { type: 'string', description: 'BambooHR API key' },
|
|
105
|
+
_subdomain: { type: 'string', description: 'BambooHR subdomain' },
|
|
106
|
+
id: { type: 'number', description: 'Employee ID' },
|
|
107
|
+
},
|
|
108
|
+
required: ['_apiKey', '_subdomain', 'id'],
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
];
|
|
112
|
+
|
|
113
|
+
async function callTool(name: string, args: Record<string, unknown>): Promise<unknown> {
|
|
114
|
+
const apiKey = args._apiKey as string;
|
|
115
|
+
const subdomain = args._subdomain as string;
|
|
116
|
+
|
|
117
|
+
switch (name) {
|
|
118
|
+
case 'bamboohr_list_employees': {
|
|
119
|
+
return bhrFetch(apiKey, subdomain, '/employees/directory');
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
case 'bamboohr_get_employee': {
|
|
123
|
+
const id = args.id as number;
|
|
124
|
+
const fields = args.fields as string;
|
|
125
|
+
return bhrFetch(apiKey, subdomain, `/employees/${id}?fields=${encodeURIComponent(fields)}`);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
case 'bamboohr_get_directory': {
|
|
129
|
+
return bhrFetch(apiKey, subdomain, '/employees/directory');
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
case 'bamboohr_list_timeoff': {
|
|
133
|
+
const start = args.start as string;
|
|
134
|
+
const end = args.end as string;
|
|
135
|
+
return bhrFetch(apiKey, subdomain, `/time_off/requests?start=${start}&end=${end}&status=approved`);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
case 'bamboohr_get_employee_files': {
|
|
139
|
+
const id = args.id as number;
|
|
140
|
+
return bhrFetch(apiKey, subdomain, `/employees/${id}/files/view`);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
default:
|
|
144
|
+
throw new Error(`Unknown tool: ${name}`);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export default { tools, callTool, meter: { credits: 10 } } satisfies McpToolExport;
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "bundler",
|
|
6
|
+
"strict": true,
|
|
7
|
+
"esModuleInterop": true,
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
"outDir": "dist",
|
|
10
|
+
"rootDir": "src",
|
|
11
|
+
"declaration": true
|
|
12
|
+
},
|
|
13
|
+
"include": ["src"]
|
|
14
|
+
}
|