@t4dhg/mcp-factorial 2.0.0 → 3.0.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/README.md +87 -63
- package/dist/api.d.ts +321 -1
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +899 -1
- package/dist/api.js.map +1 -1
- package/dist/audit.d.ts +86 -0
- package/dist/audit.d.ts.map +1 -0
- package/dist/audit.js +119 -0
- package/dist/audit.js.map +1 -0
- package/dist/confirmation.d.ts +118 -0
- package/dist/confirmation.d.ts.map +1 -0
- package/dist/confirmation.js +153 -0
- package/dist/confirmation.js.map +1 -0
- package/dist/errors.d.ts +33 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +65 -0
- package/dist/errors.js.map +1 -1
- package/dist/http-client.d.ts +38 -1
- package/dist/http-client.d.ts.map +1 -1
- package/dist/http-client.js +111 -14
- package/dist/http-client.js.map +1 -1
- package/dist/index.d.ts +6 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2313 -55
- package/dist/index.js.map +1 -1
- package/dist/schemas.d.ts +1287 -0
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +477 -0
- package/dist/schemas.js.map +1 -1
- package/dist/write-safety.d.ts +53 -0
- package/dist/write-safety.d.ts.map +1 -0
- package/dist/write-safety.js +239 -0
- package/dist/write-safety.js.map +1 -0
- package/llms.txt +115 -0
- package/package.json +23 -4
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Write operation safety and risk classification
|
|
3
|
+
*
|
|
4
|
+
* Provides risk levels and policies for write operations to help
|
|
5
|
+
* determine which operations require confirmation or special handling.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Risk levels for write operations
|
|
9
|
+
*/
|
|
10
|
+
export var OperationRisk;
|
|
11
|
+
(function (OperationRisk) {
|
|
12
|
+
/** Low risk - minor updates, safe to execute without confirmation */
|
|
13
|
+
OperationRisk["LOW"] = "low";
|
|
14
|
+
/** Medium risk - creates or significant updates, preview recommended */
|
|
15
|
+
OperationRisk["MEDIUM"] = "medium";
|
|
16
|
+
/** High risk - deletes, terminates, affects multiple records */
|
|
17
|
+
OperationRisk["HIGH"] = "high";
|
|
18
|
+
/** Critical risk - irreversible bulk operations, require explicit confirmation */
|
|
19
|
+
OperationRisk["CRITICAL"] = "critical";
|
|
20
|
+
})(OperationRisk || (OperationRisk = {}));
|
|
21
|
+
/**
|
|
22
|
+
* Default policies for write operations
|
|
23
|
+
*/
|
|
24
|
+
export const OPERATION_POLICIES = {
|
|
25
|
+
// Employee operations
|
|
26
|
+
create_employee: {
|
|
27
|
+
risk: OperationRisk.MEDIUM,
|
|
28
|
+
requiresConfirmation: false,
|
|
29
|
+
requiresPreview: true,
|
|
30
|
+
impactDescription: 'Creates a new employee record in the system',
|
|
31
|
+
},
|
|
32
|
+
update_employee: {
|
|
33
|
+
risk: OperationRisk.LOW,
|
|
34
|
+
requiresConfirmation: false,
|
|
35
|
+
requiresPreview: true,
|
|
36
|
+
impactDescription: 'Updates employee information',
|
|
37
|
+
},
|
|
38
|
+
terminate_employee: {
|
|
39
|
+
risk: OperationRisk.HIGH,
|
|
40
|
+
requiresConfirmation: true,
|
|
41
|
+
requiresPreview: true,
|
|
42
|
+
impactDescription: 'Terminates employee, revoking access and removing from active lists',
|
|
43
|
+
},
|
|
44
|
+
// Team operations
|
|
45
|
+
create_team: {
|
|
46
|
+
risk: OperationRisk.MEDIUM,
|
|
47
|
+
requiresConfirmation: false,
|
|
48
|
+
requiresPreview: true,
|
|
49
|
+
impactDescription: 'Creates a new team',
|
|
50
|
+
},
|
|
51
|
+
update_team: {
|
|
52
|
+
risk: OperationRisk.LOW,
|
|
53
|
+
requiresConfirmation: false,
|
|
54
|
+
requiresPreview: true,
|
|
55
|
+
impactDescription: 'Updates team information',
|
|
56
|
+
},
|
|
57
|
+
delete_team: {
|
|
58
|
+
risk: OperationRisk.HIGH,
|
|
59
|
+
requiresConfirmation: true,
|
|
60
|
+
requiresPreview: true,
|
|
61
|
+
impactDescription: 'Deletes the team and removes all member associations',
|
|
62
|
+
},
|
|
63
|
+
add_team_member: {
|
|
64
|
+
risk: OperationRisk.LOW,
|
|
65
|
+
requiresConfirmation: false,
|
|
66
|
+
requiresPreview: false,
|
|
67
|
+
impactDescription: 'Adds an employee to the team',
|
|
68
|
+
},
|
|
69
|
+
remove_team_member: {
|
|
70
|
+
risk: OperationRisk.LOW,
|
|
71
|
+
requiresConfirmation: false,
|
|
72
|
+
requiresPreview: false,
|
|
73
|
+
impactDescription: 'Removes an employee from the team',
|
|
74
|
+
},
|
|
75
|
+
// Location operations
|
|
76
|
+
create_location: {
|
|
77
|
+
risk: OperationRisk.MEDIUM,
|
|
78
|
+
requiresConfirmation: false,
|
|
79
|
+
requiresPreview: true,
|
|
80
|
+
impactDescription: 'Creates a new office location',
|
|
81
|
+
},
|
|
82
|
+
update_location: {
|
|
83
|
+
risk: OperationRisk.LOW,
|
|
84
|
+
requiresConfirmation: false,
|
|
85
|
+
requiresPreview: true,
|
|
86
|
+
impactDescription: 'Updates location information',
|
|
87
|
+
},
|
|
88
|
+
delete_location: {
|
|
89
|
+
risk: OperationRisk.HIGH,
|
|
90
|
+
requiresConfirmation: true,
|
|
91
|
+
requiresPreview: true,
|
|
92
|
+
impactDescription: 'Deletes the location and removes employee associations',
|
|
93
|
+
},
|
|
94
|
+
// Leave operations
|
|
95
|
+
create_leave: {
|
|
96
|
+
risk: OperationRisk.MEDIUM,
|
|
97
|
+
requiresConfirmation: false,
|
|
98
|
+
requiresPreview: true,
|
|
99
|
+
impactDescription: 'Creates a new leave request',
|
|
100
|
+
},
|
|
101
|
+
update_leave: {
|
|
102
|
+
risk: OperationRisk.LOW,
|
|
103
|
+
requiresConfirmation: false,
|
|
104
|
+
requiresPreview: true,
|
|
105
|
+
impactDescription: 'Updates leave request details',
|
|
106
|
+
},
|
|
107
|
+
cancel_leave: {
|
|
108
|
+
risk: OperationRisk.MEDIUM,
|
|
109
|
+
requiresConfirmation: true,
|
|
110
|
+
requiresPreview: true,
|
|
111
|
+
impactDescription: 'Cancels the leave request',
|
|
112
|
+
},
|
|
113
|
+
approve_leave: {
|
|
114
|
+
risk: OperationRisk.MEDIUM,
|
|
115
|
+
requiresConfirmation: false,
|
|
116
|
+
requiresPreview: true,
|
|
117
|
+
impactDescription: 'Approves the leave request, deducting from allowance',
|
|
118
|
+
},
|
|
119
|
+
reject_leave: {
|
|
120
|
+
risk: OperationRisk.MEDIUM,
|
|
121
|
+
requiresConfirmation: true,
|
|
122
|
+
requiresPreview: true,
|
|
123
|
+
impactDescription: 'Rejects the leave request',
|
|
124
|
+
},
|
|
125
|
+
// Shift operations
|
|
126
|
+
create_shift: {
|
|
127
|
+
risk: OperationRisk.LOW,
|
|
128
|
+
requiresConfirmation: false,
|
|
129
|
+
requiresPreview: false,
|
|
130
|
+
impactDescription: 'Creates an attendance shift record',
|
|
131
|
+
},
|
|
132
|
+
update_shift: {
|
|
133
|
+
risk: OperationRisk.LOW,
|
|
134
|
+
requiresConfirmation: false,
|
|
135
|
+
requiresPreview: false,
|
|
136
|
+
impactDescription: 'Updates shift clock in/out times',
|
|
137
|
+
},
|
|
138
|
+
delete_shift: {
|
|
139
|
+
risk: OperationRisk.MEDIUM,
|
|
140
|
+
requiresConfirmation: true,
|
|
141
|
+
requiresPreview: true,
|
|
142
|
+
impactDescription: 'Deletes the shift record',
|
|
143
|
+
},
|
|
144
|
+
// Document operations
|
|
145
|
+
upload_document: {
|
|
146
|
+
risk: OperationRisk.MEDIUM,
|
|
147
|
+
requiresConfirmation: false,
|
|
148
|
+
requiresPreview: true,
|
|
149
|
+
impactDescription: 'Uploads a new document',
|
|
150
|
+
},
|
|
151
|
+
update_document: {
|
|
152
|
+
risk: OperationRisk.LOW,
|
|
153
|
+
requiresConfirmation: false,
|
|
154
|
+
requiresPreview: false,
|
|
155
|
+
impactDescription: 'Updates document metadata',
|
|
156
|
+
},
|
|
157
|
+
delete_document: {
|
|
158
|
+
risk: OperationRisk.HIGH,
|
|
159
|
+
requiresConfirmation: true,
|
|
160
|
+
requiresPreview: true,
|
|
161
|
+
impactDescription: 'Permanently deletes the document',
|
|
162
|
+
},
|
|
163
|
+
// Project operations
|
|
164
|
+
create_project: {
|
|
165
|
+
risk: OperationRisk.MEDIUM,
|
|
166
|
+
requiresConfirmation: false,
|
|
167
|
+
requiresPreview: true,
|
|
168
|
+
impactDescription: 'Creates a new project',
|
|
169
|
+
},
|
|
170
|
+
update_project: {
|
|
171
|
+
risk: OperationRisk.LOW,
|
|
172
|
+
requiresConfirmation: false,
|
|
173
|
+
requiresPreview: true,
|
|
174
|
+
impactDescription: 'Updates project details',
|
|
175
|
+
},
|
|
176
|
+
delete_project: {
|
|
177
|
+
risk: OperationRisk.HIGH,
|
|
178
|
+
requiresConfirmation: true,
|
|
179
|
+
requiresPreview: true,
|
|
180
|
+
impactDescription: 'Deletes the project and all associated tasks/time records',
|
|
181
|
+
},
|
|
182
|
+
// ATS operations
|
|
183
|
+
create_job_posting: {
|
|
184
|
+
risk: OperationRisk.MEDIUM,
|
|
185
|
+
requiresConfirmation: false,
|
|
186
|
+
requiresPreview: true,
|
|
187
|
+
impactDescription: 'Creates a new job posting',
|
|
188
|
+
},
|
|
189
|
+
delete_job_posting: {
|
|
190
|
+
risk: OperationRisk.HIGH,
|
|
191
|
+
requiresConfirmation: true,
|
|
192
|
+
requiresPreview: true,
|
|
193
|
+
impactDescription: 'Deletes the job posting and all applications',
|
|
194
|
+
},
|
|
195
|
+
delete_candidate: {
|
|
196
|
+
risk: OperationRisk.HIGH,
|
|
197
|
+
requiresConfirmation: true,
|
|
198
|
+
requiresPreview: true,
|
|
199
|
+
impactDescription: 'Permanently deletes the candidate record',
|
|
200
|
+
},
|
|
201
|
+
// Training operations
|
|
202
|
+
delete_training: {
|
|
203
|
+
risk: OperationRisk.HIGH,
|
|
204
|
+
requiresConfirmation: true,
|
|
205
|
+
requiresPreview: true,
|
|
206
|
+
impactDescription: 'Deletes the training program and all enrollments',
|
|
207
|
+
},
|
|
208
|
+
};
|
|
209
|
+
/**
|
|
210
|
+
* Get the policy for an operation
|
|
211
|
+
*/
|
|
212
|
+
export function getOperationPolicy(operationName) {
|
|
213
|
+
return (OPERATION_POLICIES[operationName] ?? {
|
|
214
|
+
risk: OperationRisk.MEDIUM,
|
|
215
|
+
requiresConfirmation: false,
|
|
216
|
+
requiresPreview: true,
|
|
217
|
+
impactDescription: 'Modifies data in FactorialHR',
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Check if an operation requires confirmation
|
|
222
|
+
*/
|
|
223
|
+
export function requiresConfirmation(operationName) {
|
|
224
|
+
return getOperationPolicy(operationName).requiresConfirmation;
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Get a warning message for high-risk operations
|
|
228
|
+
*/
|
|
229
|
+
export function getWarningMessage(operationName) {
|
|
230
|
+
const policy = getOperationPolicy(operationName);
|
|
231
|
+
if (policy.risk === OperationRisk.HIGH || policy.risk === OperationRisk.CRITICAL) {
|
|
232
|
+
return (`**Warning:** This is a ${policy.risk}-risk operation. ${policy.impactDescription}. ` +
|
|
233
|
+
(policy.requiresConfirmation
|
|
234
|
+
? 'Please confirm by setting `confirm: true`.'
|
|
235
|
+
: 'Please review carefully before proceeding.'));
|
|
236
|
+
}
|
|
237
|
+
return null;
|
|
238
|
+
}
|
|
239
|
+
//# sourceMappingURL=write-safety.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"write-safety.js","sourceRoot":"","sources":["../src/write-safety.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,CAAN,IAAY,aASX;AATD,WAAY,aAAa;IACvB,qEAAqE;IACrE,4BAAW,CAAA;IACX,wEAAwE;IACxE,kCAAiB,CAAA;IACjB,gEAAgE;IAChE,8BAAa,CAAA;IACb,kFAAkF;IAClF,sCAAqB,CA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AAM,CAAC,IAAI,oBAAoB,MAAM,CAAC,iBAAiB,IAAI;YACrF,CAAC,MAAM,CAAC,oBAAoB;gBAC1B,CAAC,CAAC,4CAA4C;gBAC9C,CAAC,CAAC,4CAA4C,CAAC,CAClD,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/llms.txt
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# MCP FactorialHR
|
|
2
|
+
|
|
3
|
+
> The definitive Model Context Protocol server for FactorialHR
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
MCP FactorialHR provides comprehensive access to FactorialHR data through the Model Context Protocol. It enables AI assistants like Claude to interact with your HR system for employees, teams, time off, attendance, projects, training, recruiting, and payroll.
|
|
8
|
+
|
|
9
|
+
## Key Features
|
|
10
|
+
|
|
11
|
+
- **80+ Tools**: Full CRUD operations for all major HR entities
|
|
12
|
+
- **Safety Guardrails**: High-risk operations (terminate, delete) require confirmation
|
|
13
|
+
- **Audit Logging**: All write operations are logged
|
|
14
|
+
- **Read-only Payroll**: Payroll data is accessible but read-only for security
|
|
15
|
+
- **Pagination**: All list operations support pagination
|
|
16
|
+
- **Caching**: TTL-based caching for performance
|
|
17
|
+
- **Validation**: Runtime validation with Zod schemas
|
|
18
|
+
|
|
19
|
+
## Categories
|
|
20
|
+
|
|
21
|
+
### Employees (6 tools)
|
|
22
|
+
- list_employees, get_employee, search_employees
|
|
23
|
+
- create_employee, update_employee, terminate_employee
|
|
24
|
+
|
|
25
|
+
### Teams (5 tools)
|
|
26
|
+
- list_teams, get_team
|
|
27
|
+
- create_team, update_team, delete_team
|
|
28
|
+
|
|
29
|
+
### Locations (5 tools)
|
|
30
|
+
- list_locations, get_location
|
|
31
|
+
- create_location, update_location, delete_location
|
|
32
|
+
|
|
33
|
+
### Time Off (10 tools)
|
|
34
|
+
- list_leaves, get_leave, list_leave_types, get_leave_type, list_allowances
|
|
35
|
+
- create_leave, update_leave, cancel_leave, approve_leave, reject_leave
|
|
36
|
+
|
|
37
|
+
### Attendance (5 tools)
|
|
38
|
+
- list_shifts, get_shift
|
|
39
|
+
- create_shift, update_shift, delete_shift
|
|
40
|
+
|
|
41
|
+
### Projects (17 tools)
|
|
42
|
+
- list_projects, get_project, create_project, update_project, delete_project
|
|
43
|
+
- list_project_tasks, create_project_task, update_project_task, delete_project_task
|
|
44
|
+
- list_project_workers, assign_project_worker, remove_project_worker
|
|
45
|
+
- list_time_records, create_time_record, update_time_record, delete_time_record
|
|
46
|
+
|
|
47
|
+
### Training (14 tools)
|
|
48
|
+
- list_trainings, get_training, create_training, update_training, delete_training
|
|
49
|
+
- list_training_sessions, create_training_session, update_training_session, delete_training_session
|
|
50
|
+
- list_training_enrollments, enroll_in_training, unenroll_from_training
|
|
51
|
+
|
|
52
|
+
### Work Areas (6 tools)
|
|
53
|
+
- list_work_areas, get_work_area
|
|
54
|
+
- create_work_area, update_work_area, archive_work_area, unarchive_work_area
|
|
55
|
+
|
|
56
|
+
### ATS/Recruiting (16 tools)
|
|
57
|
+
- list_job_postings, get_job_posting, create_job_posting, update_job_posting, delete_job_posting
|
|
58
|
+
- list_candidates, get_candidate, create_candidate, update_candidate, delete_candidate
|
|
59
|
+
- list_applications, get_application, create_application, update_application, delete_application
|
|
60
|
+
- advance_application, list_hiring_stages
|
|
61
|
+
|
|
62
|
+
### Payroll (6 tools, read-only)
|
|
63
|
+
- list_payroll_supplements, get_payroll_supplement
|
|
64
|
+
- list_tax_identifiers, get_tax_identifier
|
|
65
|
+
- list_family_situations, get_family_situation
|
|
66
|
+
|
|
67
|
+
### Documents (4 tools, read-only)
|
|
68
|
+
- list_folders, get_folder, list_documents, get_document
|
|
69
|
+
|
|
70
|
+
### Job Catalog (3 tools, read-only)
|
|
71
|
+
- list_job_roles, get_job_role, list_job_levels
|
|
72
|
+
|
|
73
|
+
### Contracts (1 tool, read-only)
|
|
74
|
+
- get_employee_contracts
|
|
75
|
+
|
|
76
|
+
## MCP Resources
|
|
77
|
+
|
|
78
|
+
- factorial://org-chart - Organization hierarchy
|
|
79
|
+
- factorial://employees/directory - Employee directory by team
|
|
80
|
+
- factorial://locations/directory - Location directory
|
|
81
|
+
- factorial://timeoff/policies - Leave types and policies
|
|
82
|
+
- factorial://teams/{team_id} - Team details (templated)
|
|
83
|
+
|
|
84
|
+
## MCP Prompts
|
|
85
|
+
|
|
86
|
+
- onboard-employee - Generate onboarding checklists
|
|
87
|
+
- analyze-org-structure - Analyze organizational structure
|
|
88
|
+
- timeoff-report - Generate time off reports
|
|
89
|
+
|
|
90
|
+
## Installation
|
|
91
|
+
|
|
92
|
+
```json
|
|
93
|
+
{
|
|
94
|
+
"mcpServers": {
|
|
95
|
+
"factorial": {
|
|
96
|
+
"command": "npx",
|
|
97
|
+
"args": ["-y", "@t4dhg/mcp-factorial"],
|
|
98
|
+
"env": {
|
|
99
|
+
"FACTORIAL_API_KEY": "your-api-key"
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Links
|
|
107
|
+
|
|
108
|
+
- npm: https://www.npmjs.com/package/@t4dhg/mcp-factorial
|
|
109
|
+
- GitHub: https://github.com/t4dhg/mcp-factorial
|
|
110
|
+
- FactorialHR API: https://apidoc.factorialhr.com/
|
|
111
|
+
|
|
112
|
+
## Contact
|
|
113
|
+
|
|
114
|
+
Author: Taig Mac Carthy
|
|
115
|
+
Website: https://taigmaccarthy.com/
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@t4dhg/mcp-factorial",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "MCP server for FactorialHR -
|
|
3
|
+
"version": "3.0.0",
|
|
4
|
+
"description": "The definitive MCP server for FactorialHR - Full CRUD operations for employees, teams, time off, projects, training, recruiting (ATS), and payroll. 80+ tools with safety guardrails.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"bin": {
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
},
|
|
10
10
|
"files": [
|
|
11
11
|
"dist/",
|
|
12
|
-
"README.md"
|
|
12
|
+
"README.md",
|
|
13
|
+
"llms.txt"
|
|
13
14
|
],
|
|
14
15
|
"exports": {
|
|
15
16
|
".": {
|
|
@@ -47,13 +48,31 @@
|
|
|
47
48
|
"keywords": [
|
|
48
49
|
"mcp",
|
|
49
50
|
"model-context-protocol",
|
|
51
|
+
"mcp-server",
|
|
50
52
|
"factorial",
|
|
51
53
|
"factorialhr",
|
|
54
|
+
"factorial-hr",
|
|
55
|
+
"hris",
|
|
52
56
|
"hr",
|
|
57
|
+
"hrm",
|
|
58
|
+
"human-resources",
|
|
59
|
+
"employee-management",
|
|
60
|
+
"time-off",
|
|
61
|
+
"attendance",
|
|
62
|
+
"pto",
|
|
63
|
+
"recruiting",
|
|
64
|
+
"ats",
|
|
65
|
+
"applicant-tracking",
|
|
66
|
+
"training",
|
|
67
|
+
"projects",
|
|
68
|
+
"payroll",
|
|
53
69
|
"claude",
|
|
70
|
+
"claude-code",
|
|
54
71
|
"anthropic",
|
|
55
72
|
"ai",
|
|
56
|
-
"llm"
|
|
73
|
+
"llm",
|
|
74
|
+
"ai-integration",
|
|
75
|
+
"enterprise"
|
|
57
76
|
],
|
|
58
77
|
"author": "Taig Mac Carthy <https://taigmaccarthy.com/>",
|
|
59
78
|
"license": "MIT",
|