@frihet/mcp-server 1.9.0-beta.1 → 1.12.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.
Files changed (125) hide show
  1. package/README.md +263 -13
  2. package/dist/__tests__/d4b-hr-payroll-onboarding-tools.test.d.ts +13 -0
  3. package/dist/__tests__/d4b-hr-payroll-onboarding-tools.test.d.ts.map +1 -0
  4. package/dist/__tests__/d4b-hr-payroll-onboarding-tools.test.js +420 -0
  5. package/dist/__tests__/d4b-hr-payroll-onboarding-tools.test.js.map +1 -0
  6. package/dist/__tests__/einvoice-day4-tools.test.d.ts +16 -0
  7. package/dist/__tests__/einvoice-day4-tools.test.d.ts.map +1 -0
  8. package/dist/__tests__/einvoice-day4-tools.test.js +377 -0
  9. package/dist/__tests__/einvoice-day4-tools.test.js.map +1 -0
  10. package/dist/__tests__/einvoice-tools.test.d.ts +1 -1
  11. package/dist/__tests__/einvoice-tools.test.js +25 -12
  12. package/dist/__tests__/einvoice-tools.test.js.map +1 -1
  13. package/dist/__tests__/fiscal-tools.test.d.ts +5 -4
  14. package/dist/__tests__/fiscal-tools.test.d.ts.map +1 -1
  15. package/dist/__tests__/fiscal-tools.test.js +8 -26
  16. package/dist/__tests__/fiscal-tools.test.js.map +1 -1
  17. package/dist/__tests__/openai-profile.test.d.ts +10 -0
  18. package/dist/__tests__/openai-profile.test.d.ts.map +1 -0
  19. package/dist/__tests__/openai-profile.test.js +132 -0
  20. package/dist/__tests__/openai-profile.test.js.map +1 -0
  21. package/dist/__tests__/recurring-tools.test.d.ts +14 -7
  22. package/dist/__tests__/recurring-tools.test.d.ts.map +1 -1
  23. package/dist/__tests__/recurring-tools.test.js +195 -9
  24. package/dist/__tests__/recurring-tools.test.js.map +1 -1
  25. package/dist/__tests__/team-tools.test.d.ts +18 -0
  26. package/dist/__tests__/team-tools.test.d.ts.map +1 -0
  27. package/dist/__tests__/team-tools.test.js +228 -0
  28. package/dist/__tests__/team-tools.test.js.map +1 -0
  29. package/dist/__tests__/time-tools.test.d.ts +9 -7
  30. package/dist/__tests__/time-tools.test.d.ts.map +1 -1
  31. package/dist/__tests__/time-tools.test.js +96 -9
  32. package/dist/__tests__/time-tools.test.js.map +1 -1
  33. package/dist/client-interface.d.ts +236 -0
  34. package/dist/client-interface.d.ts.map +1 -1
  35. package/dist/client.d.ts +245 -1
  36. package/dist/client.d.ts.map +1 -1
  37. package/dist/client.js +266 -5
  38. package/dist/client.js.map +1 -1
  39. package/dist/index.js +6 -6
  40. package/dist/index.js.map +1 -1
  41. package/dist/openai-profile.d.ts +4 -1
  42. package/dist/openai-profile.d.ts.map +1 -1
  43. package/dist/openai-profile.js +105 -1
  44. package/dist/openai-profile.js.map +1 -1
  45. package/dist/tools/accountingClose.d.ts +20 -0
  46. package/dist/tools/accountingClose.d.ts.map +1 -0
  47. package/dist/tools/accountingClose.js +119 -0
  48. package/dist/tools/accountingClose.js.map +1 -0
  49. package/dist/tools/audit_gl.d.ts +19 -0
  50. package/dist/tools/audit_gl.d.ts.map +1 -0
  51. package/dist/tools/audit_gl.js +86 -0
  52. package/dist/tools/audit_gl.js.map +1 -0
  53. package/dist/tools/bank_rules.d.ts +23 -0
  54. package/dist/tools/bank_rules.d.ts.map +1 -0
  55. package/dist/tools/bank_rules.js +96 -0
  56. package/dist/tools/bank_rules.js.map +1 -0
  57. package/dist/tools/einvoice.d.ts +70 -3
  58. package/dist/tools/einvoice.d.ts.map +1 -1
  59. package/dist/tools/einvoice.js +421 -3
  60. package/dist/tools/einvoice.js.map +1 -1
  61. package/dist/tools/fiscal.d.ts +3 -2
  62. package/dist/tools/fiscal.d.ts.map +1 -1
  63. package/dist/tools/fiscal.js +4 -22
  64. package/dist/tools/fiscal.js.map +1 -1
  65. package/dist/tools/gestoria.d.ts +28 -0
  66. package/dist/tools/gestoria.d.ts.map +1 -0
  67. package/dist/tools/gestoria.js +248 -0
  68. package/dist/tools/gestoria.js.map +1 -0
  69. package/dist/tools/hr.d.ts +24 -0
  70. package/dist/tools/hr.d.ts.map +1 -0
  71. package/dist/tools/hr.js +219 -0
  72. package/dist/tools/hr.js.map +1 -0
  73. package/dist/tools/igic.d.ts +19 -0
  74. package/dist/tools/igic.d.ts.map +1 -0
  75. package/dist/tools/igic.js +102 -0
  76. package/dist/tools/igic.js.map +1 -0
  77. package/dist/tools/impuesto_sociedades.d.ts +18 -0
  78. package/dist/tools/impuesto_sociedades.d.ts.map +1 -0
  79. package/dist/tools/impuesto_sociedades.js +64 -0
  80. package/dist/tools/impuesto_sociedades.js.map +1 -0
  81. package/dist/tools/onboard_vies.d.ts +22 -0
  82. package/dist/tools/onboard_vies.d.ts.map +1 -0
  83. package/dist/tools/onboard_vies.js +74 -0
  84. package/dist/tools/onboard_vies.js.map +1 -0
  85. package/dist/tools/onboarding.d.ts +19 -0
  86. package/dist/tools/onboarding.d.ts.map +1 -0
  87. package/dist/tools/onboarding.js +63 -0
  88. package/dist/tools/onboarding.js.map +1 -0
  89. package/dist/tools/payroll.d.ts +20 -0
  90. package/dist/tools/payroll.d.ts.map +1 -0
  91. package/dist/tools/payroll.js +73 -0
  92. package/dist/tools/payroll.js.map +1 -0
  93. package/dist/tools/permissions.d.ts +19 -0
  94. package/dist/tools/permissions.d.ts.map +1 -0
  95. package/dist/tools/permissions.js +52 -0
  96. package/dist/tools/permissions.js.map +1 -0
  97. package/dist/tools/portal_domain.d.ts +19 -0
  98. package/dist/tools/portal_domain.d.ts.map +1 -0
  99. package/dist/tools/portal_domain.js +85 -0
  100. package/dist/tools/portal_domain.js.map +1 -0
  101. package/dist/tools/recurring.d.ts +10 -5
  102. package/dist/tools/recurring.d.ts.map +1 -1
  103. package/dist/tools/recurring.js +178 -6
  104. package/dist/tools/recurring.js.map +1 -1
  105. package/dist/tools/register-all.d.ts +2 -2
  106. package/dist/tools/register-all.d.ts.map +1 -1
  107. package/dist/tools/register-all.js +41 -3
  108. package/dist/tools/register-all.js.map +1 -1
  109. package/dist/tools/shared.d.ts +313 -1
  110. package/dist/tools/shared.d.ts.map +1 -1
  111. package/dist/tools/shared.js +256 -0
  112. package/dist/tools/shared.js.map +1 -1
  113. package/dist/tools/team.d.ts +17 -0
  114. package/dist/tools/team.d.ts.map +1 -0
  115. package/dist/tools/team.js +141 -0
  116. package/dist/tools/team.js.map +1 -0
  117. package/dist/tools/time.d.ts +9 -8
  118. package/dist/tools/time.d.ts.map +1 -1
  119. package/dist/tools/time.js +54 -9
  120. package/dist/tools/time.js.map +1 -1
  121. package/dist/tools/webhooks.d.ts.map +1 -1
  122. package/dist/tools/webhooks.js +27 -1
  123. package/dist/tools/webhooks.js.map +1 -1
  124. package/package.json +12 -5
  125. package/scripts/audit-mcp-refs.mjs +331 -0
package/README.md CHANGED
@@ -17,13 +17,32 @@
17
17
  <a href="https://smithery.ai/server/frihet/frihet-mcp"><img src="https://smithery.ai/badge/frihet/frihet-mcp" alt="Smithery installs"></a>
18
18
  <a href="https://registry.modelcontextprotocol.io/?q=io.frihet"><img src="https://img.shields.io/badge/MCP_Registry-io.frihet%2Ferp-4A90D9?style=flat&logo=anthropic&logoColor=white" alt="MCP Registry"></a>
19
19
  <a href="https://github.com/Frihet-io/frihet-mcp/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-18181b?style=flat&labelColor=09090b" alt="license"></a>
20
- <img src="https://img.shields.io/badge/tools-94-18181b?style=flat&labelColor=09090b" alt="94 tools">
20
+ <img src="https://img.shields.io/badge/tools-151-18181b?style=flat&labelColor=09090b" alt="151 tools">
21
21
  <img src="https://img.shields.io/badge/node-%3E%3D18-18181b?style=flat&labelColor=09090b" alt="node >=18">
22
22
  <a href="https://www.typescriptlang.org/"><img src="https://img.shields.io/badge/TypeScript-18181b?style=flat&labelColor=09090b" alt="TypeScript"></a>
23
23
  </p>
24
24
 
25
25
  ---
26
26
 
27
+ ## Distribution
28
+
29
+ | Channel | Status | Install |
30
+ |---------|--------|---------|
31
+ | **npm** | Live | `npx @frihet/mcp-server` |
32
+ | **Remote endpoint** | Live | `https://mcp.frihet.io/mcp` (zero install, OAuth or API key) |
33
+ | **Smithery** | Live | [smithery.ai/server/frihet/frihet-mcp](https://smithery.ai/server/frihet/frihet-mcp) |
34
+ | **MCP Registry** | Live | [registry.modelcontextprotocol.io](https://registry.modelcontextprotocol.io/?q=io.frihet) |
35
+ | **Glama** | Live | [glama.ai/mcp/servers/@Frihet-io/frihet-mcp](https://glama.ai/mcp/servers/@Frihet-io/frihet-mcp) |
36
+ | **mcp.so** | Auto-index (unverified) | [mcp.so](https://mcp.so) — indexes from npm + GitHub |
37
+ | **PulseMCP** | Auto-index (unverified) | [pulsemcp.com](https://pulsemcp.com) — indexes from npm + GitHub |
38
+ | **Cursor Marketplace** | Coming soon | [cursor.com/marketplace](https://cursor.com/marketplace) |
39
+ | **ChatGPT Apps** | Coming soon | [chatgpt.com](https://chatgpt.com) |
40
+ | **Anthropic Claude Directory** | Coming soon | [claude.ai/settings/connectors](https://claude.ai/settings/connectors) |
41
+
42
+ > **Tool count:** npm `latest` (1.12.0) ships all 151 tools, same as the remote endpoint (`mcp.frihet.io`).
43
+
44
+ ---
45
+
27
46
  ## What is this
28
47
 
29
48
  An MCP server that connects your AI assistant to [Frihet](https://frihet.io). Create invoices by talking. Query expenses in natural language. Manage your entire business from your IDE.
@@ -33,9 +52,9 @@ You: "Create an invoice for TechStart SL, 40 hours of consulting at 75 EUR/h
33
52
  Claude: Done. Invoice INV-2026-089 created. Total: 3,000.00 EUR + 21% IVA = 3,630.00 EUR.
34
53
  ```
35
54
 
36
- 94 tools. 8 resources. 7 prompts. Structured output on every tool. Zero boilerplate.
55
+ 151 tools. 8 resources. 7 prompts. Structured output on every tool. Zero boilerplate.
37
56
 
38
- <!-- v1.9.0-beta.1 — Wave Mature 1: Banking (5) + Fiscal (8) + Stay (5) + POS (4) + Time (4) + Recurring (2) = 94 tools total -->
57
+ <!-- v1.12.0-beta.1 — D4-B megasprint: HR (9), payroll (2), onboarding (2), permissions (2), period close (3), webhook test (1) = +19 = 151 tools total -->
39
58
 
40
59
  ---
41
60
 
@@ -163,7 +182,7 @@ Talk to your ERP. These are real prompts, not marketing copy.
163
182
 
164
183
  ## What to expect
165
184
 
166
- This MCP is a **structured data interface** -- you describe what you want in natural language, and the AI creates, queries, or modifies business records in Frihet. All 94 tools are CRUD operations over the REST API.
185
+ This MCP is a **structured data interface** -- you describe what you want in natural language, and the AI creates, queries, or modifies business records in Frihet. All 151 tools are CRUD operations over the REST API.
167
186
 
168
187
  **Works great:**
169
188
 
@@ -190,9 +209,9 @@ If you need to digitize paper invoices or receipts, extract the data first (e.g.
190
209
 
191
210
  ---
192
211
 
193
- ## Tools (94)
212
+ ## Tools (151)
194
213
 
195
- ### Invoices (6)
214
+ ### Invoices (12)
196
215
 
197
216
  | Tool | What it does |
198
217
  |------|-------------|
@@ -201,7 +220,13 @@ If you need to digitize paper invoices or receipts, extract the data first (e.g.
201
220
  | `create_invoice` | Create a new invoice with line items |
202
221
  | `update_invoice` | Update any invoice field |
203
222
  | `delete_invoice` | Permanently delete an invoice |
204
- | `search_invoices` | Find invoices by client name |
223
+ | `search_invoices` | Find invoices by client name, date, or status |
224
+ | `send_invoice` | Email invoice to client (PDF attachment) |
225
+ | `mark_invoice_paid` | Mark an invoice as paid with optional payment date |
226
+ | `get_invoice_pdf` | Get a download URL for the invoice PDF |
227
+ | `get_invoice_einvoice` | Get the e-invoice XML for a given invoice ID |
228
+ | `create_credit_note` | Create a credit note linked to an existing invoice |
229
+ | `apply_late_fee` | Apply a late payment fee to an overdue invoice |
205
230
 
206
231
  ### Expenses (5)
207
232
 
@@ -256,7 +281,7 @@ If you need to digitize paper invoices or receipts, extract the data first (e.g.
256
281
  | `update_product` | Update pricing or details |
257
282
  | `delete_product` | Remove a product |
258
283
 
259
- ### Quotes (5)
284
+ ### Quotes (6)
260
285
 
261
286
  | Tool | What it does |
262
287
  |------|-------------|
@@ -265,8 +290,9 @@ If you need to digitize paper invoices or receipts, extract the data first (e.g.
265
290
  | `create_quote` | Draft a new quote |
266
291
  | `update_quote` | Modify a quote |
267
292
  | `delete_quote` | Delete a quote |
293
+ | `send_quote` | Email quote to client for acceptance |
268
294
 
269
- ### Webhooks (5)
295
+ ### Webhooks (6)
270
296
 
271
297
  | Tool | What it does |
272
298
  |------|-------------|
@@ -275,6 +301,7 @@ If you need to digitize paper invoices or receipts, extract the data first (e.g.
275
301
  | `create_webhook` | Register a new webhook endpoint |
276
302
  | `update_webhook` | Modify events or URL |
277
303
  | `delete_webhook` | Remove a webhook |
304
+ | `test_webhook` | Send a test payload to a configured webhook endpoint |
278
305
 
279
306
  ### Intelligence (4)
280
307
 
@@ -285,9 +312,9 @@ If you need to digitize paper invoices or receipts, extract the data first (e.g.
285
312
  | `get_quarterly_taxes` | Quarterly tax prep: Modelo 303/130 fields, collected vs deductible, liability |
286
313
  | `duplicate_invoice` | Clone an invoice for recurring billing (copies items/client/tax, starts as draft) |
287
314
 
288
- ## E-Invoicing (4 new in v1.7 pre-release)
315
+ ### E-Invoicing (10)
289
316
 
290
- > **Status: beta — CF endpoints rolling out 2026-04-21 to 2026-04-28.** Tools call `api.frihet.io/v1/einvoice/*` directly. If an endpoint is not yet deployed (404), the tool falls back to `{ _stub: true, _note: "CF endpoint pending deploy", _plannedEndpoint: "..." }` so the server remains usable while transport ships.
317
+ > **Status: beta.** Tools call `api.frihet.io/v1/einvoice/*` directly. If an endpoint is not yet deployed (404), the tool falls back to `{ _stub: true, _note: "CF endpoint pending deploy", _plannedEndpoint: "..." }` so the server remains usable while transport ships.
291
318
 
292
319
  | Tool | What it does |
293
320
  |------|-------------|
@@ -295,8 +322,230 @@ If you need to digitize paper invoices or receipts, extract the data first (e.g.
295
322
  | `get_einvoice_status` | Poll Hatchet workflow run status until succeeded/failed — returns ackId, XML URL, PDF/A-3 URL |
296
323
  | `validate_einvoice_xml` | Validate raw XML against format schema + schematron rules (KOSIT / Mustang / XSD / Schematron) |
297
324
  | `export_datev` | Export accounting data as DATEV EXTF (Buchungsstapel / Debitoren / Kreditoren) in CP1252 encoding |
325
+ | `einvoice_export` | Export e-invoice data in machine-readable formats (JSON/XML) for archival or integration |
326
+ | `face_submit` | Submit invoice to FACe (Spain B2G government e-invoicing platform) |
327
+ | `face_status` | Poll submission status from FACe for a submitted invoice |
328
+ | `ticketbai_submit` | Submit TicketBAI fiscal record to Basque Country tax authority (Hacienda) |
329
+ | `ticketbai_status` | Poll TicketBAI submission status from the Basque tax authority |
330
+ | `ksef_submit` | Submit invoice to KSeF (Poland national e-invoicing system — stub) |
331
+
332
+ ### Time Tracking (6)
333
+
334
+ > **Status: stub** — `/v1/time/*` endpoints planned. Tools surface 404 until backend ships.
335
+
336
+ | Tool | What it does |
337
+ |------|-------------|
338
+ | `list_time_entries` | List time entries with filter by user, project, date range, billable status |
339
+ | `get_time_entry` | Get full details of a single time entry by ID |
340
+ | `create_time_entry` | Log hours for a project (billable flag, description, date) |
341
+ | `update_time_entry` | Update any field on an existing time entry (PATCH semantics) |
342
+ | `delete_time_entry` | Soft-delete a time entry (confirm=true required) |
343
+ | `get_time_summary` | Aggregate total/billable/non-billable hours for a period, with optional groupBy (user/project/day) |
344
+
345
+ ### Recurring Invoices (8)
346
+
347
+ > **Status: stub** — `/v1/recurring/*` endpoints planned. Tools surface 404 until backend ships.
348
+
349
+ | Tool | What it does |
350
+ |------|-------------|
351
+ | `list_recurring_invoices` | List all recurring invoice templates (filter by active/paused) |
352
+ | `get_recurring_invoice` | Get full details of a recurring template by ID |
353
+ | `create_recurring_invoice` | Create a new recurring invoice template (daily/weekly/monthly/quarterly/yearly) |
354
+ | `update_recurring_invoice` | Update template fields — affects future generated invoices only |
355
+ | `pause_recurring_invoice` | Pause an active template — no invoices generated while paused |
356
+ | `resume_recurring_invoice` | Resume a paused template — next invoice on next scheduled cycle |
357
+ | `delete_recurring_invoice` | Permanently delete a template (confirm=true required) |
358
+ | `run_recurring_now` | Manually trigger immediate generation of the next invoice instance |
359
+
360
+ ### Team Management (4)
361
+
362
+ > **Status: stub** — `/v1/team/*` endpoints planned. Tools surface 404 until backend ships.
363
+
364
+ | Tool | What it does |
365
+ |------|-------------|
366
+ | `list_team_members` | List all workspace members with role and invite status |
367
+ | `invite_team_member` | Invite a new member by email with role (admin/member/viewer) |
368
+ | `update_team_member_role` | Change an existing member's role |
369
+ | `remove_team_member` | Remove a member from the workspace (confirm=true required) |
370
+
371
+ ### Gestoria — Accountants (5)
372
+
373
+ > **Status: stub** — `/v1/gestoria/*` REST surface lands with Wave Fase 1 closure (PRs #383 bulk send, #384 aging, #385 messaging). Tools surface 404 until the backend ships.
374
+
375
+ | Tool | What it does |
376
+ |------|-------------|
377
+ | `gestoria_message_send` | Send a message in a contextual thread (documentRequest / filingItem / obligation) |
378
+ | `gestoria_messages_list` | List messages in a thread, newest first; paginate backwards with `before` |
379
+ | `gestoria_template_create` | Create a reusable document request template with variables + due-date offset |
380
+ | `gestoria_template_bulk_send` | Bulk send a template to up to 500 client workspaces in one call |
381
+ | `gestoria_aging_consolidated` | Cross-client AR aging report (buckets, per-workspace breakdown, top overdue) |
382
+
383
+ ### Audit GL (3)
384
+
385
+ > **Status: stub** — `/v1/gl/*` proxies callables `approveGLEntry`, `rejectGLEntry`, `getGLEntryAuditLog` (PR #395). Tools surface 404 until backend ships.
386
+
387
+ | Tool | What it does |
388
+ |------|-------------|
389
+ | `frihet_gl_entry_approve` | Approve a GL journal entry (gestor/admin only — TRUST AREA) |
390
+ | `frihet_gl_entry_reject` | Reject a GL entry with a mandatory reason (TRUST AREA) |
391
+ | `frihet_gl_entry_audit_log` | Retrieve full audit trail for a GL entry |
392
+
393
+ ### White-label Portal Domain (3)
394
+
395
+ > **Status: stub** — `/v1/portal/domain/*` proxies callables `addCustomPortalDomain`, `verifyCustomPortalDomain`, `removeCustomPortalDomain` (PR #397).
396
+
397
+ | Tool | What it does |
398
+ |------|-------------|
399
+ | `frihet_portal_domain_add` | Add a custom domain to the client portal (returns DNS CNAME records) |
400
+ | `frihet_portal_domain_verify` | Verify DNS propagation for a custom portal domain |
401
+ | `frihet_portal_domain_remove` | Remove a custom portal domain (reverts to default Frihet subdomain) |
402
+
403
+ ### Self-onboard & VIES (2)
404
+
405
+ > **Status: stub** — `/v1/portal/onboard/*` proxies callables `generatePortalOnboardLink`, `lookupTaxIdViaVIES` (PR #398). Public portal flows excluded from MCP.
406
+
407
+ | Tool | What it does |
408
+ |------|-------------|
409
+ | `frihet_portal_onboard_link_generate` | Generate a time-limited self-onboard link for a prospective client |
410
+ | `frihet_tax_id_vies_lookup` | Validate an EU VAT number (CIF intracomunitario) via VIES |
411
+
412
+ ### IGIC — Canary Islands Indirect Tax (4)
413
+
414
+ > **Status: stub** — `/v1/igic/*` service-layer reads (PR #390). ATC SOAP excluded (internal infra).
415
+
416
+ | Tool | What it does |
417
+ |------|-------------|
418
+ | `frihet_modelo_415_summary` | M415 annual operations >€3,005 (Canarias equivalent of M347) |
419
+ | `frihet_modelo_425_summary` | M425 annual IGIC recap for Canary Islands businesses |
420
+ | `frihet_modelo_418_summary` | M418 monthly IGIC return for large enterprises (grandes empresas) |
421
+ | `frihet_aiem_calculate` | Calculate AIEM (Arbitrio Importación) for imported/produced goods in Canarias |
422
+
423
+ ### Impuesto sobre Sociedades — Corporate Tax (2)
424
+
425
+ > **Status: stub** — `/v1/is/*` service-layer reads for Spanish SLs/SAs (PR #392).
426
+
427
+ | Tool | What it does |
428
+ |------|-------------|
429
+ | `frihet_modelo_200_summary` | Modelo 200 annual IS return (taxable base, deductions, net payable) |
430
+ | `frihet_modelo_202_summary` | Modelo 202 installment payments (1P April, 2P October, 3P December) |
431
+
432
+ ### Bank Categorization Rules (2)
433
+
434
+ > **Status: stub** — `/v1/banking/rules` Q3-flagged (PR #394). Webhook handlers excluded.
435
+
436
+ | Tool | What it does |
437
+ |------|-------------|
438
+ | `frihet_bank_rules_list` | List all bank auto-categorization rules (conditions + actions + status) |
439
+ | `frihet_bank_rule_create` | Create a new rule to auto-categorize transactions by description, amount, counterparty |
440
+
441
+ ### Deposits (7)
442
+
443
+ | Tool | What it does |
444
+ |------|-------------|
445
+ | `list_deposits` | List deposits with pagination |
446
+ | `get_deposit` | Get deposit details by ID |
447
+ | `create_deposit` | Record a new client deposit |
448
+ | `update_deposit` | Update deposit fields |
449
+ | `delete_deposit` | Delete a deposit (confirm=true required) |
450
+ | `apply_deposit` | Apply a deposit balance against an invoice |
451
+ | `refund_deposit` | Issue a refund for a deposit |
452
+
453
+ ### Vendors (5)
454
+
455
+ | Tool | What it does |
456
+ |------|-------------|
457
+ | `list_vendors` | List all vendors/suppliers |
458
+ | `get_vendor` | Get vendor details |
459
+ | `create_vendor` | Add a new vendor |
460
+ | `update_vendor` | Update vendor info |
461
+ | `delete_vendor` | Remove a vendor |
462
+
463
+ ### Banking (5)
464
+
465
+ | Tool | What it does |
466
+ |------|-------------|
467
+ | `list_bank_accounts` | List connected bank accounts |
468
+ | `get_bank_account` | Get details for a bank account |
469
+ | `list_transactions` | List bank transactions with filters |
470
+ | `categorize_transaction` | Assign a category and expense/income type to a transaction |
471
+ | `match_transaction_to_invoice` | Link a bank transaction to an existing invoice |
472
+
473
+ ### Fiscal — Spanish Tax Models (8)
474
+
475
+ | Tool | What it does |
476
+ |------|-------------|
477
+ | `get_modelo_303_summary` | Quarterly IVA return (Modelo 303) — collected vs deductible, net payable |
478
+ | `get_modelo_130_summary` | Quarterly IRPF installment for self-employed (Modelo 130) |
479
+ | `get_modelo_390_summary` | Annual IVA summary (Modelo 390) |
480
+ | `get_modelo_180_summary` | Annual withholding summary for rentals (Modelo 180) |
481
+ | `get_modelo_347_summary` | Annual third-party transactions >€3,005 (Modelo 347) |
482
+ | `verifactu_status` | Get VeriFactu submission status for a fiscal record |
483
+ | `verifactu_resubmit` | Resubmit a rejected VeriFactu fiscal record |
484
+ | `ticketbai_status` | Poll TicketBAI submission status (also available in E-Invoicing section) |
485
+
486
+ ### Vacation Rentals / Stay (5)
487
+
488
+ | Tool | What it does |
489
+ |------|-------------|
490
+ | `list_reservations` | List rental reservations with filters |
491
+ | `get_reservation` | Get reservation details |
492
+ | `create_reservation` | Create a new reservation |
493
+ | `list_properties` | List all rental properties |
494
+ | `sync_channel` | Trigger OTA channel sync (Airbnb, Booking.com, etc.) |
495
+
496
+ ### POS — Point of Sale (4)
497
+
498
+ | Tool | What it does |
499
+ |------|-------------|
500
+ | `list_terminals` | List registered POS terminals |
501
+ | `get_sale` | Get details for a POS sale transaction |
502
+ | `list_sales` | List POS sales with pagination |
503
+ | `refund_sale` | Issue a refund for a POS sale |
504
+
505
+ ### HR — Human Resources (9)
506
+
507
+ | Tool | What it does |
508
+ |------|-------------|
509
+ | `leave_request_create` | Create a leave request (vacation, sick, personal) |
510
+ | `leave_approve` | Approve a pending leave request |
511
+ | `leave_reject` | Reject a leave request with a reason |
512
+ | `leave_cancel` | Cancel an approved or pending leave request |
513
+ | `leave_list` | List leave requests with filters (user, status, date range) |
514
+ | `attendance_clock_in` | Record clock-in for an employee |
515
+ | `attendance_clock_out` | Record clock-out for an employee |
516
+ | `overtime_report` | Generate overtime report for a period |
517
+ | `anomaly_list` | List attendance anomalies (missing punches, excessive overtime) |
518
+
519
+ ### Payroll (2)
520
+
521
+ | Tool | What it does |
522
+ |------|-------------|
523
+ | `payroll_export` | Export payroll data for a period (CSV/PDF for gestoría) |
524
+ | `payroll_checklist` | Generate pre-payroll checklist: pending leaves, anomalies, overtime |
525
+
526
+ ### Onboarding (2)
527
+
528
+ | Tool | What it does |
529
+ |------|-------------|
530
+ | `onboarding_status` | Get onboarding completion status for the current workspace |
531
+ | `onboarding_persona_set` | Set or update the business persona (freelancer, SME, gestoría, etc.) |
532
+
533
+ ### Permissions (2)
534
+
535
+ | Tool | What it does |
536
+ |------|-------------|
537
+ | `permissions_matrix` | Get the full permissions matrix for all roles in the workspace |
538
+ | `permissions_me` | Get the current API key's effective permissions |
539
+
540
+ ### Period Close (3)
541
+
542
+ | Tool | What it does |
543
+ |------|-------------|
544
+ | `period_close_status` | Get the close status for an accounting period |
545
+ | `period_close` | Close an accounting period (gestor/admin only — TRUST AREA) |
546
+ | `period_reopen` | Reopen a closed period with a mandatory reason (TRUST AREA) |
298
547
 
299
- All 94 tools return **structured output** via `outputSchema` -- typed JSON, not raw text. List tools return paginated results (`{ data, total, limit, offset }`).
548
+ All 151 tools return **structured output** via `outputSchema` -- typed JSON, not raw text. List tools return paginated results (`{ data, total, limit, offset }`).
300
549
 
301
550
  ---
302
551
 
@@ -475,7 +724,7 @@ npm run build # must pass before submitting
475
724
 
476
725
  | Package | What it is |
477
726
  |---------|-----------|
478
- | [`@frihet/mcp-server`](https://www.npmjs.com/package/@frihet/mcp-server) | This MCP server (94 tools, 8 resources, 7 prompts) |
727
+ | [`@frihet/mcp-server`](https://www.npmjs.com/package/@frihet/mcp-server) | This MCP server (151 tools, 8 resources, 7 prompts) |
479
728
  | [`@frihet/sdk`](https://github.com/Frihet-io/frihet-sdk) | TypeScript SDK (`frihet.invoices.create()`) |
480
729
  | [`frihet`](https://www.npmjs.com/package/frihet) | CLI (`frihet invoices list --status overdue`) |
481
730
  | [`n8n-nodes-frihet`](https://www.npmjs.com/package/n8n-nodes-frihet) | n8n community node for workflow automation |
@@ -491,6 +740,7 @@ npm run build # must pass before submitting
491
740
  - [MCP server docs](https://docs.frihet.io/desarrolladores/mcp-server) -- Setup guides, troubleshooting
492
741
  - [npm](https://www.npmjs.com/package/@frihet/mcp-server) -- Package registry
493
742
  - [Smithery](https://smithery.ai/server/frihet/frihet-mcp) -- Smithery marketplace
743
+ - [MCP Registry](https://registry.modelcontextprotocol.io/?q=io.frihet) -- Anthropic official registry
494
744
  - [Remote endpoint](https://mcp.frihet.io) -- Hosted MCP server (Cloudflare Workers)
495
745
  - [OpenAPI spec](https://api.frihet.io/openapi.yaml) -- Machine-readable API definition
496
746
 
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Tests for D4-B megasprint MCP tools — HR + Webhook test + Payroll + Onboarding + Permissions + Period close (20 tools).
3
+ *
4
+ * Uses Node.js built-in test runner (node:test + node:assert). Run: npm test (after build).
5
+ *
6
+ * Coverage:
7
+ * - Tool registration counts per module
8
+ * - Happy path for every tool (mock client returns fixture)
9
+ * - Error path: 404 propagated as isError=true
10
+ * - Trust-area gates: confirm=false for period_close / period_reopen returns isError
11
+ */
12
+ export {};
13
+ //# sourceMappingURL=d4b-hr-payroll-onboarding-tools.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"d4b-hr-payroll-onboarding-tools.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/d4b-hr-payroll-onboarding-tools.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG"}