@frihet/mcp-server 1.16.6 → 2.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.
Files changed (108) hide show
  1. package/README.md +168 -82
  2. package/dist/agent-onboarding.d.ts +98 -0
  3. package/dist/agent-onboarding.js +275 -0
  4. package/dist/api-origin.d.ts +9 -0
  5. package/dist/api-origin.js +41 -0
  6. package/dist/canary/mcp-harness.d.ts +77 -0
  7. package/dist/canary/mcp-harness.js +552 -0
  8. package/dist/capability-truth.d.ts +29 -0
  9. package/dist/capability-truth.js +262 -0
  10. package/dist/claude-candidate-contract.d.ts +482 -0
  11. package/dist/claude-candidate-contract.js +87 -0
  12. package/dist/claude-output-privacy.d.ts +17 -0
  13. package/dist/claude-output-privacy.js +240 -0
  14. package/dist/claude-profile.d.ts +18 -0
  15. package/dist/claude-profile.js +260 -0
  16. package/dist/client-interface.d.ts +47 -33
  17. package/dist/client.d.ts +172 -40
  18. package/dist/client.js +708 -165
  19. package/dist/demo-client.d.ts +41 -32
  20. package/dist/demo-client.js +202 -31
  21. package/dist/demo-fixtures.d.ts +3 -3
  22. package/dist/demo-fixtures.js +7 -7
  23. package/dist/deposit-contract.d.ts +29 -0
  24. package/dist/deposit-contract.js +76 -0
  25. package/dist/fetch-no-redirect.d.ts +3 -0
  26. package/dist/fetch-no-redirect.js +16 -0
  27. package/dist/fiscal-aliases.d.ts +44 -0
  28. package/dist/fiscal-aliases.js +62 -0
  29. package/dist/fiscal-period.d.ts +26 -0
  30. package/dist/fiscal-period.js +31 -0
  31. package/dist/google-profile.d.ts +19 -0
  32. package/dist/google-profile.js +122 -0
  33. package/dist/index.js +68 -59
  34. package/dist/logger.d.ts +2 -2
  35. package/dist/logger.js +140 -8
  36. package/dist/muse-profile.d.ts +19 -0
  37. package/dist/muse-profile.js +122 -0
  38. package/dist/observability.d.ts +18 -29
  39. package/dist/observability.js +194 -106
  40. package/dist/openai-profile.d.ts +26 -22
  41. package/dist/openai-profile.js +1193 -157
  42. package/dist/openai-review-contract.d.ts +15 -6
  43. package/dist/openai-review-contract.js +714 -41
  44. package/dist/openai-review-oauth.d.ts +149 -2
  45. package/dist/openai-review-oauth.js +220 -6
  46. package/dist/prompts/register-all.d.ts +2 -0
  47. package/dist/prompts/register-all.js +34 -78
  48. package/dist/public-capability-contract.d.ts +39 -0
  49. package/dist/public-capability-contract.js +186 -0
  50. package/dist/redaction.d.ts +15 -0
  51. package/dist/redaction.js +83 -0
  52. package/dist/resources/register-all.js +154 -64
  53. package/dist/retry-after.d.ts +19 -0
  54. package/dist/retry-after.js +84 -0
  55. package/dist/server-composition.d.ts +19 -0
  56. package/dist/server-composition.js +74 -0
  57. package/dist/tool-exposure.d.ts +31 -27
  58. package/dist/tool-exposure.js +211 -87
  59. package/dist/tools/accountingClose.d.ts +14 -5
  60. package/dist/tools/accountingClose.js +41 -23
  61. package/dist/tools/audit_gl.js +8 -8
  62. package/dist/tools/backend-availability.d.ts +8 -29
  63. package/dist/tools/backend-availability.js +31 -30
  64. package/dist/tools/bank_rules.js +66 -15
  65. package/dist/tools/banking.js +5 -13
  66. package/dist/tools/clients.js +261 -15
  67. package/dist/tools/crm.js +22 -21
  68. package/dist/tools/deposits.js +114 -85
  69. package/dist/tools/einvoice.d.ts +16 -2
  70. package/dist/tools/einvoice.js +59 -12
  71. package/dist/tools/expenses.d.ts +16 -0
  72. package/dist/tools/expenses.js +47 -27
  73. package/dist/tools/fiscal.d.ts +3 -4
  74. package/dist/tools/fiscal.js +93 -60
  75. package/dist/tools/gestoria.js +15 -7
  76. package/dist/tools/hr.d.ts +2 -3
  77. package/dist/tools/hr.js +49 -20
  78. package/dist/tools/igic.d.ts +9 -8
  79. package/dist/tools/igic.js +34 -64
  80. package/dist/tools/impuesto_sociedades.d.ts +4 -5
  81. package/dist/tools/impuesto_sociedades.js +16 -37
  82. package/dist/tools/intelligence.js +166 -12
  83. package/dist/tools/invoices.js +224 -54
  84. package/dist/tools/kitchen.js +19 -9
  85. package/dist/tools/payroll.d.ts +5 -8
  86. package/dist/tools/payroll.js +19 -32
  87. package/dist/tools/permissions.d.ts +4 -7
  88. package/dist/tools/permissions.js +11 -14
  89. package/dist/tools/products.js +6 -6
  90. package/dist/tools/quotes.js +172 -26
  91. package/dist/tools/recurring.js +26 -25
  92. package/dist/tools/register-all.d.ts +2 -2
  93. package/dist/tools/register-all.js +9 -6
  94. package/dist/tools/search.d.ts +19 -0
  95. package/dist/tools/search.js +84 -0
  96. package/dist/tools/shared.d.ts +1445 -109
  97. package/dist/tools/shared.js +478 -102
  98. package/dist/tools/team.js +24 -28
  99. package/dist/tools/time.js +4 -12
  100. package/dist/tools/vendors.js +249 -15
  101. package/dist/tools/webhooks.js +35 -30
  102. package/dist/types.d.ts +31 -5
  103. package/dist/workflows/daily-operational-brief.d.ts +163 -0
  104. package/dist/workflows/daily-operational-brief.js +881 -0
  105. package/docs/agent-onboarding.json +391 -0
  106. package/package.json +49 -12
  107. package/dist/tools/onboarding.d.ts +0 -19
  108. package/dist/tools/onboarding.js +0 -64
@@ -0,0 +1,391 @@
1
+ {
2
+ "onboardingContractVersion": 1,
3
+ "server": {
4
+ "mcpName": "io.frihet/erp",
5
+ "npmPackage": "@frihet/mcp-server",
6
+ "remoteEndpoint": "https://mcp.frihet.io/mcp",
7
+ "transport": [
8
+ "stdio",
9
+ "streamable-http"
10
+ ]
11
+ },
12
+ "auth": {
13
+ "envVar": "FRIHET_API_KEY",
14
+ "keyFormat": "fri_<key>",
15
+ "obtainAt": "https://app.frihet.io/settings/api",
16
+ "remoteMethods": [
17
+ "oauth2.1-pkce",
18
+ "bearer"
19
+ ],
20
+ "noAuthTrial": {
21
+ "env": {
22
+ "FRIHET_DEMO": "1"
23
+ },
24
+ "persists": false,
25
+ "network": false
26
+ }
27
+ },
28
+ "quickstart": {
29
+ "claude-code": {
30
+ "steps": [
31
+ "claude mcp add frihet -s user -e FRIHET_API_KEY=fri_... -- npx -y @frihet/mcp-server"
32
+ ],
33
+ "configFormat": "managed by the CLI (user scope writes ~/.claude.json)",
34
+ "verify": "claude mcp list"
35
+ },
36
+ "codex": {
37
+ "steps": [
38
+ "codex mcp add frihet --env FRIHET_API_KEY=fri_... -- npx -y @frihet/mcp-server"
39
+ ],
40
+ "configFormat": "toml (~/.codex/config.toml — JSON in this file is a parse error)",
41
+ "verify": "codex mcp list"
42
+ },
43
+ "generic-mcp-client-stdio": {
44
+ "steps": [
45
+ "mcpServers.frihet = { \"command\": \"npx\", \"args\": [\"-y\", \"@frihet/mcp-server\"], \"env\": { \"FRIHET_API_KEY\": \"fri_...\" } }"
46
+ ],
47
+ "configFormat": "json",
48
+ "verify": "initialize → tools/list returns a non-empty catalogue"
49
+ },
50
+ "generic-mcp-client-http": {
51
+ "steps": [
52
+ "mcpServers.frihet = { \"type\": \"streamable-http\", \"url\": \"https://mcp.frihet.io/mcp\", \"headers\": { \"Authorization\": \"Bearer fri_...\" } }"
53
+ ],
54
+ "configFormat": "json",
55
+ "verify": "initialize → tools/list returns a non-empty catalogue"
56
+ }
57
+ },
58
+ "capabilityDiscovery": {
59
+ "metaKey": "io.frihet/capability",
60
+ "callabilityValues": [
61
+ "api_dependent",
62
+ "runtime_checked",
63
+ "deferred",
64
+ "unavailable",
65
+ "local"
66
+ ],
67
+ "groupedModeEnv": {
68
+ "FRIHET_TOOL_MODE": "grouped"
69
+ },
70
+ "counts": {
71
+ "toolNames": 161,
72
+ "readOnly": 81,
73
+ "writesFrihet": 80,
74
+ "externalInteraction": 37,
75
+ "destructive": 60,
76
+ "resources": 11,
77
+ "prompts": 10
78
+ }
79
+ },
80
+ "safeWorkflow": {
81
+ "description": "Discover → orient → retrieve → propose → hand back. No step mutates data or reaches a third party.",
82
+ "steps": [
83
+ {
84
+ "call": "get_business_context",
85
+ "kind": "read",
86
+ "note": "Fiscal zone, currency and defaults. Everything downstream depends on it."
87
+ },
88
+ {
89
+ "call": "resources/read frihet://tax/rates",
90
+ "kind": "read",
91
+ "note": "Spanish statutory IVA / IGIC / IPSI reference schedule. Do not recall a rate from memory; server validates transaction math."
92
+ },
93
+ {
94
+ "call": "list_clients",
95
+ "kind": "read",
96
+ "note": "Resolve the client by name before referencing an id."
97
+ },
98
+ {
99
+ "call": "STOP",
100
+ "kind": "handoff",
101
+ "note": "Present the proposed draft inputs and all disclosed effects. Creating, issuing, sending, or submitting is a separate human decision."
102
+ }
103
+ ]
104
+ },
105
+ "humanAuthority": {
106
+ "rule": "Do not call a tool with non-empty externalSideEffects, and do not set confirm=true, without an explicit human instruction for that specific action.",
107
+ "confirmRequired": [
108
+ "delete_invoice",
109
+ "delete_quote",
110
+ "delete_recurring_invoice",
111
+ "delete_time_entry",
112
+ "face_submit",
113
+ "match_transaction_to_invoice",
114
+ "period_close",
115
+ "period_reopen",
116
+ "refund_deposit",
117
+ "refund_sale",
118
+ "remove_team_member",
119
+ "run_recurring_now",
120
+ "send_invoice",
121
+ "send_quote",
122
+ "ticketbai_submit",
123
+ "verifactu_resubmit"
124
+ ],
125
+ "externalSideEffects": [
126
+ {
127
+ "tool": "create_client",
128
+ "effects": [
129
+ "webhook_delivery_or_configuration"
130
+ ]
131
+ },
132
+ {
133
+ "tool": "create_credit_note",
134
+ "effects": [
135
+ "webhook_delivery_or_configuration"
136
+ ]
137
+ },
138
+ {
139
+ "tool": "create_expense",
140
+ "effects": [
141
+ "webhook_delivery_or_configuration"
142
+ ]
143
+ },
144
+ {
145
+ "tool": "create_invoice",
146
+ "effects": [
147
+ "webhook_delivery_or_configuration",
148
+ "fiscal_or_einvoice_submission"
149
+ ]
150
+ },
151
+ {
152
+ "tool": "create_product",
153
+ "effects": [
154
+ "webhook_delivery_or_configuration"
155
+ ]
156
+ },
157
+ {
158
+ "tool": "create_quote",
159
+ "effects": [
160
+ "webhook_delivery_or_configuration"
161
+ ]
162
+ },
163
+ {
164
+ "tool": "create_webhook",
165
+ "effects": [
166
+ "webhook_delivery_or_configuration"
167
+ ]
168
+ },
169
+ {
170
+ "tool": "delete_invoice",
171
+ "effects": [
172
+ "webhook_delivery_or_configuration",
173
+ "fiscal_or_einvoice_submission"
174
+ ]
175
+ },
176
+ {
177
+ "tool": "delete_quote",
178
+ "effects": [
179
+ "webhook_delivery_or_configuration"
180
+ ]
181
+ },
182
+ {
183
+ "tool": "delete_webhook",
184
+ "effects": [
185
+ "webhook_delivery_or_configuration"
186
+ ]
187
+ },
188
+ {
189
+ "tool": "duplicate_invoice",
190
+ "effects": [
191
+ "webhook_delivery_or_configuration"
192
+ ]
193
+ },
194
+ {
195
+ "tool": "face_status",
196
+ "effects": [
197
+ "external_provider_read"
198
+ ]
199
+ },
200
+ {
201
+ "tool": "face_submit",
202
+ "effects": [
203
+ "fiscal_or_einvoice_submission"
204
+ ]
205
+ },
206
+ {
207
+ "tool": "frihet_portal_domain_add",
208
+ "effects": [
209
+ "external_provider_configuration"
210
+ ]
211
+ },
212
+ {
213
+ "tool": "frihet_portal_domain_remove",
214
+ "effects": [
215
+ "external_provider_configuration"
216
+ ]
217
+ },
218
+ {
219
+ "tool": "frihet_portal_domain_verify",
220
+ "effects": [
221
+ "external_provider_read",
222
+ "external_provider_configuration"
223
+ ]
224
+ },
225
+ {
226
+ "tool": "frihet_tax_id_vies_lookup",
227
+ "effects": [
228
+ "external_provider_read"
229
+ ]
230
+ },
231
+ {
232
+ "tool": "gestoria_message_send",
233
+ "effects": [
234
+ "email_or_invitation"
235
+ ]
236
+ },
237
+ {
238
+ "tool": "gestoria_template_bulk_send",
239
+ "effects": [
240
+ "email_or_invitation"
241
+ ]
242
+ },
243
+ {
244
+ "tool": "invite_team_member",
245
+ "effects": [
246
+ "email_or_invitation"
247
+ ]
248
+ },
249
+ {
250
+ "tool": "log_client_activity",
251
+ "effects": [
252
+ "webhook_delivery_or_configuration"
253
+ ]
254
+ },
255
+ {
256
+ "tool": "mark_invoice_paid",
257
+ "effects": [
258
+ "webhook_delivery_or_configuration",
259
+ "fiscal_or_einvoice_submission"
260
+ ]
261
+ },
262
+ {
263
+ "tool": "refund_sale",
264
+ "effects": [
265
+ "money_movement"
266
+ ]
267
+ },
268
+ {
269
+ "tool": "run_recurring_now",
270
+ "effects": [
271
+ "webhook_delivery_or_configuration",
272
+ "fiscal_or_einvoice_submission"
273
+ ]
274
+ },
275
+ {
276
+ "tool": "send_einvoice",
277
+ "effects": [
278
+ "fiscal_or_einvoice_submission"
279
+ ]
280
+ },
281
+ {
282
+ "tool": "send_invoice",
283
+ "effects": [
284
+ "email_or_invitation",
285
+ "webhook_delivery_or_configuration",
286
+ "fiscal_or_einvoice_submission"
287
+ ]
288
+ },
289
+ {
290
+ "tool": "send_quote",
291
+ "effects": [
292
+ "email_or_invitation",
293
+ "webhook_delivery_or_configuration"
294
+ ]
295
+ },
296
+ {
297
+ "tool": "sync_channel",
298
+ "effects": [
299
+ "channel_sync"
300
+ ]
301
+ },
302
+ {
303
+ "tool": "test_webhook",
304
+ "effects": [
305
+ "webhook_delivery_or_configuration"
306
+ ]
307
+ },
308
+ {
309
+ "tool": "ticketbai_submit",
310
+ "effects": [
311
+ "fiscal_or_einvoice_submission"
312
+ ]
313
+ },
314
+ {
315
+ "tool": "update_client",
316
+ "effects": [
317
+ "webhook_delivery_or_configuration"
318
+ ]
319
+ },
320
+ {
321
+ "tool": "update_expense",
322
+ "effects": [
323
+ "webhook_delivery_or_configuration"
324
+ ]
325
+ },
326
+ {
327
+ "tool": "update_invoice",
328
+ "effects": [
329
+ "webhook_delivery_or_configuration",
330
+ "fiscal_or_einvoice_submission"
331
+ ]
332
+ },
333
+ {
334
+ "tool": "update_product",
335
+ "effects": [
336
+ "webhook_delivery_or_configuration"
337
+ ]
338
+ },
339
+ {
340
+ "tool": "update_quote",
341
+ "effects": [
342
+ "webhook_delivery_or_configuration"
343
+ ]
344
+ },
345
+ {
346
+ "tool": "update_webhook",
347
+ "effects": [
348
+ "webhook_delivery_or_configuration"
349
+ ]
350
+ },
351
+ {
352
+ "tool": "verifactu_resubmit",
353
+ "effects": [
354
+ "fiscal_or_einvoice_submission"
355
+ ]
356
+ }
357
+ ]
358
+ },
359
+ "errors": [
360
+ {
361
+ "condition": "startup exits 1 with code FRIHET_API_KEY_MISSING",
362
+ "meaning": "No credential in the environment.",
363
+ "agentAction": "Ask the human for a key from https://app.frihet.io/settings/api, or re-launch with FRIHET_DEMO=1 to explore without one."
364
+ },
365
+ {
366
+ "condition": "HTTP 401",
367
+ "meaning": "Key missing, malformed or revoked.",
368
+ "agentAction": "Stop and ask for a new key. Do not retry."
369
+ },
370
+ {
371
+ "condition": "HTTP 403",
372
+ "meaning": "The key is valid but lacks the scope, or the plan excludes it.",
373
+ "agentAction": "Report which operation was refused. Do not try a different tool to route around it."
374
+ },
375
+ {
376
+ "condition": "HTTP 429",
377
+ "meaning": "Rate limited.",
378
+ "agentAction": "Wait the Retry-After seconds, then retry once."
379
+ },
380
+ {
381
+ "condition": "HTTP 409 IDEMPOTENCY_REQUEST_IN_PROGRESS",
382
+ "meaning": "The first attempt's outcome could not be recorded; the server refuses to execute twice.",
383
+ "agentAction": "Read the resource back and reconcile from its actual state. Never retry with a fresh Idempotency-Key."
384
+ },
385
+ {
386
+ "condition": "capability.callability is deferred or unavailable",
387
+ "meaning": "The tool is registered but the backing API is not serving it.",
388
+ "agentAction": "Do not call it. Tell the human the capability is not live for this workspace."
389
+ }
390
+ ]
391
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@frihet/mcp-server",
3
- "version": "1.16.6",
4
- "description": "AI-native MCP server for Frihet ERP — 157 tools: invoicing, expenses, CRM, banking, POS + ES/EU fiscal compliance (VeriFactu, TicketBAI, Facturae). Zero-install at mcp.frihet.io. Works with Claude, ChatGPT, Cursor, Windsurf, Cline & any MCP client.",
3
+ "version": "2.0.0",
4
+ "description": "AI-native MCP server for Frihet ERP — 156 canonical operations for invoicing, expenses, CRM, banking, POS and ES/EU fiscal workflows, with conservative capability and side-effect metadata.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "bin": {
@@ -9,19 +9,47 @@
9
9
  },
10
10
  "scripts": {
11
11
  "build": "tsc",
12
- "test": "npm run build && node --test dist/__tests__/openai-profile.test.js dist/__tests__/tool-exposure.test.js dist/__tests__/einvoice-tools.test.js dist/__tests__/einvoice-day4-tools.test.js dist/__tests__/stay-tools.test.js dist/__tests__/pos-tools.test.js dist/__tests__/kitchen-tools.test.js dist/__tests__/banking-tools.test.js dist/__tests__/banking-client-contract.test.js dist/__tests__/pagination-cursor-param.test.js dist/__tests__/fiscal-tools.test.js dist/__tests__/time-tools.test.js dist/__tests__/recurring-tools.test.js dist/__tests__/team-tools.test.js dist/__tests__/d4b-hr-payroll-onboarding-tools.test.js dist/__tests__/audit-server-version.test.js dist/__tests__/openai-grouped-compose.test.js dist/__tests__/openai-review-descriptor.test.js dist/__tests__/contract.test.js dist/__tests__/observability-redaction.test.js dist/__tests__/intelligence-duplicate-invoice.test.js dist/__tests__/get-envelope-unwrap-regression.test.js dist/__tests__/mutation-unwrap-and-schema-regression.test.js dist/__tests__/schema-envelope-guard.test.js dist/__tests__/demo-mode.test.js dist/__tests__/idempotency-key-contract.test.js dist/__tests__/source-header-contract.test.js",
12
+ "test": "npm run build && node --test dist/__tests__/resources-eu-catalog.test.js && node --test dist/__tests__/resources-p1-contract.test.js dist/__tests__/openai-profile.test.js dist/__tests__/openai-client-tax-id-contract.test.js dist/__tests__/tool-exposure.test.js dist/__tests__/fiscal-aliases.test.js dist/__tests__/einvoice-tools.test.js dist/__tests__/einvoice-day4-tools.test.js dist/__tests__/expenses-tools.test.js dist/__tests__/stay-tools.test.js dist/__tests__/pos-tools.test.js dist/__tests__/kitchen-tools.test.js dist/__tests__/banking-tools.test.js dist/__tests__/banking-client-contract.test.js dist/__tests__/pagination-cursor-param.test.js dist/__tests__/fiscal-tools.test.js dist/__tests__/fiscal-period-contract.test.js dist/__tests__/time-tools.test.js dist/__tests__/deposits-tools.test.js dist/__tests__/recurring-tools.test.js dist/__tests__/team-tools.test.js dist/__tests__/team-tools-real-sdk.test.js dist/__tests__/d4b-hr-payroll-onboarding-tools.test.js dist/__tests__/hr-payroll-period-contract.test.js dist/__tests__/webhook-crm-reviewed-contract.test.js dist/__tests__/audit-server-version.test.js dist/__tests__/search-tools.test.js dist/__tests__/openai-full-compose.test.js dist/__tests__/openai-review-descriptor.test.js dist/__tests__/directory-profile-policy.test.js dist/__tests__/claude-profile.test.js dist/__tests__/claude-output-privacy.test.js dist/__tests__/claude-write-route-contract.test.js dist/__tests__/contract.test.js dist/__tests__/observability-redaction.test.js dist/__tests__/security-containment-gate0.test.js dist/__tests__/intelligence-duplicate-invoice.test.js dist/__tests__/get-envelope-unwrap-regression.test.js dist/__tests__/binary-content-types.test.js dist/__tests__/api-error-remediation.test.js dist/__tests__/mutation-unwrap-and-schema-regression.test.js dist/__tests__/schema-envelope-guard.test.js dist/__tests__/paginated-strict-output.test.js dist/__tests__/paginated-metadata-contract.test.js dist/__tests__/demo-mode.test.js dist/__tests__/idempotency-key-contract.test.js dist/__tests__/retry-after-contract.test.js dist/__tests__/source-header-contract.test.js dist/__tests__/no-provisioning-credential-to-public-api.test.js dist/__tests__/truth-in-descriptions.test.js dist/__tests__/mcp-baseline-mutation.test.js dist/__tests__/forms-elicitation.test.js dist/__tests__/agent-onboarding.test.js scripts/__tests__/openai-worker-review-wire.test.mjs scripts/__tests__/sync-openapi-retry.test.mjs scripts/__tests__/conformance-provenance.test.mjs scripts/__tests__/conformance-phase0.test.mjs scripts/__tests__/published-artifact-drift.test.mjs scripts/__tests__/cross-surface-authority.test.mjs scripts/__tests__/release-workflow-contract.test.mjs scripts/__tests__/openai-wrangler-resolution.test.mjs scripts/__tests__/audit-mcp-refs-detector.test.mjs scripts/__tests__/openai-public-surface.test.mjs scripts/__tests__/claude-plugin-package.test.mjs scripts/__tests__/claude-hosted-release.test.mjs scripts/__tests__/claude-hosted-acceptance.test.mjs scripts/__tests__/claude-oauth-provider.test.mjs scripts/__tests__/audit-mcp-refs-published-sot.test.mjs scripts/__tests__/claude-bootstrap-secrets.test.mjs scripts/__tests__/no-public-leak.test.mjs",
13
+ "canary:mcp": "npm run build && node scripts/canary-mcp.mjs",
14
+ "canary:mcp:check": "npm run build && node scripts/canary-mcp.mjs --check",
15
+ "canary:mcp:snapshot": "npm run build && node scripts/canary-mcp.mjs --snapshot",
16
+ "conformance:phase0": "npm run build && node scripts/conformance/run-phase0.mjs",
17
+ "conformance:phase0:check": "npm run build && node scripts/conformance/run-phase0.mjs --check",
18
+ "gate:analytics": "node --test scripts/__tests__/analytics-tripwire.test.mjs && node scripts/check-no-analytics-emitters.mjs",
19
+ "gate:conformance-baseline": "node scripts/conformance/validate-baseline.mjs docs/conformance/phase0/baseline.json",
20
+ "canary:inspector": "npm run canary:mcp",
21
+ "canary:inspector:check": "npm run canary:mcp:check",
22
+ "canary:inspector:snapshot": "npm run canary:mcp:snapshot",
13
23
  "test:openai-review-descriptor": "npm run build && node --test dist/__tests__/openai-review-descriptor.test.js",
24
+ "test:public-capability-truth": "npm run build && node --test dist/__tests__/public-capability-truth.test.js",
14
25
  "gate:openai-review-descriptor": "npm run build && node scripts/check-openai-review-descriptor.mjs",
26
+ "generate:openai-submission": "npm run build && node scripts/generate-openai-submission.mjs --write",
27
+ "gate:openai-submission": "npm run build && node scripts/generate-openai-submission.mjs --check && node scripts/validate-openai-submission-schema.mjs && node --test scripts/__tests__/openai-plugin-package.test.mjs",
28
+ "package:openai-plugin": "npm run gate:openai-submission && python3 scripts/package-openai-plugin.py",
29
+ "check:openai-public-surface": "node scripts/check-openai-public-surface.mjs",
30
+ "test:openai-public-surface": "node --test scripts/__tests__/openai-public-surface.test.mjs",
31
+ "generate:public-capability-truth": "npm run build && node scripts/generate-public-capability-contract.mjs",
32
+ "generate:agent-onboarding": "npm run build && node scripts/generate-agent-onboarding.mjs",
33
+ "gate:agent-onboarding": "npm run build && node scripts/generate-agent-onboarding.mjs --check",
34
+ "gate:published-drift": "node scripts/published-artifact-drift.mjs",
35
+ "gate:public-capability-truth": "npm run build && node --test dist/__tests__/public-capability-truth.test.js && node scripts/generate-public-capability-contract.mjs --check",
15
36
  "start": "node dist/index.js",
16
37
  "postinstall": "node scripts/postinstall.js || true",
17
- "prepublishOnly": "npm run build && npm run audit:mcp-refs -- --repo frihet-mcp && npm run gate:no-legacy-region",
38
+ "prepublishOnly": "node scripts/assert-publish-anchor.mjs && npm run gate:analytics && npm run build && npm run gate:agent-onboarding && npm run gate:public-capability-truth && npm run audit:mcp-refs -- --repo frihet-mcp && npm run gate:no-legacy-region && node scripts/check-no-analytics-emitters.mjs --built && npm run gate:cross-surface-authority",
18
39
  "audit:mcp-refs": "node scripts/audit-mcp-refs.mjs",
19
40
  "audit:mcp-refs:fix": "node scripts/audit-mcp-refs.mjs --fix",
20
- "gate:no-leak": "bash scripts/no-public-leak.sh",
41
+ "gate:no-leak": "node --test scripts/__tests__/no-public-leak.test.mjs && bash scripts/no-public-leak.sh",
21
42
  "gate:no-legacy-region": "bash scripts/no-legacy-region.sh",
22
43
  "sync:openapi": "node scripts/sync-openapi.mjs",
23
44
  "gate:openapi-fresh": "node scripts/sync-openapi.mjs --check",
24
- "gate:openapi-fresh:live": "node scripts/sync-openapi.mjs --check --live"
45
+ "gate:openapi-fresh:live": "node scripts/sync-openapi.mjs --check --live",
46
+ "gate:cross-surface-authority": "node scripts/cross-surface-authority.mjs",
47
+ "cross-surface-authority:diff": "node scripts/cross-surface-authority.mjs --diff",
48
+ "cross-surface-authority:update": "node scripts/cross-surface-authority.mjs --update",
49
+ "test:cross-surface-authority": "node --test scripts/__tests__/cross-surface-authority.test.mjs",
50
+ "generate:claude-candidate": "npm run build && node scripts/generate-claude-candidate-contract.mjs",
51
+ "gate:claude-candidate": "npm run build && node --test dist/__tests__/claude-profile.test.js && node scripts/generate-claude-candidate-contract.mjs --check",
52
+ "gate:claude-hosted-source": "node scripts/check-claude-hosted-release.mjs --source-only"
25
53
  },
26
54
  "keywords": [
27
55
  "accounting",
@@ -51,7 +79,7 @@
51
79
  "tax-compliance",
52
80
  "gemini-cli",
53
81
  "freelancer",
54
- "small-business",
82
+ "business-management",
55
83
  "business-automation",
56
84
  "verifactu",
57
85
  "webhooks",
@@ -62,7 +90,7 @@
62
90
  "spanish-tax",
63
91
  "e-invoicing"
64
92
  ],
65
- "author": "BRTHLS <viktor@brthls.com>",
93
+ "author": "Frihet <hello@frihet.io>",
66
94
  "license": "MIT",
67
95
  "repository": {
68
96
  "type": "git",
@@ -78,7 +106,7 @@
78
106
  "url": "https://github.com/Frihet-io/frihet-mcp/issues"
79
107
  },
80
108
  "engines": {
81
- "node": ">=18"
109
+ "node": "^22.23.4 || ^24.22.1 || ^26.12.1"
82
110
  },
83
111
  "files": [
84
112
  "dist",
@@ -88,14 +116,22 @@
88
116
  "assets/banner.svg",
89
117
  "assets/banner-light.svg",
90
118
  "assets/logo-400.png",
119
+ "docs/agent-onboarding.json",
91
120
  "README.md",
92
121
  "LICENSE"
93
122
  ],
94
123
  "dependencies": {
95
- "@modelcontextprotocol/sdk": "^1.27.0"
124
+ "@modelcontextprotocol/sdk": "1.31.0"
125
+ },
126
+ "overrides": {
127
+ "hono": ">=4.13.13",
128
+ "ip-address": ">=10.7.3",
129
+ "proxy-addr": ">=2.0.8",
130
+ "qs": ">=6.15.4",
131
+ "@ai-sdk/provider-utils": ">=4.0.33 <5"
96
132
  },
97
133
  "peerDependencies": {
98
- "zod": ">=3.25.0"
134
+ "zod": ">=3.25.1"
99
135
  },
100
136
  "peerDependenciesMeta": {
101
137
  "zod": {
@@ -105,6 +141,7 @@
105
141
  "devDependencies": {
106
142
  "@types/node": "^22.0.0",
107
143
  "typescript": "^5.7.0",
108
- "zod": "^3.25.0"
144
+ "ajv": "8.18.0",
145
+ "zod": "^3.25.1"
109
146
  }
110
147
  }
@@ -1,19 +0,0 @@
1
- /**
2
- * Onboarding tools for the Frihet MCP server — D4-B megasprint (2 tools).
3
- *
4
- * Tools:
5
- * 1. onboarding_status — current workspace onboarding state (completed/pending steps)
6
- * 2. onboarding_persona_set — set workspace persona (autonomo/empresa/agencia/gestoria)
7
- *
8
- * REST surface: /v1/onboarding/status, /v1/onboarding/persona
9
- *
10
- * Persona drives module visibility + default chart-of-accounts + onboarding checklist.
11
- * Persona can only be set once during onboarding; later changes require workspace admin.
12
- *
13
- * NOTE: ERP backend endpoints land in parallel D4-A wave. 404s propagate as isError
14
- * until backend ships.
15
- */
16
- import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
17
- import type { IFrihetClient } from "../client-interface.js";
18
- export declare function registerOnboardingTools(server: McpServer, client: IFrihetClient): void;
19
- //# sourceMappingURL=onboarding.d.ts.map
@@ -1,64 +0,0 @@
1
- /**
2
- * Onboarding tools for the Frihet MCP server — D4-B megasprint (2 tools).
3
- *
4
- * Tools:
5
- * 1. onboarding_status — current workspace onboarding state (completed/pending steps)
6
- * 2. onboarding_persona_set — set workspace persona (autonomo/empresa/agencia/gestoria)
7
- *
8
- * REST surface: /v1/onboarding/status, /v1/onboarding/persona
9
- *
10
- * Persona drives module visibility + default chart-of-accounts + onboarding checklist.
11
- * Persona can only be set once during onboarding; later changes require workspace admin.
12
- *
13
- * NOTE: ERP backend endpoints land in parallel D4-A wave. 404s propagate as isError
14
- * until backend ships.
15
- */
16
- import { z } from "zod/v4";
17
- import { withToolLogging, formatRecord, getContent, mutateContent, READ_ONLY_ANNOTATIONS, UPDATE_ANNOTATIONS, onboardingStatusOutput, onboardingPersonaResultOutput, } from "./shared.js";
18
- import { withBackendGuard } from "./backend-availability.js";
19
- export function registerOnboardingTools(server, client) {
20
- // -- onboarding_status --
21
- server.registerTool("onboarding_status", {
22
- title: "Onboarding Status",
23
- description: "Return the current workspace onboarding state — persona, completed steps, pending steps, " +
24
- "percent complete. Useful to drive in-app guidance, sales follow-up triggers, " +
25
- "and partner program tracking. " +
26
- "/ Devuelve el estado actual del onboarding del workspace (persona, pasos completados/pendientes).",
27
- annotations: READ_ONLY_ANNOTATIONS,
28
- inputSchema: {},
29
- outputSchema: onboardingStatusOutput,
30
- }, async () => withToolLogging("onboarding_status", () => withBackendGuard("onboarding_status", "/v1/onboarding/status", async () => {
31
- const result = await client.getOnboardingStatus();
32
- return {
33
- content: [getContent(formatRecord("Onboarding status", result))],
34
- structuredContent: result,
35
- };
36
- })));
37
- // -- onboarding_persona_set --
38
- server.registerTool("onboarding_persona_set", {
39
- title: "Set Onboarding Persona",
40
- description: "Set the workspace persona. Drives module visibility, default chart-of-accounts, " +
41
- "and onboarding checklist. Personas:\n" +
42
- " - 'autonomo' — self-employed (autonomo Spain)\n" +
43
- " - 'empresa' — small/medium business\n" +
44
- " - 'agencia' — agency / consultancy\n" +
45
- " - 'gestoria' — accounting firm (manages multiple client workspaces)\n" +
46
- "\n" +
47
- "Idempotent: setting the same persona again is a no-op. " +
48
- "/ Define la persona del workspace. Determina modulos visibles, plan contable y checklist.",
49
- annotations: UPDATE_ANNOTATIONS,
50
- inputSchema: {
51
- persona: z
52
- .enum(["autonomo", "empresa", "agencia", "gestoria"])
53
- .describe("Workspace persona / Persona del workspace"),
54
- },
55
- outputSchema: onboardingPersonaResultOutput,
56
- }, async ({ persona }) => withToolLogging("onboarding_persona_set", () => withBackendGuard("onboarding_persona_set", "/v1/onboarding/persona", async () => {
57
- const result = await client.setOnboardingPersona({ persona });
58
- return {
59
- content: [mutateContent(formatRecord("Persona set", result))],
60
- structuredContent: result,
61
- };
62
- })));
63
- }
64
- //# sourceMappingURL=onboarding.js.map