@hasna/microservices 0.0.16 → 0.0.18

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.
Files changed (293) hide show
  1. package/README.md +143 -23
  2. package/bin/index.js +784 -13987
  3. package/bin/mcp.js +298 -10973
  4. package/dist/index.js +251 -10056
  5. package/package.json +36 -26
  6. package/microservices/microservice-ads/package.json +0 -28
  7. package/microservices/microservice-ads/src/cli/index.ts +0 -605
  8. package/microservices/microservice-ads/src/db/campaigns.ts +0 -797
  9. package/microservices/microservice-ads/src/db/database.ts +0 -91
  10. package/microservices/microservice-ads/src/db/migrations.ts +0 -60
  11. package/microservices/microservice-ads/src/index.ts +0 -39
  12. package/microservices/microservice-ads/src/mcp/index.ts +0 -480
  13. package/microservices/microservice-analytics/package.json +0 -28
  14. package/microservices/microservice-analytics/src/cli/index.ts +0 -373
  15. package/microservices/microservice-analytics/src/db/analytics.ts +0 -564
  16. package/microservices/microservice-analytics/src/db/database.ts +0 -91
  17. package/microservices/microservice-analytics/src/db/migrations.ts +0 -50
  18. package/microservices/microservice-analytics/src/index.ts +0 -37
  19. package/microservices/microservice-analytics/src/mcp/index.ts +0 -334
  20. package/microservices/microservice-assets/package.json +0 -28
  21. package/microservices/microservice-assets/src/cli/index.ts +0 -375
  22. package/microservices/microservice-assets/src/db/assets.ts +0 -370
  23. package/microservices/microservice-assets/src/db/database.ts +0 -91
  24. package/microservices/microservice-assets/src/db/migrations.ts +0 -51
  25. package/microservices/microservice-assets/src/index.ts +0 -32
  26. package/microservices/microservice-assets/src/mcp/index.ts +0 -346
  27. package/microservices/microservice-bookkeeping/package.json +0 -28
  28. package/microservices/microservice-bookkeeping/src/cli/index.ts +0 -386
  29. package/microservices/microservice-bookkeeping/src/db/bookkeeping.ts +0 -591
  30. package/microservices/microservice-bookkeeping/src/db/database.ts +0 -91
  31. package/microservices/microservice-bookkeeping/src/db/migrations.ts +0 -52
  32. package/microservices/microservice-bookkeeping/src/index.ts +0 -32
  33. package/microservices/microservice-bookkeeping/src/mcp/index.ts +0 -284
  34. package/microservices/microservice-calendar/package.json +0 -28
  35. package/microservices/microservice-calendar/src/cli/index.ts +0 -287
  36. package/microservices/microservice-calendar/src/db/calendar.ts +0 -328
  37. package/microservices/microservice-calendar/src/db/database.ts +0 -91
  38. package/microservices/microservice-calendar/src/db/migrations.ts +0 -47
  39. package/microservices/microservice-calendar/src/index.ts +0 -24
  40. package/microservices/microservice-calendar/src/mcp/index.ts +0 -226
  41. package/microservices/microservice-company/package.json +0 -28
  42. package/microservices/microservice-company/src/cli/index.ts +0 -1126
  43. package/microservices/microservice-company/src/db/company.ts +0 -854
  44. package/microservices/microservice-company/src/db/database.ts +0 -91
  45. package/microservices/microservice-company/src/db/migrations.ts +0 -214
  46. package/microservices/microservice-company/src/db/workflow-migrations.ts +0 -44
  47. package/microservices/microservice-company/src/index.ts +0 -60
  48. package/microservices/microservice-company/src/lib/audit.ts +0 -168
  49. package/microservices/microservice-company/src/lib/finance.ts +0 -299
  50. package/microservices/microservice-company/src/lib/settings.ts +0 -85
  51. package/microservices/microservice-company/src/lib/workflows.ts +0 -698
  52. package/microservices/microservice-company/src/mcp/index.ts +0 -991
  53. package/microservices/microservice-compliance/package.json +0 -28
  54. package/microservices/microservice-compliance/src/cli/index.ts +0 -467
  55. package/microservices/microservice-compliance/src/db/compliance.ts +0 -633
  56. package/microservices/microservice-compliance/src/db/database.ts +0 -91
  57. package/microservices/microservice-compliance/src/db/migrations.ts +0 -63
  58. package/microservices/microservice-compliance/src/index.ts +0 -46
  59. package/microservices/microservice-compliance/src/mcp/index.ts +0 -438
  60. package/microservices/microservice-contacts/package.json +0 -28
  61. package/microservices/microservice-contacts/src/cli/index.ts +0 -393
  62. package/microservices/microservice-contacts/src/db/companies.ts +0 -167
  63. package/microservices/microservice-contacts/src/db/contacts.ts +0 -249
  64. package/microservices/microservice-contacts/src/db/database.ts +0 -91
  65. package/microservices/microservice-contacts/src/db/migrations.ts +0 -71
  66. package/microservices/microservice-contacts/src/db/relationships.ts +0 -53
  67. package/microservices/microservice-contacts/src/index.ts +0 -42
  68. package/microservices/microservice-contacts/src/mcp/index.ts +0 -303
  69. package/microservices/microservice-contracts/package.json +0 -28
  70. package/microservices/microservice-contracts/src/cli/index.ts +0 -770
  71. package/microservices/microservice-contracts/src/db/contracts.ts +0 -925
  72. package/microservices/microservice-contracts/src/db/database.ts +0 -91
  73. package/microservices/microservice-contracts/src/db/migrations.ts +0 -141
  74. package/microservices/microservice-contracts/src/index.ts +0 -43
  75. package/microservices/microservice-contracts/src/mcp/index.ts +0 -617
  76. package/microservices/microservice-crm/package.json +0 -28
  77. package/microservices/microservice-crm/src/cli/index.ts +0 -396
  78. package/microservices/microservice-crm/src/db/database.ts +0 -91
  79. package/microservices/microservice-crm/src/db/migrations.ts +0 -66
  80. package/microservices/microservice-crm/src/db/pipeline.ts +0 -397
  81. package/microservices/microservice-crm/src/index.ts +0 -34
  82. package/microservices/microservice-crm/src/mcp/index.ts +0 -294
  83. package/microservices/microservice-documents/package.json +0 -28
  84. package/microservices/microservice-documents/src/cli/index.ts +0 -246
  85. package/microservices/microservice-documents/src/db/database.ts +0 -91
  86. package/microservices/microservice-documents/src/db/documents.ts +0 -316
  87. package/microservices/microservice-documents/src/db/migrations.ts +0 -49
  88. package/microservices/microservice-documents/src/index.ts +0 -24
  89. package/microservices/microservice-documents/src/mcp/index.ts +0 -202
  90. package/microservices/microservice-domains/package.json +0 -28
  91. package/microservices/microservice-domains/src/cli/index.ts +0 -1111
  92. package/microservices/microservice-domains/src/db/database.ts +0 -91
  93. package/microservices/microservice-domains/src/db/domains.ts +0 -1164
  94. package/microservices/microservice-domains/src/db/migrations.ts +0 -60
  95. package/microservices/microservice-domains/src/index.ts +0 -65
  96. package/microservices/microservice-domains/src/lib/brandsight.ts +0 -350
  97. package/microservices/microservice-domains/src/lib/godaddy.ts +0 -338
  98. package/microservices/microservice-domains/src/lib/namecheap.ts +0 -262
  99. package/microservices/microservice-domains/src/lib/registrar.ts +0 -355
  100. package/microservices/microservice-domains/src/mcp/index.ts +0 -781
  101. package/microservices/microservice-expenses/package.json +0 -28
  102. package/microservices/microservice-expenses/src/cli/index.ts +0 -267
  103. package/microservices/microservice-expenses/src/db/database.ts +0 -91
  104. package/microservices/microservice-expenses/src/db/expenses.ts +0 -345
  105. package/microservices/microservice-expenses/src/db/migrations.ts +0 -45
  106. package/microservices/microservice-expenses/src/index.ts +0 -25
  107. package/microservices/microservice-expenses/src/mcp/index.ts +0 -196
  108. package/microservices/microservice-habits/package.json +0 -28
  109. package/microservices/microservice-habits/src/cli/index.ts +0 -315
  110. package/microservices/microservice-habits/src/db/database.ts +0 -91
  111. package/microservices/microservice-habits/src/db/habits.ts +0 -451
  112. package/microservices/microservice-habits/src/db/migrations.ts +0 -46
  113. package/microservices/microservice-habits/src/index.ts +0 -31
  114. package/microservices/microservice-habits/src/mcp/index.ts +0 -313
  115. package/microservices/microservice-health/package.json +0 -28
  116. package/microservices/microservice-health/src/cli/index.ts +0 -484
  117. package/microservices/microservice-health/src/db/database.ts +0 -91
  118. package/microservices/microservice-health/src/db/health.ts +0 -708
  119. package/microservices/microservice-health/src/db/migrations.ts +0 -70
  120. package/microservices/microservice-health/src/index.ts +0 -63
  121. package/microservices/microservice-health/src/mcp/index.ts +0 -437
  122. package/microservices/microservice-hiring/package.json +0 -28
  123. package/microservices/microservice-hiring/src/cli/index.ts +0 -741
  124. package/microservices/microservice-hiring/src/db/database.ts +0 -91
  125. package/microservices/microservice-hiring/src/db/hiring.ts +0 -1085
  126. package/microservices/microservice-hiring/src/db/migrations.ts +0 -89
  127. package/microservices/microservice-hiring/src/index.ts +0 -80
  128. package/microservices/microservice-hiring/src/lib/scoring.ts +0 -206
  129. package/microservices/microservice-hiring/src/mcp/index.ts +0 -709
  130. package/microservices/microservice-inventory/package.json +0 -28
  131. package/microservices/microservice-inventory/src/cli/index.ts +0 -365
  132. package/microservices/microservice-inventory/src/db/database.ts +0 -91
  133. package/microservices/microservice-inventory/src/db/inventory.ts +0 -393
  134. package/microservices/microservice-inventory/src/db/migrations.ts +0 -54
  135. package/microservices/microservice-inventory/src/index.ts +0 -28
  136. package/microservices/microservice-inventory/src/mcp/index.ts +0 -250
  137. package/microservices/microservice-invoices/dashboard/index.html +0 -12
  138. package/microservices/microservice-invoices/dashboard/package.json +0 -29
  139. package/microservices/microservice-invoices/dashboard/tsconfig.json +0 -14
  140. package/microservices/microservice-invoices/dashboard/vite.config.ts +0 -15
  141. package/microservices/microservice-invoices/package.json +0 -31
  142. package/microservices/microservice-invoices/src/cli/index.ts +0 -308
  143. package/microservices/microservice-invoices/src/db/business.ts +0 -241
  144. package/microservices/microservice-invoices/src/db/clients.ts +0 -127
  145. package/microservices/microservice-invoices/src/db/database.ts +0 -91
  146. package/microservices/microservice-invoices/src/db/invoices.ts +0 -345
  147. package/microservices/microservice-invoices/src/db/migrations.ts +0 -184
  148. package/microservices/microservice-invoices/src/index.ts +0 -56
  149. package/microservices/microservice-invoices/src/mcp/index.ts +0 -242
  150. package/microservices/microservice-invoices/src/server/index.ts +0 -162
  151. package/microservices/microservice-leads/package.json +0 -28
  152. package/microservices/microservice-leads/src/cli/index.ts +0 -596
  153. package/microservices/microservice-leads/src/db/database.ts +0 -91
  154. package/microservices/microservice-leads/src/db/leads.ts +0 -520
  155. package/microservices/microservice-leads/src/db/lists.ts +0 -151
  156. package/microservices/microservice-leads/src/db/migrations.ts +0 -93
  157. package/microservices/microservice-leads/src/index.ts +0 -65
  158. package/microservices/microservice-leads/src/lib/enrichment.ts +0 -202
  159. package/microservices/microservice-leads/src/lib/scoring.ts +0 -134
  160. package/microservices/microservice-leads/src/mcp/index.ts +0 -533
  161. package/microservices/microservice-notes/package.json +0 -28
  162. package/microservices/microservice-notes/src/cli/index.ts +0 -63
  163. package/microservices/microservice-notes/src/db/database.ts +0 -91
  164. package/microservices/microservice-notes/src/db/migrations.ts +0 -40
  165. package/microservices/microservice-notes/src/db/notes.ts +0 -114
  166. package/microservices/microservice-notes/src/index.ts +0 -2
  167. package/microservices/microservice-notes/src/mcp/index.ts +0 -37
  168. package/microservices/microservice-notifications/package.json +0 -28
  169. package/microservices/microservice-notifications/src/cli/index.ts +0 -349
  170. package/microservices/microservice-notifications/src/db/database.ts +0 -91
  171. package/microservices/microservice-notifications/src/db/migrations.ts +0 -62
  172. package/microservices/microservice-notifications/src/db/notifications.ts +0 -509
  173. package/microservices/microservice-notifications/src/index.ts +0 -41
  174. package/microservices/microservice-notifications/src/mcp/index.ts +0 -422
  175. package/microservices/microservice-payments/package.json +0 -28
  176. package/microservices/microservice-payments/src/cli/index.ts +0 -609
  177. package/microservices/microservice-payments/src/db/database.ts +0 -91
  178. package/microservices/microservice-payments/src/db/migrations.ts +0 -81
  179. package/microservices/microservice-payments/src/db/payments.ts +0 -1204
  180. package/microservices/microservice-payments/src/index.ts +0 -51
  181. package/microservices/microservice-payments/src/mcp/index.ts +0 -683
  182. package/microservices/microservice-payroll/package.json +0 -28
  183. package/microservices/microservice-payroll/src/cli/index.ts +0 -643
  184. package/microservices/microservice-payroll/src/db/database.ts +0 -91
  185. package/microservices/microservice-payroll/src/db/migrations.ts +0 -95
  186. package/microservices/microservice-payroll/src/db/payroll.ts +0 -1377
  187. package/microservices/microservice-payroll/src/index.ts +0 -48
  188. package/microservices/microservice-payroll/src/mcp/index.ts +0 -666
  189. package/microservices/microservice-products/package.json +0 -28
  190. package/microservices/microservice-products/src/cli/index.ts +0 -416
  191. package/microservices/microservice-products/src/db/categories.ts +0 -154
  192. package/microservices/microservice-products/src/db/database.ts +0 -91
  193. package/microservices/microservice-products/src/db/migrations.ts +0 -58
  194. package/microservices/microservice-products/src/db/pricing-tiers.ts +0 -66
  195. package/microservices/microservice-products/src/db/products.ts +0 -452
  196. package/microservices/microservice-products/src/index.ts +0 -53
  197. package/microservices/microservice-products/src/mcp/index.ts +0 -453
  198. package/microservices/microservice-projects/package.json +0 -28
  199. package/microservices/microservice-projects/src/cli/index.ts +0 -480
  200. package/microservices/microservice-projects/src/db/database.ts +0 -91
  201. package/microservices/microservice-projects/src/db/migrations.ts +0 -65
  202. package/microservices/microservice-projects/src/db/projects.ts +0 -715
  203. package/microservices/microservice-projects/src/index.ts +0 -57
  204. package/microservices/microservice-projects/src/mcp/index.ts +0 -501
  205. package/microservices/microservice-proposals/package.json +0 -28
  206. package/microservices/microservice-proposals/src/cli/index.ts +0 -400
  207. package/microservices/microservice-proposals/src/db/database.ts +0 -91
  208. package/microservices/microservice-proposals/src/db/migrations.ts +0 -52
  209. package/microservices/microservice-proposals/src/db/proposals.ts +0 -532
  210. package/microservices/microservice-proposals/src/index.ts +0 -37
  211. package/microservices/microservice-proposals/src/mcp/index.ts +0 -375
  212. package/microservices/microservice-reading/package.json +0 -28
  213. package/microservices/microservice-reading/src/cli/index.ts +0 -464
  214. package/microservices/microservice-reading/src/db/database.ts +0 -91
  215. package/microservices/microservice-reading/src/db/migrations.ts +0 -59
  216. package/microservices/microservice-reading/src/db/reading.ts +0 -524
  217. package/microservices/microservice-reading/src/index.ts +0 -51
  218. package/microservices/microservice-reading/src/mcp/index.ts +0 -368
  219. package/microservices/microservice-shipping/package.json +0 -28
  220. package/microservices/microservice-shipping/src/cli/index.ts +0 -606
  221. package/microservices/microservice-shipping/src/db/database.ts +0 -91
  222. package/microservices/microservice-shipping/src/db/migrations.ts +0 -69
  223. package/microservices/microservice-shipping/src/db/shipping.ts +0 -1093
  224. package/microservices/microservice-shipping/src/index.ts +0 -53
  225. package/microservices/microservice-shipping/src/mcp/index.ts +0 -533
  226. package/microservices/microservice-social/package.json +0 -29
  227. package/microservices/microservice-social/src/cli/index.ts +0 -1583
  228. package/microservices/microservice-social/src/db/database.ts +0 -91
  229. package/microservices/microservice-social/src/db/migrations.ts +0 -160
  230. package/microservices/microservice-social/src/db/social.ts +0 -1076
  231. package/microservices/microservice-social/src/index.ts +0 -46
  232. package/microservices/microservice-social/src/lib/audience.ts +0 -353
  233. package/microservices/microservice-social/src/lib/content-ai.ts +0 -278
  234. package/microservices/microservice-social/src/lib/media.ts +0 -311
  235. package/microservices/microservice-social/src/lib/mentions.ts +0 -434
  236. package/microservices/microservice-social/src/lib/metrics-sync.ts +0 -264
  237. package/microservices/microservice-social/src/lib/publisher.ts +0 -377
  238. package/microservices/microservice-social/src/lib/scheduler.ts +0 -229
  239. package/microservices/microservice-social/src/lib/sentiment.ts +0 -256
  240. package/microservices/microservice-social/src/lib/threads.ts +0 -291
  241. package/microservices/microservice-social/src/mcp/index.ts +0 -1425
  242. package/microservices/microservice-social/src/server/index.ts +0 -441
  243. package/microservices/microservice-subscriptions/package.json +0 -28
  244. package/microservices/microservice-subscriptions/src/cli/index.ts +0 -715
  245. package/microservices/microservice-subscriptions/src/db/database.ts +0 -91
  246. package/microservices/microservice-subscriptions/src/db/migrations.ts +0 -125
  247. package/microservices/microservice-subscriptions/src/db/subscriptions.ts +0 -1256
  248. package/microservices/microservice-subscriptions/src/index.ts +0 -41
  249. package/microservices/microservice-subscriptions/src/mcp/index.ts +0 -631
  250. package/microservices/microservice-timesheets/package.json +0 -28
  251. package/microservices/microservice-timesheets/src/cli/index.ts +0 -373
  252. package/microservices/microservice-timesheets/src/db/database.ts +0 -91
  253. package/microservices/microservice-timesheets/src/db/locale.ts +0 -217
  254. package/microservices/microservice-timesheets/src/db/migrations.ts +0 -74
  255. package/microservices/microservice-timesheets/src/db/timesheets.ts +0 -447
  256. package/microservices/microservice-timesheets/src/index.ts +0 -44
  257. package/microservices/microservice-timesheets/src/mcp/index.ts +0 -269
  258. package/microservices/microservice-transcriber/package.json +0 -29
  259. package/microservices/microservice-transcriber/src/cli/index.ts +0 -1593
  260. package/microservices/microservice-transcriber/src/db/annotations.ts +0 -37
  261. package/microservices/microservice-transcriber/src/db/comments.ts +0 -166
  262. package/microservices/microservice-transcriber/src/db/database.ts +0 -91
  263. package/microservices/microservice-transcriber/src/db/migrations.ts +0 -118
  264. package/microservices/microservice-transcriber/src/db/proofread.ts +0 -119
  265. package/microservices/microservice-transcriber/src/db/transcripts.ts +0 -395
  266. package/microservices/microservice-transcriber/src/index.ts +0 -43
  267. package/microservices/microservice-transcriber/src/lib/config.ts +0 -77
  268. package/microservices/microservice-transcriber/src/lib/diff.ts +0 -91
  269. package/microservices/microservice-transcriber/src/lib/downloader.ts +0 -638
  270. package/microservices/microservice-transcriber/src/lib/feeds.ts +0 -62
  271. package/microservices/microservice-transcriber/src/lib/live.ts +0 -94
  272. package/microservices/microservice-transcriber/src/lib/notion.ts +0 -129
  273. package/microservices/microservice-transcriber/src/lib/proofread.ts +0 -296
  274. package/microservices/microservice-transcriber/src/lib/providers.ts +0 -713
  275. package/microservices/microservice-transcriber/src/lib/summarizer.ts +0 -147
  276. package/microservices/microservice-transcriber/src/lib/translator.ts +0 -75
  277. package/microservices/microservice-transcriber/src/lib/webhook.ts +0 -37
  278. package/microservices/microservice-transcriber/src/mcp/index.ts +0 -1330
  279. package/microservices/microservice-transcriber/src/server/index.ts +0 -199
  280. package/microservices/microservice-travel/package.json +0 -28
  281. package/microservices/microservice-travel/src/cli/index.ts +0 -505
  282. package/microservices/microservice-travel/src/db/database.ts +0 -91
  283. package/microservices/microservice-travel/src/db/migrations.ts +0 -77
  284. package/microservices/microservice-travel/src/db/travel.ts +0 -802
  285. package/microservices/microservice-travel/src/index.ts +0 -60
  286. package/microservices/microservice-travel/src/mcp/index.ts +0 -495
  287. package/microservices/microservice-wiki/package.json +0 -28
  288. package/microservices/microservice-wiki/src/cli/index.ts +0 -345
  289. package/microservices/microservice-wiki/src/db/database.ts +0 -91
  290. package/microservices/microservice-wiki/src/db/migrations.ts +0 -55
  291. package/microservices/microservice-wiki/src/db/wiki.ts +0 -395
  292. package/microservices/microservice-wiki/src/index.ts +0 -32
  293. package/microservices/microservice-wiki/src/mcp/index.ts +0 -344
@@ -1,48 +0,0 @@
1
- /**
2
- * microservice-payroll — Payroll management microservice
3
- */
4
-
5
- export {
6
- createEmployee,
7
- getEmployee,
8
- listEmployees,
9
- updateEmployee,
10
- deleteEmployee,
11
- terminateEmployee,
12
- countEmployees,
13
- type Employee,
14
- type CreateEmployeeInput,
15
- type UpdateEmployeeInput,
16
- type ListEmployeesOptions,
17
- createPayPeriod,
18
- getPayPeriod,
19
- listPayPeriods,
20
- updatePayPeriodStatus,
21
- deletePayPeriod,
22
- type PayPeriod,
23
- type CreatePayPeriodInput,
24
- createPayStub,
25
- getPayStub,
26
- listPayStubs,
27
- deletePayStub,
28
- type PayStub,
29
- type CreatePayStubInput,
30
- createPayment,
31
- getPayment,
32
- listPayments,
33
- updatePaymentStatus,
34
- deletePayment,
35
- type Payment,
36
- type CreatePaymentInput,
37
- calculateDeductions,
38
- calculateGrossPay,
39
- processPayroll,
40
- getPayrollReport,
41
- getYtdReport,
42
- getTaxSummary,
43
- type PayrollReport,
44
- type YtdReport,
45
- type TaxSummaryEntry,
46
- } from "./db/payroll.js";
47
-
48
- export { getDatabase, closeDatabase } from "./db/database.js";
@@ -1,666 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
4
- import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
5
- import { z } from "zod";
6
- import {
7
- createEmployee,
8
- getEmployee,
9
- listEmployees,
10
- updateEmployee,
11
- terminateEmployee,
12
- createPayPeriod,
13
- getPayPeriod,
14
- listPayPeriods,
15
- updatePayPeriodStatus,
16
- processPayroll,
17
- listPayStubs,
18
- getPayStub,
19
- createPayment,
20
- getPayment,
21
- listPayments,
22
- updatePaymentStatus,
23
- getPayrollReport,
24
- getYtdReport,
25
- getTaxSummary,
26
- createBenefit,
27
- listBenefits,
28
- removeBenefit,
29
- generateAchFile,
30
- generateW2,
31
- generate1099,
32
- setSchedule,
33
- getNextPayPeriod,
34
- auditPayroll,
35
- forecastPayroll,
36
- checkOvertime,
37
- } from "../db/payroll.js";
38
-
39
- const server = new McpServer({
40
- name: "microservice-payroll",
41
- version: "0.0.1",
42
- });
43
-
44
- // --- Employees ---
45
-
46
- server.registerTool(
47
- "create_employee",
48
- {
49
- title: "Create Employee",
50
- description: "Create a new employee.",
51
- inputSchema: {
52
- name: z.string(),
53
- email: z.string().optional(),
54
- type: z.enum(["employee", "contractor"]).optional(),
55
- department: z.string().optional(),
56
- title: z.string().optional(),
57
- pay_rate: z.number(),
58
- pay_type: z.enum(["salary", "hourly"]).optional(),
59
- currency: z.string().optional(),
60
- tax_info: z.record(z.unknown()).optional(),
61
- start_date: z.string().optional(),
62
- },
63
- },
64
- async (params) => {
65
- const employee = createEmployee(params);
66
- return { content: [{ type: "text", text: JSON.stringify(employee, null, 2) }] };
67
- }
68
- );
69
-
70
- server.registerTool(
71
- "get_employee",
72
- {
73
- title: "Get Employee",
74
- description: "Get an employee by ID.",
75
- inputSchema: { id: z.string() },
76
- },
77
- async ({ id }) => {
78
- const employee = getEmployee(id);
79
- if (!employee) {
80
- return { content: [{ type: "text", text: `Employee '${id}' not found.` }], isError: true };
81
- }
82
- return { content: [{ type: "text", text: JSON.stringify(employee, null, 2) }] };
83
- }
84
- );
85
-
86
- server.registerTool(
87
- "list_employees",
88
- {
89
- title: "List Employees",
90
- description: "List employees with optional filters.",
91
- inputSchema: {
92
- search: z.string().optional(),
93
- status: z.string().optional(),
94
- department: z.string().optional(),
95
- type: z.string().optional(),
96
- limit: z.number().optional(),
97
- },
98
- },
99
- async (params) => {
100
- const employees = listEmployees(params);
101
- return {
102
- content: [
103
- { type: "text", text: JSON.stringify({ employees, count: employees.length }, null, 2) },
104
- ],
105
- };
106
- }
107
- );
108
-
109
- server.registerTool(
110
- "update_employee",
111
- {
112
- title: "Update Employee",
113
- description: "Update an existing employee.",
114
- inputSchema: {
115
- id: z.string(),
116
- name: z.string().optional(),
117
- email: z.string().optional(),
118
- type: z.enum(["employee", "contractor"]).optional(),
119
- department: z.string().optional(),
120
- title: z.string().optional(),
121
- pay_rate: z.number().optional(),
122
- pay_type: z.enum(["salary", "hourly"]).optional(),
123
- currency: z.string().optional(),
124
- tax_info: z.record(z.unknown()).optional(),
125
- },
126
- },
127
- async ({ id, ...input }) => {
128
- const employee = updateEmployee(id, input);
129
- if (!employee) {
130
- return { content: [{ type: "text", text: `Employee '${id}' not found.` }], isError: true };
131
- }
132
- return { content: [{ type: "text", text: JSON.stringify(employee, null, 2) }] };
133
- }
134
- );
135
-
136
- server.registerTool(
137
- "terminate_employee",
138
- {
139
- title: "Terminate Employee",
140
- description: "Terminate an employee.",
141
- inputSchema: {
142
- id: z.string(),
143
- end_date: z.string().optional(),
144
- },
145
- },
146
- async ({ id, end_date }) => {
147
- const employee = terminateEmployee(id, end_date);
148
- if (!employee) {
149
- return { content: [{ type: "text", text: `Employee '${id}' not found.` }], isError: true };
150
- }
151
- return { content: [{ type: "text", text: JSON.stringify(employee, null, 2) }] };
152
- }
153
- );
154
-
155
- // --- Pay Periods ---
156
-
157
- server.registerTool(
158
- "create_pay_period",
159
- {
160
- title: "Create Pay Period",
161
- description: "Create a new pay period.",
162
- inputSchema: {
163
- start_date: z.string(),
164
- end_date: z.string(),
165
- },
166
- },
167
- async (params) => {
168
- const period = createPayPeriod(params);
169
- return { content: [{ type: "text", text: JSON.stringify(period, null, 2) }] };
170
- }
171
- );
172
-
173
- server.registerTool(
174
- "get_pay_period",
175
- {
176
- title: "Get Pay Period",
177
- description: "Get a pay period by ID.",
178
- inputSchema: { id: z.string() },
179
- },
180
- async ({ id }) => {
181
- const period = getPayPeriod(id);
182
- if (!period) {
183
- return { content: [{ type: "text", text: `Pay period '${id}' not found.` }], isError: true };
184
- }
185
- return { content: [{ type: "text", text: JSON.stringify(period, null, 2) }] };
186
- }
187
- );
188
-
189
- server.registerTool(
190
- "list_pay_periods",
191
- {
192
- title: "List Pay Periods",
193
- description: "List pay periods with optional status filter.",
194
- inputSchema: {
195
- status: z.string().optional(),
196
- },
197
- },
198
- async ({ status }) => {
199
- const periods = listPayPeriods(status);
200
- return {
201
- content: [
202
- { type: "text", text: JSON.stringify({ periods, count: periods.length }, null, 2) },
203
- ],
204
- };
205
- }
206
- );
207
-
208
- server.registerTool(
209
- "update_pay_period_status",
210
- {
211
- title: "Update Pay Period Status",
212
- description: "Update the status of a pay period.",
213
- inputSchema: {
214
- id: z.string(),
215
- status: z.enum(["draft", "processing", "completed"]),
216
- },
217
- },
218
- async ({ id, status }) => {
219
- const period = updatePayPeriodStatus(id, status);
220
- if (!period) {
221
- return { content: [{ type: "text", text: `Pay period '${id}' not found.` }], isError: true };
222
- }
223
- return { content: [{ type: "text", text: JSON.stringify(period, null, 2) }] };
224
- }
225
- );
226
-
227
- // --- Payroll Processing ---
228
-
229
- server.registerTool(
230
- "process_payroll",
231
- {
232
- title: "Process Payroll",
233
- description: "Process payroll for a pay period, auto-generating pay stubs for all active employees.",
234
- inputSchema: {
235
- period_id: z.string(),
236
- },
237
- },
238
- async ({ period_id }) => {
239
- try {
240
- const stubs = processPayroll(period_id);
241
- return {
242
- content: [
243
- { type: "text", text: JSON.stringify({ stubs, count: stubs.length }, null, 2) },
244
- ],
245
- };
246
- } catch (error) {
247
- return {
248
- content: [{ type: "text", text: `Error: ${error instanceof Error ? error.message : String(error)}` }],
249
- isError: true,
250
- };
251
- }
252
- }
253
- );
254
-
255
- // --- Pay Stubs ---
256
-
257
- server.registerTool(
258
- "list_pay_stubs",
259
- {
260
- title: "List Pay Stubs",
261
- description: "List pay stubs with optional filters.",
262
- inputSchema: {
263
- employee_id: z.string().optional(),
264
- pay_period_id: z.string().optional(),
265
- },
266
- },
267
- async (params) => {
268
- const stubs = listPayStubs(params);
269
- return {
270
- content: [
271
- { type: "text", text: JSON.stringify({ stubs, count: stubs.length }, null, 2) },
272
- ],
273
- };
274
- }
275
- );
276
-
277
- server.registerTool(
278
- "get_pay_stub",
279
- {
280
- title: "Get Pay Stub",
281
- description: "Get a pay stub by ID.",
282
- inputSchema: { id: z.string() },
283
- },
284
- async ({ id }) => {
285
- const stub = getPayStub(id);
286
- if (!stub) {
287
- return { content: [{ type: "text", text: `Pay stub '${id}' not found.` }], isError: true };
288
- }
289
- return { content: [{ type: "text", text: JSON.stringify(stub, null, 2) }] };
290
- }
291
- );
292
-
293
- // --- Payments ---
294
-
295
- server.registerTool(
296
- "create_payment",
297
- {
298
- title: "Create Payment",
299
- description: "Create a payment for a pay stub.",
300
- inputSchema: {
301
- pay_stub_id: z.string(),
302
- method: z.enum(["direct_deposit", "check", "wire"]).optional(),
303
- reference: z.string().optional(),
304
- },
305
- },
306
- async (params) => {
307
- const payment = createPayment(params);
308
- return { content: [{ type: "text", text: JSON.stringify(payment, null, 2) }] };
309
- }
310
- );
311
-
312
- server.registerTool(
313
- "get_payment",
314
- {
315
- title: "Get Payment",
316
- description: "Get a payment by ID.",
317
- inputSchema: { id: z.string() },
318
- },
319
- async ({ id }) => {
320
- const payment = getPayment(id);
321
- if (!payment) {
322
- return { content: [{ type: "text", text: `Payment '${id}' not found.` }], isError: true };
323
- }
324
- return { content: [{ type: "text", text: JSON.stringify(payment, null, 2) }] };
325
- }
326
- );
327
-
328
- server.registerTool(
329
- "list_payments",
330
- {
331
- title: "List Payments",
332
- description: "List payments with optional filters.",
333
- inputSchema: {
334
- pay_stub_id: z.string().optional(),
335
- status: z.string().optional(),
336
- },
337
- },
338
- async (params) => {
339
- const payments = listPayments(params);
340
- return {
341
- content: [
342
- { type: "text", text: JSON.stringify({ payments, count: payments.length }, null, 2) },
343
- ],
344
- };
345
- }
346
- );
347
-
348
- server.registerTool(
349
- "update_payment_status",
350
- {
351
- title: "Update Payment Status",
352
- description: "Update the status of a payment.",
353
- inputSchema: {
354
- id: z.string(),
355
- status: z.enum(["pending", "paid", "failed"]),
356
- },
357
- },
358
- async ({ id, status }) => {
359
- const payment = updatePaymentStatus(id, status);
360
- if (!payment) {
361
- return { content: [{ type: "text", text: `Payment '${id}' not found.` }], isError: true };
362
- }
363
- return { content: [{ type: "text", text: JSON.stringify(payment, null, 2) }] };
364
- }
365
- );
366
-
367
- // --- Reports ---
368
-
369
- server.registerTool(
370
- "payroll_report",
371
- {
372
- title: "Payroll Report",
373
- description: "Get a payroll report for a pay period.",
374
- inputSchema: { period_id: z.string() },
375
- },
376
- async ({ period_id }) => {
377
- const report = getPayrollReport(period_id);
378
- if (!report) {
379
- return { content: [{ type: "text", text: `Pay period '${period_id}' not found.` }], isError: true };
380
- }
381
- return { content: [{ type: "text", text: JSON.stringify(report, null, 2) }] };
382
- }
383
- );
384
-
385
- server.registerTool(
386
- "ytd_report",
387
- {
388
- title: "YTD Report",
389
- description: "Get year-to-date report for an employee.",
390
- inputSchema: {
391
- employee_id: z.string(),
392
- year: z.number().optional(),
393
- },
394
- },
395
- async ({ employee_id, year }) => {
396
- const report = getYtdReport(employee_id, year);
397
- if (!report) {
398
- return { content: [{ type: "text", text: `Employee '${employee_id}' not found.` }], isError: true };
399
- }
400
- return { content: [{ type: "text", text: JSON.stringify(report, null, 2) }] };
401
- }
402
- );
403
-
404
- server.registerTool(
405
- "tax_summary",
406
- {
407
- title: "Tax Summary",
408
- description: "Get tax summary for all employees for a given year.",
409
- inputSchema: { year: z.number() },
410
- },
411
- async ({ year }) => {
412
- const summary = getTaxSummary(year);
413
- return {
414
- content: [
415
- { type: "text", text: JSON.stringify({ summary, count: summary.length }, null, 2) },
416
- ],
417
- };
418
- }
419
- );
420
-
421
- // --- Benefits ---
422
-
423
- server.registerTool(
424
- "create_benefit",
425
- {
426
- title: "Create Benefit",
427
- description: "Add a benefit deduction to an employee (health, dental, vision, retirement, hsa, other).",
428
- inputSchema: {
429
- employee_id: z.string(),
430
- type: z.enum(["health", "dental", "vision", "retirement", "hsa", "other"]),
431
- description: z.string().optional(),
432
- amount: z.number(),
433
- frequency: z.enum(["per_period", "monthly", "annual"]).optional(),
434
- },
435
- },
436
- async (params) => {
437
- try {
438
- const benefit = createBenefit(params);
439
- return { content: [{ type: "text", text: JSON.stringify(benefit, null, 2) }] };
440
- } catch (error) {
441
- return {
442
- content: [{ type: "text", text: `Error: ${error instanceof Error ? error.message : String(error)}` }],
443
- isError: true,
444
- };
445
- }
446
- }
447
- );
448
-
449
- server.registerTool(
450
- "list_benefits",
451
- {
452
- title: "List Benefits",
453
- description: "List benefit deductions, optionally filtered by employee.",
454
- inputSchema: {
455
- employee_id: z.string().optional(),
456
- },
457
- },
458
- async ({ employee_id }) => {
459
- const benefits = listBenefits(employee_id);
460
- return {
461
- content: [
462
- { type: "text", text: JSON.stringify({ benefits, count: benefits.length }, null, 2) },
463
- ],
464
- };
465
- }
466
- );
467
-
468
- server.registerTool(
469
- "remove_benefit",
470
- {
471
- title: "Remove Benefit",
472
- description: "Deactivate a benefit by ID.",
473
- inputSchema: { id: z.string() },
474
- },
475
- async ({ id }) => {
476
- const removed = removeBenefit(id);
477
- if (!removed) {
478
- return { content: [{ type: "text", text: `Benefit '${id}' not found.` }], isError: true };
479
- }
480
- return { content: [{ type: "text", text: JSON.stringify({ removed: true, id }) }] };
481
- }
482
- );
483
-
484
- // --- ACH File Generation ---
485
-
486
- server.registerTool(
487
- "generate_ach_file",
488
- {
489
- title: "Generate ACH File",
490
- description: "Generate a NACHA-format ACH file for a completed pay period.",
491
- inputSchema: {
492
- period_id: z.string(),
493
- bank_routing: z.string(),
494
- bank_account: z.string(),
495
- company_name: z.string().optional(),
496
- },
497
- },
498
- async ({ period_id, bank_routing, bank_account, company_name }) => {
499
- try {
500
- const content = generateAchFile(period_id, bank_routing, bank_account, company_name);
501
- return { content: [{ type: "text", text: content }] };
502
- } catch (error) {
503
- return {
504
- content: [{ type: "text", text: `Error: ${error instanceof Error ? error.message : String(error)}` }],
505
- isError: true,
506
- };
507
- }
508
- }
509
- );
510
-
511
- // --- W-2 ---
512
-
513
- server.registerTool(
514
- "generate_w2",
515
- {
516
- title: "Generate W-2",
517
- description: "Generate W-2 data for an employee for a given tax year.",
518
- inputSchema: {
519
- employee_id: z.string(),
520
- year: z.number(),
521
- },
522
- },
523
- async ({ employee_id, year }) => {
524
- const w2 = generateW2(employee_id, year);
525
- if (!w2) {
526
- return {
527
- content: [{ type: "text", text: "No W-2 data found (employee not found, is a contractor, or has no pay stubs)." }],
528
- isError: true,
529
- };
530
- }
531
- return { content: [{ type: "text", text: JSON.stringify(w2, null, 2) }] };
532
- }
533
- );
534
-
535
- // --- 1099-NEC ---
536
-
537
- server.registerTool(
538
- "generate_1099",
539
- {
540
- title: "Generate 1099-NEC",
541
- description: "Generate 1099-NEC data for contractors with >$600 compensation in a given year.",
542
- inputSchema: {
543
- employee_id: z.string().optional(),
544
- year: z.number(),
545
- },
546
- },
547
- async ({ employee_id, year }) => {
548
- const forms = generate1099(employee_id || null, year);
549
- return {
550
- content: [
551
- { type: "text", text: JSON.stringify({ forms, count: forms.length }, null, 2) },
552
- ],
553
- };
554
- }
555
- );
556
-
557
- // --- Payroll Schedule ---
558
-
559
- server.registerTool(
560
- "set_schedule",
561
- {
562
- title: "Set Payroll Schedule",
563
- description: "Set the payroll schedule frequency and anchor date.",
564
- inputSchema: {
565
- frequency: z.enum(["weekly", "biweekly", "semimonthly", "monthly"]),
566
- anchor_date: z.string(),
567
- },
568
- },
569
- async ({ frequency, anchor_date }) => {
570
- const schedule = setSchedule(frequency, anchor_date);
571
- return { content: [{ type: "text", text: JSON.stringify(schedule, null, 2) }] };
572
- }
573
- );
574
-
575
- server.registerTool(
576
- "next_pay_period",
577
- {
578
- title: "Next Pay Period",
579
- description: "Get the next pay period dates based on the configured payroll schedule.",
580
- inputSchema: {},
581
- },
582
- async () => {
583
- const next = getNextPayPeriod();
584
- if (!next) {
585
- return {
586
- content: [{ type: "text", text: "No payroll schedule configured. Use set_schedule first." }],
587
- isError: true,
588
- };
589
- }
590
- return { content: [{ type: "text", text: JSON.stringify(next, null, 2) }] };
591
- }
592
- );
593
-
594
- // --- Audit ---
595
-
596
- server.registerTool(
597
- "audit_payroll",
598
- {
599
- title: "Audit Payroll",
600
- description: "Audit a payroll period for issues: missing stubs, bad net_pay, deduction mismatches, duplicates.",
601
- inputSchema: {
602
- period_id: z.string(),
603
- },
604
- },
605
- async ({ period_id }) => {
606
- try {
607
- const result = auditPayroll(period_id);
608
- return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
609
- } catch (error) {
610
- return {
611
- content: [{ type: "text", text: `Error: ${error instanceof Error ? error.message : String(error)}` }],
612
- isError: true,
613
- };
614
- }
615
- }
616
- );
617
-
618
- // --- Forecast ---
619
-
620
- server.registerTool(
621
- "forecast_payroll",
622
- {
623
- title: "Forecast Payroll",
624
- description: "Project future payroll costs for a given number of months.",
625
- inputSchema: {
626
- months: z.number().min(1).max(60),
627
- },
628
- },
629
- async ({ months }) => {
630
- const result = forecastPayroll(months);
631
- return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
632
- }
633
- );
634
-
635
- // --- Overtime ---
636
-
637
- server.registerTool(
638
- "check_overtime",
639
- {
640
- title: "Check Overtime",
641
- description: "Flag employees exceeding a weekly hours threshold in the most recent completed period.",
642
- inputSchema: {
643
- threshold: z.number().optional(),
644
- },
645
- },
646
- async ({ threshold }) => {
647
- const alerts = checkOvertime(threshold);
648
- return {
649
- content: [
650
- { type: "text", text: JSON.stringify({ alerts, count: alerts.length }, null, 2) },
651
- ],
652
- };
653
- }
654
- );
655
-
656
- // --- Start ---
657
- async function main() {
658
- const transport = new StdioServerTransport();
659
- await server.connect(transport);
660
- console.error("microservice-payroll MCP server running on stdio");
661
- }
662
-
663
- main().catch((error) => {
664
- console.error("Fatal error:", error);
665
- process.exit(1);
666
- });