@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
package/README.md CHANGED
@@ -20,9 +20,10 @@
20
20
  <a href="https://www.npmjs.com/package/@frihet/mcp-server"><img src="https://img.shields.io/npm/dm/@frihet/mcp-server?style=flat&color=18181b&labelColor=09090b&label=downloads" alt="npm downloads"></a>
21
21
  <a href="https://smithery.ai/servers/frihet/frihet-mcp"><img src="https://smithery.ai/badge/frihet/frihet-mcp" alt="Smithery installs"></a>
22
22
  <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>
23
+ <a href="https://github.com/mcp/io.frihet/erp"><img src="https://img.shields.io/badge/GitHub_MCP_Registry-Listed-18181b?style=flat&labelColor=09090b&logo=github" alt="Listed in GitHub MCP Registry"></a>
23
24
  <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>
24
- <img src="https://img.shields.io/badge/tools-157-18181b?style=flat&labelColor=09090b" alt="157 tools">
25
- <img src="https://img.shields.io/badge/node-%3E%3D18-18181b?style=flat&labelColor=09090b" alt="node >=18">
25
+ <img src="https://img.shields.io/badge/catalogue-156_operations-18181b?style=flat&labelColor=09090b" alt="156 canonical catalogue operations">
26
+ <img src="https://img.shields.io/badge/node-22.23.4%2B%20%7C%2024.22.1%2B%20%7C%2026.12.1%2B-18181b?style=flat&labelColor=09090b" alt="Node 22.23.4+ (22.x), 24.22.1+ (24.x), or 26.12.1+ (26.x)">
26
27
  <a href="https://www.typescriptlang.org/"><img src="https://img.shields.io/badge/TypeScript-18181b?style=flat&labelColor=09090b" alt="TypeScript"></a>
27
28
  </p>
28
29
 
@@ -34,20 +35,41 @@
34
35
 
35
36
  ## Distribution
36
37
 
37
- | Channel | Status | Install |
38
- |---------|--------|---------|
39
- | **npm** | Live | `npx @frihet/mcp-server` |
40
- | **Remote endpoint** | Live | `https://mcp.frihet.io/mcp` (zero install, OAuth or API key) |
41
- | **Smithery** | Live | [smithery.ai/servers/frihet/frihet-mcp](https://smithery.ai/servers/frihet/frihet-mcp) |
42
- | **MCP Registry** | Live | [registry.modelcontextprotocol.io](https://registry.modelcontextprotocol.io/?q=io.frihet) |
43
- | **Glama** | Live | [glama.ai/mcp/servers/Frihet-io/frihet-mcp](https://glama.ai/mcp/servers/Frihet-io/frihet-mcp) |
44
- | **mcp.so** | Auto-index (unverified) | [mcp.so](https://mcp.so) — indexes from npm + GitHub |
45
- | **PulseMCP** | Auto-index (unverified) | [pulsemcp.com](https://pulsemcp.com) — indexes from npm + GitHub |
46
- | **Cursor Marketplace** | Coming soon | [cursor.com/marketplace](https://cursor.com/marketplace) |
47
- | **ChatGPT Apps** | Coming soon | [chatgpt.com](https://chatgpt.com) |
48
- | **Anthropic Claude Directory** | Coming soon | [claude.ai/settings/connectors](https://claude.ai/settings/connectors) |
49
-
50
- > **Tool count:** the package (1.16.6) ships all 157 tools, same as the remote endpoint (`mcp.frihet.io`).
38
+ Reviewed 2026-10-31. A directory entry is not proof of a working installation, vendor endorsement, or adoption. Package releases, hosted deployments and reviewed app versions are independent.
39
+
40
+ ### Use Frihet
41
+
42
+ | Channel | Availability | Entry point |
43
+ |---|---|---|
44
+ | npm | Published package; see its own release version | [npm](https://www.npmjs.com/package/@frihet/mcp-server) · `npx @frihet/mcp-server` |
45
+ | Remote MCP | Hosted connection route; OAuth or API key | `https://mcp.frihet.io/mcp` |
46
+ | ChatGPT app | Published 1.0.2, confirmed by the maintainer; not the separate 1.0.3 candidate | [Frihet in ChatGPT](https://chatgpt.com/plugins/plugin_asdk_app_6ac6b51bd7648191a0696bd1e725bfe6) |
47
+
48
+ ### Find Frihet
49
+
50
+ These are discovery links, not a count of independent integrations. Some third-party descriptions and cached copies are outdated.
51
+
52
+ | Surface | Evidence at review | Entry |
53
+ |---|---|---|
54
+ | Official MCP Registry | Specific registry entry indexed | [io.frihet/erp](https://registry.modelcontextprotocol.io/?q=io.frihet) |
55
+ | GitHub MCP Registry | Listing content retrieved; not a GitHub-verified connector claim | [Frihet ERP](https://github.com/mcp/io.frihet/erp) |
56
+ | ToolSDK MCP Registry | Entry read in upstream repository | [Registry entry](https://github.com/toolsdk-ai/toolsdk-mcp-registry/blob/main/packages/finance-fintech/frihet-mcp.json) |
57
+ | Glama | Specific listing indexed; summary needs refresh | [Listing](https://glama.ai/mcp/servers/Frihet-io/frihet-mcp) |
58
+ | Smithery | Specific listing indexed; live recheck blocked | [Listing](https://smithery.ai/servers/%40frihet/frihet-mcp) |
59
+ | mcpservers.org | Listing content retrieved; description outdated | [Listing](https://mcpservers.org/servers/frihet-io/frihet-mcp) |
60
+ | Cursor Directory | Community listing retrieved; separate from the official Cursor Marketplace | [Listing](https://cursor.directory/plugins/mcp-frihet) |
61
+ | mcp.so | Specific listing indexed; current installation not verified | [Listing](https://mcp.so/servers/frihet-mcp) |
62
+
63
+ Frihet also appears in **[punkpeye/awesome-mcp-servers](https://github.com/punkpeye/awesome-mcp-servers)**, **[TensorBlock/awesome-mcp-servers](https://github.com/TensorBlock/awesome-mcp-servers/blob/main/docs/finance--crypto.md)** and **[ever-works/awesome-mcp-servers](https://github.com/ever-works/awesome-mcp-servers/blob/master/details/frihetmcp-server.md)**. Their retrieved descriptions still use an old tool count; the ever-works entry also links to a non-canonical repository URL. Use this repository's install instructions rather than copying those descriptions.
64
+
65
+ ### Pending or not reverified
66
+
67
+ - **Docker:** [submission PR #1711](https://github.com/docker/mcp-registry/pull/1711) remains open; do not describe it as published in Docker's catalog.
68
+ - **Cline:** [submission #2053](https://github.com/cline/mcp-marketplace/issues/2053) remains open; client compatibility is not marketplace approval.
69
+ - **PulseMCP:** historically reported; a current primary listing was not retrieved in this review.
70
+ - **Official Cursor Marketplace and Claude Directory:** public approval was not reverified here. This does not change existing submissions or manual MCP installation support.
71
+
72
+ > **Surface truth:** the catalogue contains 156 canonical operations. The local full profile serves 161 tool names, 11 resources, and 10 prompts (156 canonical operations plus 5 fiscal aliases). The hosted grouped profile serves 164 tool names, 7 resources, and 10 prompts (the same names plus 3 discovery tools, with API-backed resources kept local-only). The separately reviewed OpenAI profile serves 33 tool names, 0 resources, and 0 prompts. Catalogue membership is not a promise that a backing API is enabled for every workspace.
51
73
 
52
74
  ---
53
75
 
@@ -60,9 +82,13 @@ You: "Create an invoice for TechStart SL, 40 hours of consulting at 75 EUR/h
60
82
  Claude: Done. Invoice INV-2026-089 created. Total: 3,000.00 EUR + 21% IVA = 3,630.00 EUR.
61
83
  ```
62
84
 
63
- 157 tools. 11 resources. 10 prompts. Structured output on every tool. Zero boilerplate.
85
+ 156 canonical operations. Five fiscal aliases. Ten prompts. The local package serves 11 resources; the hosted Worker deliberately serves the 7 static resources, while API-backed workspace resources remain local-profile only.
64
86
 
65
- <!-- v1.12.0-beta.1 — D4-B megasprint: HR (9), payroll (2), onboarding (2), permissions (2), period close (3), webhook test (1) = +19 = 157 tools total -->
87
+ <!-- v1.12.0-beta.1 — D4-B megasprint: HR (9), payroll (2), permissions (2), period close (3), webhook test (1) = +17 = 156 tools total
88
+ (Onboarding's two tools were withdrawn via #124 because the Frihet-ERP
89
+ /v1/onboarding/* family does not exist; the original +19 = 158 count
90
+ dropped to +17 = 156. The withdrawal is permanent until Frihet-ERP
91
+ ships the family.) -->
66
92
 
67
93
  ---
68
94
 
@@ -80,8 +106,32 @@ When you're ready for your real data, drop the flag and add your key ([app.frihe
80
106
 
81
107
  ---
82
108
 
109
+ ## For AI agents
110
+
111
+ If you are an agent reading this repository rather than a person reading a page, everything you need is machine-readable and generated from the running server — you do not have to parse this README.
112
+
113
+ | What | Where |
114
+ |------|-------|
115
+ | Onboarding contract: quickstart per client, auth, safe workflow, human-authority tool lists, error recovery | [`docs/agent-onboarding.json`](./docs/agent-onboarding.json) — also shipped inside the npm package |
116
+ | Per-tool capability truth: `callability`, `writesFrihet`, `externalInteraction`, `externalSideEffects` | `_meta["io.frihet/capability"]` on every entry of `tools/list` |
117
+ | How to behave once connected | the `instructions` string returned by `initialize` — your client hands it to you automatically |
118
+
119
+ Three rules the contract encodes, in short:
120
+
121
+ 1. **Orient before acting.** `get_business_context` and the `frihet://tax/rates` resource decide the correct fiscal treatment. Do not recall a Spanish tax rate from memory.
122
+ 2. **Draft, show, stop.** `create_invoice`, `create_quote` and `create_credit_note` all default to `status=draft` — no fiscal number, no hash, nothing sent to a tax authority. Present the draft and hand back.
123
+ 3. **Human authority is not yours to assume.** Any tool with a non-empty `externalSideEffects` reaches a client's inbox, a webhook, money, or AEAT / VeriFactu / TicketBAI / FACe. Several also take `confirm=true`; that flag records a human decision — never set it to satisfy your own plan.
124
+
125
+ `docs/agent-onboarding.json` is regenerated from the live surface by `npm run generate:agent-onboarding` and gated in CI by `npm run gate:agent-onboarding`, so its tool lists and counts cannot drift from the server.
126
+
127
+ ---
128
+
83
129
  ## Install
84
130
 
131
+ Local npm/stdio installs require Node **22.23.4+ (22.x), 24.22.1+ (24.x), or 26.12.1+ (26.x)**, covering the [October 2026 Node security fixes](https://nodejs.org/en/blog/vulnerability/october-2026-security-releases). Node 20 is end-of-life: upgrade the Node runtime used by your MCP client before starting the server. CI uses Node 22.23.4.
132
+
133
+ This source change does not update previously published npm package metadata or users' installed Node runtimes. Updated package metadata requires a separate npm release; users can upgrade their runtime now. The remote Cloudflare Worker has a separate runtime and release process.
134
+
85
135
  ### One-line (Claude Code, Cursor, Copilot, Codex, Windsurf, Gemini CLI, and more)
86
136
 
87
137
  ```bash
@@ -97,16 +147,47 @@ This repository is also a Claude Code plugin (`frihet-erp`): installing it wires
97
147
  claude --plugin-dir /path/to/frihet-mcp
98
148
  ```
99
149
 
100
- Once available in the community marketplace:
150
+ Marketplace availability is pending. Use the local plugin command above or the Claude Code MCP command below to connect today.
151
+
152
+ Skill invocation: `/frihet-erp:frihet-mcp`. The bundled `.mcp.json` launches `@frihet/mcp-server` via `npx` — set `FRIHET_API_KEY` in your environment (get one at [app.frihet.io](https://app.frihet.io) → Settings → API keys).
153
+
154
+ The [portable Claude plugin preview](plugins/claude/frihet-erp/README.md) bundles
155
+ real receivables, document-drafting and monthly-review skills with the existing
156
+ public remote MCP. Load `plugins/claude/frihet-erp` in Claude Code or upload a ZIP
157
+ of that folder in chat/Cowork. Its skills guide behavior; they do not filter the
158
+ hosted catalogue or establish Directory approval. The root local MCP setup above
159
+ keeps its existing API-key configuration.
160
+
161
+ ### Claude Code — one command
101
162
 
102
- ```text
103
- /plugin marketplace add anthropics/claude-plugins-community
104
- /plugin install frihet-erp@claude-community
163
+ ```bash
164
+ claude mcp add frihet -s user -e FRIHET_API_KEY=fri_your_key_here -- npx -y @frihet/mcp-server
165
+ claude mcp list # verify: frihet ✓ Connected
105
166
  ```
106
167
 
107
- Skill invocation: `/frihet-erp:frihet-mcp`. The bundled `.mcp.json` launches `@frihet/mcp-server` via `npx` — set `FRIHET_API_KEY` in your environment (get one at [app.frihet.io](https://app.frihet.io) → Settings → API keys).
168
+ The CLI owns the config file, so there is nothing to hand-edit and no path to get wrong. (User scope writes `~/.claude.json`, not `~/.claude/mcp.json`.)
169
+
170
+ ### Codex CLI — one command
171
+
172
+ ```bash
173
+ codex mcp add frihet --env FRIHET_API_KEY=fri_your_key_here -- npx -y @frihet/mcp-server
174
+ codex mcp list # verify
175
+ ```
176
+
177
+ Codex config is **TOML**, not JSON. `codex mcp add` writes:
178
+
179
+ ```toml
180
+ [mcp_servers.frihet]
181
+ command = "npx"
182
+ args = ["-y", "@frihet/mcp-server"]
183
+
184
+ [mcp_servers.frihet.env]
185
+ FRIHET_API_KEY = "fri_your_key_here"
186
+ ```
187
+
188
+ > Pasting a JSON `mcpServers` block into `~/.codex/config.toml` is a TOML parse error that takes down your **whole** Codex config, not just this server. Use the command above.
108
189
 
109
- ### Claude Code / Claude Desktop
190
+ ### Claude Desktop, Cursor, Windsurf, Cline — JSON config
110
191
 
111
192
  ```json
112
193
  {
@@ -124,14 +205,12 @@ Skill invocation: `/frihet-erp:frihet-mcp`. The bundled `.mcp.json` launches `@f
124
205
 
125
206
  | Tool | Config file |
126
207
  |------|------------|
127
- | Claude Code | `~/.claude/mcp.json` |
128
208
  | Claude Desktop | `~/Library/Application Support/Claude/claude_desktop_config.json` |
129
209
  | Cursor | `.cursor/mcp.json` or `~/.cursor/mcp.json` |
130
210
  | Windsurf | `~/.windsurf/mcp.json` |
131
211
  | Cline | VS Code settings or `.cline/mcp.json` |
132
- | Codex CLI | `~/.codex/config.toml` (MCP section) |
133
212
 
134
- The JSON config is identical for all tools. Only the file path changes.
213
+ The JSON above is identical for these four clients; only the file path changes. Claude Code and Codex are **not** in this table — they manage their own config through the CLI commands shown above.
135
214
 
136
215
  ### Remote (no install)
137
216
 
@@ -222,7 +301,7 @@ Talk to your ERP. These are real prompts, not marketing copy.
222
301
 
223
302
  ## What to expect
224
303
 
225
- 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. Most of the 157 tools are CRUD operations over the REST API; the rest are read-only summaries and fiscal/e-invoice actions.
304
+ 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. Most of the 156 canonical operations are CRUD operations over the REST API; the rest are read-only summaries and fiscal/e-invoice actions. Alias and discovery names are counted separately.
226
305
 
227
306
  **Works great:**
228
307
 
@@ -249,7 +328,7 @@ If you need to digitize paper invoices or receipts, extract the data first (e.g.
249
328
 
250
329
  ---
251
330
 
252
- ## Tools (157)
331
+ ## Catalogue operations (156)
253
332
 
254
333
  ### Invoices (12)
255
334
 
@@ -259,12 +338,12 @@ If you need to digitize paper invoices or receipts, extract the data first (e.g.
259
338
  | `get_invoice` | Get full invoice details by ID |
260
339
  | `create_invoice` | Create a new invoice with line items |
261
340
  | `update_invoice` | Update any invoice field |
262
- | `delete_invoice` | Permanently delete an invoice |
341
+ | `delete_invoice` | Delete a draft invoice; a sent/paid one is cancelled, not destroyed (`confirm=true` required) |
263
342
  | `search_invoices` | Find invoices by client name, date, or status |
264
- | `send_invoice` | Email invoice to client (PDF attachment) |
343
+ | `send_invoice` | Email invoice to client (PDF attachment) — reaches a third party, `confirm=true` required |
265
344
  | `mark_invoice_paid` | Mark an invoice as paid with optional payment date |
266
- | `get_invoice_pdf` | Get a download URL for the invoice PDF |
267
- | `get_invoice_einvoice` | Get the e-invoice XML for a given invoice ID |
345
+ | `get_invoice_pdf` | Get bounded invoice PDF bytes as base64 |
346
+ | `get_invoice_einvoice` | Get bounded XML or Factur-X PDF bytes for an invoice |
268
347
  | `create_credit_note` | Create a credit note linked to an existing invoice |
269
348
  | `apply_late_fee` | Apply a late payment fee to an overdue invoice |
270
349
 
@@ -329,7 +408,7 @@ If you need to digitize paper invoices or receipts, extract the data first (e.g.
329
408
  | `get_quote` | Get quote details |
330
409
  | `create_quote` | Draft a new quote |
331
410
  | `update_quote` | Modify a quote |
332
- | `delete_quote` | Delete a quote |
411
+ | `delete_quote` | Delete only a clean draft with no delivery, response, attachment, or conversion evidence; refuse protected drafts; cancel non-drafts (`confirm=true` required) |
333
412
  | `send_quote` | Email quote to client for acceptance |
334
413
 
335
414
  ### Webhooks (6)
@@ -365,7 +444,7 @@ If you need to digitize paper invoices or receipts, extract the data first (e.g.
365
444
  | `face_status` | Poll submission status from FACe for a submitted invoice |
366
445
  | `ticketbai_submit` | Submit TicketBAI fiscal record to Basque Country tax authority (Hacienda) |
367
446
  | `ticketbai_status` | Poll TicketBAI submission status from the Basque tax authority |
368
- | `ksef_submit` | Submit invoice to KSeF (Poland) — *stub: transport is infra-ready in Frihet-ERP but not yet exposed as a live endpoint (production gated on KSeF cert); returns a labeled "unavailable" error until activated* |
447
+ | `ksef_submit` | **NOT_DEPLOYED** — Submit invoice to KSeF (Poland) — *stub: transport is infra-ready in Frihet-ERP but not yet exposed as a live endpoint (production gated on KSeF cert); returns a labeled "unavailable" error until activated* |
369
448
 
370
449
  ### Time Tracking (6)
371
450
 
@@ -389,15 +468,15 @@ If you need to digitize paper invoices or receipts, extract the data first (e.g.
389
468
  | `pause_recurring_invoice` | Pause an active template — no invoices generated while paused |
390
469
  | `resume_recurring_invoice` | Resume a paused template — next invoice on next scheduled cycle |
391
470
  | `delete_recurring_invoice` | Permanently delete a template (confirm=true required) |
392
- | `run_recurring_now` | Manually trigger immediate generation of the next invoice instance |
471
+ | `run_recurring_now` | Generate the next recurring invoice with explicit `confirm=true` in full and grouped modes; workspace settings may trigger fiscal issuance, submission and webhooks |
393
472
 
394
473
  ### Team Management (4)
395
474
 
396
475
  | Tool | What it does |
397
476
  |------|-------------|
398
- | `list_team_members` | List all workspace members with role and invite status |
399
- | `invite_team_member` | Invite a new member by email with role (admin/member/viewer) |
400
- | `update_team_member_role` | Change an existing member's role |
477
+ | `list_team_members` | List active members + pending invites (owner excluded) |
478
+ | `invite_team_member` | Invite a new member by email with role (admin/editor/accountant/viewer) |
479
+ | `update_team_member_role` | Change an existing member's role (admin/editor/accountant/viewer) |
401
480
  | `remove_team_member` | Remove a member from the workspace (confirm=true required) |
402
481
 
403
482
  ### Gestoria — Accountants (5)
@@ -437,17 +516,17 @@ If you need to digitize paper invoices or receipts, extract the data first (e.g.
437
516
 
438
517
  | Tool | What it does |
439
518
  |------|-------------|
440
- | `frihet_modelo_415_summary` | M415 annual operations >€3,005 (Canarias equivalent of M347) |
441
- | `frihet_modelo_425_summary` | M425 annual IGIC recap for Canary Islands businesses |
442
- | `frihet_modelo_418_summary` | M418 monthly IGIC return for large enterprises (grandes empresas) |
443
- | `frihet_aiem_calculate` | Calculate AIEM (Arbitrio Importación) for imported/produced goods in Canarias |
519
+ | `frihet_modelo_415_summary` | M415 annual operations >€3,005 (Canarias equivalent of M347) — not deployed, returns `NOT_DEPLOYED` |
520
+ | `frihet_modelo_425_summary` | M425 annual IGIC recap for Canary Islands businesses — not deployed, returns `NOT_DEPLOYED` |
521
+ | `frihet_modelo_418_summary` | M418 monthly individual IGIC return, régimen especial del grupo de entidades — not deployed, returns `NOT_DEPLOYED` |
522
+ | `frihet_aiem_calculate` | AIEM (Arbitrio Importación) calculation for Canarias — not deployed, returns `NOT_DEPLOYED` |
444
523
 
445
524
  ### Impuesto sobre Sociedades — Corporate Tax (2)
446
525
 
447
526
  | Tool | What it does |
448
527
  |------|-------------|
449
- | `frihet_modelo_200_summary` | Modelo 200 annual IS return (taxable base, deductions, net payable) |
450
- | `frihet_modelo_202_summary` | Modelo 202 installment payments (1P April, 2P October, 3P December) |
528
+ | `frihet_modelo_200_summary` | Modelo 200 annual IS return — not deployed, returns `NOT_DEPLOYED` |
529
+ | `frihet_modelo_202_summary` | Modelo 202 installment payments (1P/2P/3P) — not deployed, returns `NOT_DEPLOYED` |
451
530
 
452
531
  ### Bank Categorization Rules (2)
453
532
 
@@ -466,7 +545,7 @@ If you need to digitize paper invoices or receipts, extract the data first (e.g.
466
545
  | `update_deposit` | Update deposit fields |
467
546
  | `delete_deposit` | Delete a deposit (confirm=true required) |
468
547
  | `apply_deposit` | Apply a deposit balance against an invoice |
469
- | `refund_deposit` | Issue a refund for a deposit |
548
+ | `refund_deposit` | Record a deposit refund in Frihet bookkeeping with `confirm=true`; optional `amount` records that portion, omission records the remaining refundable balance. Does not transfer money |
470
549
 
471
550
  ### Vendors (5)
472
551
 
@@ -495,7 +574,7 @@ If you need to digitize paper invoices or receipts, extract the data first (e.g.
495
574
  | `get_modelo_303_summary` | Quarterly IVA return (Modelo 303) — collected vs deductible, net payable |
496
575
  | `get_modelo_130_summary` | Quarterly IRPF installment for self-employed (Modelo 130) |
497
576
  | `get_modelo_390_summary` | Annual IVA summary (Modelo 390) |
498
- | `get_modelo_180_summary` | Annual withholding summary for rentals (Modelo 180) |
577
+ | `get_modelo_180_summary` | Annual withholding summary for rentals (Modelo 180) — not deployed, returns `NOT_DEPLOYED` |
499
578
  | `get_modelo_347_summary` | Annual third-party transactions >€3,005 (Modelo 347) |
500
579
  | `verifactu_status` | Get VeriFactu submission status for a fiscal record |
501
580
  | `verifactu_resubmit` | Resubmit a rejected VeriFactu fiscal record |
@@ -542,57 +621,69 @@ If you need to digitize paper invoices or receipts, extract the data first (e.g.
542
621
  | `leave_list` | List leave requests with filters (user, status, date range) |
543
622
  | `attendance_clock_in` | Record clock-in for an employee |
544
623
  | `attendance_clock_out` | Record clock-out for an employee |
545
- | `overtime_report` | Generate overtime report for a period |
624
+ | `overtime_report` | Read daily/weekly overtime, aggregate minutes/hours, and compliance alerts computed over the selected YYYY or YYYY-MM records |
546
625
  | `anomaly_list` | List attendance anomalies (missing punches, excessive overtime) |
547
626
 
548
627
  ### Payroll (2)
549
628
 
550
629
  | Tool | What it does |
551
630
  |------|-------------|
552
- | `payroll_export` | Export payroll data for a period (CSV/PDF for gestoría) |
553
- | `payroll_checklist` | Generate pre-payroll checklist: pending leaves, anomalies, overtime |
631
+ | `payroll_export` | Read normalized payroll-ready employee data; the format value is an echoed destination label, not a generated file |
632
+ | `payroll_checklist` | List payable employees with payroll-profile readiness, missing fields, and monthly review state |
554
633
 
555
- ### Onboarding (2)
634
+ ### Onboarding — withdrawn via #124
556
635
 
557
- | Tool | What it does |
558
- |------|-------------|
559
- | `onboarding_status` | Get onboarding completion status for the current workspace |
560
- | `onboarding_persona_set` | Set or update the business persona (freelancer, SME, gestoría, etc.) |
636
+ The `onboarding_status` and `onboarding_persona_set` tools were withdrawn because the Frihet-ERP `/v1/onboarding/*` family does not exist as of this release. See [issue #124](https://github.com/Frihet-io/frihet-mcp/issues/124) for the audit and the precedent (`src/tools/igic.ts` shows the inline `NOT_DEPLOYED` stub pattern used for families whose backing API is not yet shipped; onboarding chose full withdrawal instead, because the catalogue should not over-promise tools that have no live handler).
637
+
638
+ If a future Frihet-ERP release ships the family, restore `src/tools/onboarding.ts`, the `onboardingStatusOutput` / `onboardingPersonaResultOutput` schemas in `src/tools/shared.ts`, the `getOnboardingStatus` / `setOnboardingPersona` methods on `IFrihetClient`, and the registration in `src/tools/register-all.ts` (the `Onboarding tools — withdrawn via #124` test in `src/__tests__/d4b-hr-payroll-onboarding-tools.test.ts` is the gate that will fail and remind the next maintainer what was here).
561
639
 
562
640
  ### Permissions (2)
563
641
 
564
642
  | Tool | What it does |
565
643
  |------|-------------|
566
- | `permissions_matrix` | Get the full permissions matrix for all roles in the workspace |
567
- | `permissions_me` | Get the current API key's effective permissions |
644
+ | `permissions_matrix` | Get the documented RBAC-model snapshot (not a runtime authorization guarantee) |
645
+ | `permissions_me` | Compare RBAC-model fields with actual API-key scopes and known scope denials (non-exhaustive) |
568
646
 
569
647
  ### Period Close (3)
570
648
 
571
649
  | Tool | What it does |
572
650
  |------|-------------|
573
- | `period_close_status` | Get the close status for an accounting period |
651
+ | `period_close_status` | Get the current or selected YYYY fiscal-year range, open/closed state, and nullable closing details |
574
652
  | `period_close` | Close an accounting period (gestor/admin only — TRUST AREA) |
575
653
  | `period_reopen` | Reopen a closed period with a mandatory reason (TRUST AREA) |
576
654
 
577
- All 157 tools return **structured output** via `outputSchema` -- typed JSON, not raw text. List tools return paginated results (`{ data, total, limit, offset }`).
655
+ All canonical operations (and their aliases) return **structured output** via `outputSchema` -- typed JSON, not raw text. List response shapes follow their API family; not every list endpoint is paginated.
656
+
657
+ ### Capability and side-effect truth
658
+
659
+ On the full MCP surfaces, every `tools/list` entry includes `_meta["io.frihet/capability"]`:
660
+
661
+ - `registered` means the name and handler exist in this server build;
662
+ - `callability` is `api_dependent` (the handler calls the API; deployment, workspace enablement, and authorization still decide), `runtime_checked` (the handler explicitly distinguishes an absent backend from empty data), `deferred`, `unavailable`, or `local`—never an unconditional “available” claim;
663
+ - `writesFrihet`, `externalInteraction`, and `externalSideEffects` distinguish state changes and calls to external entities/providers;
664
+ - MCP action annotations remain the standard source for read-only, destructive, idempotent, and open-world hints.
665
+
666
+ The ChatGPT/OpenAI host is a separately reviewed surface: exactly 33 business operations with complete descriptions, 0 discovery meta-tools, 0 prompts, and 0 resources. Its 17 reads and 16 writes are deliberately narrow, and all writes require literal `confirm=true`. Ten writes may deliver full business events to active endpoints previously configured by the workspace owner; webhook administration itself remains excluded. Direct email delivery, the legacy monthly summary, raw invoice PDFs, invoice lifecycle transitions, updating an existing quote, regulated filing, deleting client parent records, deleting expenses with their linked files, deleting products, and deleting vendors are also excluded. This surface must not be inferred from the full catalogue.
578
667
 
579
668
  ---
580
669
 
581
- ## Resources (11)
670
+ ## Resources
582
671
 
583
672
  Context the AI can read to make smarter decisions.
584
673
 
674
+ The local package serves 11 resources: 7 static references plus 4 API-backed workspace resources. The hosted Worker serves the 7 static resources. The OpenAI-reviewed host serves 0 resources.
675
+
585
676
  **Static** (reference data, no API calls):
586
677
 
587
678
  | Resource | URI | What it provides |
588
679
  |----------|-----|-----------------|
589
680
  | API Schema | `frihet://api/schema` | OpenAPI summary: endpoints, auth, rate limits, pagination, error codes |
590
681
  | Tax Rates | `frihet://tax/rates` | Tax rates by Spanish fiscal zone: IVA, IGIC, IPSI, EU reverse charge, IRPF |
591
- | Tax Calendar | `frihet://tax/calendar` | Quarterly filing deadlines: Modelo 303, 130, 390, 420, VeriFactu timeline |
682
+ | Tax Calendar | `frihet://tax/calendar` | Quarterly and annual filing deadlines for the listed Spanish tax models |
592
683
  | Expense Categories | `frihet://config/expense-categories` | 8 categories with deductibility rules, IVA treatment, amortization |
593
684
  | Invoice Statuses | `frihet://config/invoice-statuses` | Status flow (draft > sent > paid/overdue > cancelled), transition rules, webhook events |
594
685
  | Currencies | `frihet://config/currencies` | 40 supported currencies with ISO codes, symbols, decimal places, locale formatting |
595
- | Countries | `frihet://config/countries` | 61 supported countries with fiscal zones, default tax rates, currencies, invoice prefixes |
686
+ | Countries | `frihet://config/countries` | Supported countries with fiscal zones, default tax rates, currencies, invoice prefixes |
596
687
 
597
688
  **Dynamic** (live data from your account):
598
689
 
@@ -659,6 +750,12 @@ Two transports:
659
750
  | `FRIHET_API_KEY` | Yes (stdio) | -- |
660
751
  | `FRIHET_API_URL` | No | `https://api.frihet.io/v1` |
661
752
  | `FRIHET_TOOL_MODE` | No | `full` |
753
+ | `FRIHET_CLAUDE_MODE` | No (unreleased local candidate) | `false` |
754
+
755
+ The source-only Claude candidate requires building this checkout and running
756
+ `dist/index.js`; existing npm releases are not claimed to support the flag.
757
+ See [candidate scope, exclusions and checks](marketplace/anthropic/SUBMISSION.md).
758
+ It cannot be combined with `FRIHET_OPENAI_MODE=true` and is not enabled in the deployed Worker.
662
759
 
663
760
  ---
664
761
 
@@ -670,10 +767,10 @@ Frihet's differentiator is **depth** — full ES/EU fiscal coverage plus native
670
767
 
671
768
  | Mode | Behavior |
672
769
  |------|----------|
673
- | `full` (default) | All tools are exposed with their full descriptions and schemas. **Unchanged from previous releases** — existing setups are unaffected. |
770
+ | `full` (default) | Canonical tools and fiscal aliases are exposed with full descriptions and schemas. Public descriptors add conservative callability and side-effect truth; operation names, schemas and handlers are unchanged. |
674
771
  | `grouped` | **Progressive disclosure.** Each tool's description collapses to a one-line `[group] summary — full schema via describe_tool('name')`, and three lightweight discovery tools are added. The agent loads depth only for the tools it actually needs. |
675
772
 
676
- In `grouped` mode the tools are unchanged — same names, same input schemas, same behavior. Only the *up-front context cost* changes. Discovery flows through three meta-tools:
773
+ In `grouped` mode operation names, input schemas and handlers are unchanged. Descriptors also expose the same conservative capability and action truth as the full profile. Discovery flows through three meta-tools:
677
774
 
678
775
  - **`list_tool_groups()`** — the domain map (invoicing, expenses, fiscal/compliance, banking, CRM, HR/payroll, stay/PMS, POS, intelligence, products, platform) with a one-line blurb and tool count for each.
679
776
  - **`search_tools(query)`** — free-text search across tool name, title, summary and group; returns matching tools with their group, summary, read-only flag and input fields. Optional `group` filter and `limit`.
@@ -695,7 +792,7 @@ In `grouped` mode the tools are unchanged — same names, same input schemas, sa
695
792
  }
696
793
  ```
697
794
 
698
- > This is an opt-in exposure layer only — it never changes a tool's logic, name or behavior, and `full` mode is byte-identical to before. The same interceptor pattern powers the OpenAI-safe profile (`FRIHET_OPENAI_MODE`).
795
+ > Grouped exposure changes description density, not operation behavior. The versioned OpenAI-reviewed profile is composed separately and remains independently gated.
699
796
 
700
797
  ---
701
798
 
@@ -721,7 +818,7 @@ Beyond raw MCP tools, this repo includes a **Claude Code skill** that adds busin
721
818
 
722
819
  ```bash
723
820
  git clone https://github.com/Frihet-io/frihet-mcp.git
724
- ln -s "$(pwd)/frihet-mcp/skill" ~/.claude/skills/frihet
821
+ ln -s "$(pwd)/frihet-mcp/skills/frihet-mcp" ~/.claude/skills/frihet-mcp
725
822
  ```
726
823
 
727
824
  Or with the universal installer:
@@ -730,20 +827,7 @@ Or with the universal installer:
730
827
  npx skills add Frihet-io/frihet-mcp
731
828
  ```
732
829
 
733
- ### Commands
734
-
735
- | Command | What it does |
736
- |---------|-------------|
737
- | `/frihet status` | Account overview, recent activity, pending payments |
738
- | `/frihet invoice` | Create, list, search invoices |
739
- | `/frihet expense` | Log and query expenses |
740
- | `/frihet clients` | Manage client database |
741
- | `/frihet quote` | Create and manage quotes |
742
- | `/frihet report` | Financial summaries (P&L, quarterly, overdue) |
743
- | `/frihet webhooks` | Configure automation triggers |
744
- | `/frihet setup` | Guided setup and connection test |
745
-
746
- The skill knows about IVA rates, IRPF retention, Modelo 303 prep, expense deductibility rules, and VeriFactu compliance.
830
+ The skill routes requests to the Frihet MCP tools (invoices, quotes, expenses, clients, monthly review) and tells the agent when to ask for confirmation before writes. It does not add standalone `/frihet` subcommands, and it does not ship VAT rates or deductibility rules: tax figures come from your Frihet data, not from the skill.
747
831
 
748
832
  Full documentation: [docs.frihet.io/desarrolladores/skill-claude-code](https://docs.frihet.io/desarrolladores/skill-claude-code)
749
833
 
@@ -797,7 +881,7 @@ npm run build # must pass before submitting
797
881
 
798
882
  | Package | What it is |
799
883
  |---------|-----------|
800
- | [`@frihet/mcp-server`](https://www.npmjs.com/package/@frihet/mcp-server) | This MCP server (157 tools, 11 resources, 10 prompts) |
884
+ | [`@frihet/mcp-server`](https://www.npmjs.com/package/@frihet/mcp-server) | This MCP server (156 canonical operations + 5 alias names; 11 local resources; 10 prompts) |
801
885
  | [`@frihet/sdk`](https://github.com/Frihet-io/frihet-sdk) | TypeScript SDK (`frihet.invoices.create()`) |
802
886
  | [`frihet`](https://www.npmjs.com/package/frihet) | CLI (`frihet invoices list --status overdue`) |
803
887
  | [`n8n-nodes-frihet`](https://www.npmjs.com/package/n8n-nodes-frihet) | n8n community node for workflow automation |
@@ -813,9 +897,11 @@ npm run build # must pass before submitting
813
897
  - [MCP server docs](https://docs.frihet.io/desarrolladores/mcp-server) -- Setup guides, troubleshooting
814
898
  - [npm](https://www.npmjs.com/package/@frihet/mcp-server) -- Package registry
815
899
  - [Smithery](https://smithery.ai/servers/frihet/frihet-mcp) -- Smithery marketplace
816
- - [MCP Registry](https://registry.modelcontextprotocol.io/?q=io.frihet) -- Anthropic official registry
900
+ - [MCP Registry](https://registry.modelcontextprotocol.io/?q=io.frihet) -- Official Model Context Protocol registry
901
+ - [GitHub MCP Registry](https://github.com/mcp/io.frihet/erp) -- Frihet listing on GitHub
817
902
  - [Remote endpoint](https://mcp.frihet.io) -- Hosted MCP server (Cloudflare Workers)
818
903
  - [OpenAPI spec](https://api.frihet.io/openapi.json) -- Machine-readable API definition
904
+ - [Security policy](./SECURITY.md) -- Private vulnerability reporting guidance
819
905
 
820
906
  ---
821
907
 
@@ -0,0 +1,98 @@
1
+ /**
2
+ * Agent-native onboarding contract.
3
+ *
4
+ * Two artefacts, one source:
5
+ *
6
+ * 1. `AGENT_SERVER_INSTRUCTIONS` — the MCP `instructions` string returned by
7
+ * `initialize`. Every MCP client hands this to the model before the first
8
+ * tool call, so it is the only onboarding channel that costs the human
9
+ * zero configuration. It deliberately contains NO counts: a number in a
10
+ * per-session prompt is a number that drifts. It teaches the *mechanism*
11
+ * for finding the current numbers instead.
12
+ *
13
+ * 2. `captureAgentOnboardingDescriptor()` — the machine-readable descriptor
14
+ * written to `docs/agent-onboarding.json` by
15
+ * `scripts/generate-agent-onboarding.mjs`. It is captured through the real
16
+ * MCP SDK against the real registration path, so the tool lists in it
17
+ * cannot drift from the server: `npm run gate:agent-onboarding` re-captures
18
+ * and byte-compares.
19
+ *
20
+ * Nothing here registers a tool, a resource or a prompt. The surface counts the
21
+ * conformance baseline and the public capability contract already pin are
22
+ * unchanged by this module, on purpose.
23
+ */
24
+ export declare const AGENT_ONBOARDING_CONTRACT_VERSION = 1;
25
+ /** Where an API key actually comes from — a deep link, not a navigation
26
+ * instruction, so the human has one click instead of a hunt.
27
+ *
28
+ * Verified against the ERP: `settingsSectionToPath` renders `/settings/<id>`
29
+ * and `api` is in `ALL_SETTINGS_SECTIONS`, so this URL resolves to the
30
+ * ApiKeysSettings panel. The old index.ts wording ("Settings > Developers >
31
+ * API Keys") pointed at a section that does not exist. */
32
+ export declare const API_KEY_LOCATION = "https://app.frihet.io/settings/api";
33
+ export declare const AGENT_SERVER_INSTRUCTIONS = "Frihet ERP \u2014 real business and fiscal records. Read freely, propose before you mutate.\n\nAUTH\n- Local (stdio): FRIHET_API_KEY=fri_... \u2014 create one at https://app.frihet.io/settings/api.\n- No key yet: FRIHET_DEMO=1 serves example fixtures. No network call, nothing persisted, demo_-prefixed IDs, fiscal actions simulated.\n- Hosted: https://mcp.frihet.io/mcp \u2014 OAuth 2.1 + PKCE, or Authorization: Bearer fri_...\n\nORIENT BEFORE ACTING (read-only)\n- get_business_context \u2014 fiscal zone, currency, IRPF/IVA defaults, plan limits. Call this first; the correct tax treatment depends on it.\n- Resources carry informational reference data with declared provenance: frihet://tax/rates and frihet://tax/calendar (Spanish statutory schedules and deadlines), frihet://config/expense-categories (LIRPF/LIVA deductibility guidelines), frihet://config/countries and currencies (defaults and ISO codes), frihet://api/schema (endpoint snapshot; canonical at https://api.frihet.io/v1/openapi.json). Read them instead of guessing, but treat as informational: writing tools and server endpoints enforce business and fiscal invariants server-side.\n\nCAPABILITY DISCOVERY\n- Every tool in tools/list carries _meta[\"io.frihet/capability\"] = {callability, writesFrihet, externalInteraction, externalSideEffects}. Read it before you call.\n- callability is a conservative fact, not a promise: api_dependent | runtime_checked | deferred | unavailable | local. Registration does NOT mean the backing API is enabled for this workspace; deferred and unavailable tools will refuse.\n- Large surface: set FRIHET_TOOL_MODE=grouped for progressive disclosure (list_tool_groups, search_tools, describe_tool) instead of loading every schema.\n\nTHE SAFE WORKFLOW \u2014 draft, show, stop\n- create_invoice defaults to status=draft: no fiscal number, no hash, nothing submitted to a tax authority. create_quote and create_credit_note are drafts too.\n- Build the draft, read it back, present it to the human, and stop there. Issuing is a separate, human-authorised step.\n\nHUMAN AUTHORITY \u2014 do not call unprompted\n- Any tool whose capability shows a non-empty externalSideEffects reaches outside Frihet \u2014 email to a client, webhook delivery, money movement, or a submission to AEAT / VeriFactu / TicketBAI / FACe. You cannot undo those.\n- Several also take confirm=true. It is a local client/agent interlock, not server-verifiable human attestation and not actor/resource/payload/expiry-bound. Never set it to satisfy your own plan; ask, then pass what you were told.\n- delete_invoice does not always delete: an issued invoice is CANCELLED (status=cancelled) because VeriFactu forbids breaking the hash chain. Same for quotes.\n\nWHEN A CALL FAILS\n- Errors carry sanitized remediation text \u2014 read it, do not guess. 401 = key; 403 = scope or plan; 429 = wait Retry-After seconds.\n- After 409 IDEMPOTENCY_REQUEST_IN_PROGRESS, do NOT retry with a fresh Idempotency-Key. Read the resource back and decide from its actual state; a new key would create a second fiscal document.\n\nMachine-readable version of this contract: https://github.com/Frihet-io/frihet-mcp/blob/main/docs/agent-onboarding.json";
34
+ export interface AgentOnboardingDescriptor {
35
+ onboardingContractVersion: number;
36
+ server: {
37
+ mcpName: string;
38
+ npmPackage: string;
39
+ remoteEndpoint: string;
40
+ transport: readonly string[];
41
+ };
42
+ auth: {
43
+ envVar: string;
44
+ keyFormat: string;
45
+ obtainAt: string;
46
+ remoteMethods: readonly string[];
47
+ noAuthTrial: {
48
+ env: Record<string, string>;
49
+ persists: false;
50
+ network: false;
51
+ };
52
+ };
53
+ /** One verified command per client. Every `command` here was executed against
54
+ * the real binary in an isolated HOME before being written down. */
55
+ quickstart: Record<string, {
56
+ steps: readonly string[];
57
+ configFormat: string;
58
+ verify: string;
59
+ }>;
60
+ capabilityDiscovery: {
61
+ metaKey: string;
62
+ callabilityValues: readonly string[];
63
+ groupedModeEnv: Record<string, string>;
64
+ counts: {
65
+ toolNames: number;
66
+ readOnly: number;
67
+ writesFrihet: number;
68
+ externalInteraction: number;
69
+ destructive: number;
70
+ resources: number;
71
+ prompts: number;
72
+ };
73
+ };
74
+ safeWorkflow: {
75
+ description: string;
76
+ steps: readonly {
77
+ call: string;
78
+ kind: string;
79
+ note: string;
80
+ }[];
81
+ };
82
+ humanAuthority: {
83
+ rule: string;
84
+ confirmRequired: readonly string[];
85
+ externalSideEffects: readonly {
86
+ tool: string;
87
+ effects: readonly string[];
88
+ }[];
89
+ };
90
+ errors: readonly {
91
+ condition: string;
92
+ meaning: string;
93
+ agentAction: string;
94
+ }[];
95
+ }
96
+ export declare function captureAgentOnboardingDescriptor(): Promise<AgentOnboardingDescriptor>;
97
+ export declare function serializeAgentOnboardingDescriptor(descriptor: AgentOnboardingDescriptor): string;
98
+ //# sourceMappingURL=agent-onboarding.d.ts.map