@casys/mcp-erpnext 3.1.0-beta.1 → 3.1.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -8,6 +8,14 @@ English | [繁體中文](README.zh-TW.md)
8
8
  [![MCP](https://img.shields.io/badge/MCP-server-1f6feb?logo=modelcontextprotocol&logoColor=white)](https://modelcontextprotocol.io)
9
9
  [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
10
10
 
11
+ > [!IMPORTANT]
12
+ > **Installing the 3.1 beta:** pin the prerelease while this UX is being
13
+ > validated. For npm/Node use `npx -y @casys/mcp-erpnext@3.1.0-beta.3`; for Deno
14
+ > use `deno run -A jsr:@casys/mcp-erpnext@3.1.0-beta.3/server`. The moving npm
15
+ > alias is `@next`. The beta adds the generic document viewer and attachment
16
+ > workflows, so test it with the MCP host your users actually run before
17
+ > replacing a stable deployment.
18
+
11
19
  Let any MCP-compatible AI agent operate your [ERPNext](https://erpnext.com) /
12
20
  Frappe instance — documents, workflows, and interactive viewers inside the host
13
21
  (Claude Desktop, Claude Code, VS Code Copilot, or custom).
@@ -72,10 +80,11 @@ See the [CHANGELOG](CHANGELOG.md) for the full release history, or the
72
80
  [latest release](https://github.com/Casys-AI/mcp-erpnext/releases/latest) for
73
81
  the current version's highlights.
74
82
 
75
- > **3.1 beta preview:** install with `npx -y @casys/mcp-erpnext@next`. The beta
76
- > remains compatible with the 3.0 tool surface and progressively enables in-view
77
- > navigation and active context according to the capabilities advertised by the
78
- > MCP host.
83
+ > **3.1 beta preview:** the beta keeps the 3.0 tool surface and adds a generic
84
+ > document viewer, child tables, document attachments, in-view navigation, and
85
+ > active context. Features remain capability-gated by the MCP host. In
86
+ > particular, downloads require both proxied server tools and the MCP Apps
87
+ > `downloadFile` capability.
79
88
 
80
89
  ## Documentation
81
90
 
@@ -181,13 +190,14 @@ until it exists. See
181
190
 
182
191
  ## UI Viewers
183
192
 
184
- Seven interactive [MCP Apps](https://github.com/modelcontextprotocol/ext-apps)
193
+ Eight interactive [MCP Apps](https://github.com/modelcontextprotocol/ext-apps)
185
194
  viewers, registered as `ui://mcp-erpnext/{name}`:
186
195
 
187
196
  | Viewer | Description | Interactive Features |
188
197
  | ---------------- | ---------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
198
+ | `doc-viewer` | Generic ERPNext document with fields and child tables | Capability-gated attachments, typed navigation, guarded Submit/Cancel, and raw JSON fallback. |
189
199
  | `doclist-viewer` | Generic document table with sort, filter, pagination, CSV export | Inline details, typed nested navigation, Submit/Cancel, and compact status filters. |
190
- | `invoice-viewer` | Sales/Purchase documents with parties, items, totals | Item, stock, party, and payment navigation plus guarded Submit/Cancel actions. |
200
+ | `invoice-viewer` | Sales Orders, Sales Invoices, and Quotations with line totals | Item, stock, party, and payment navigation plus guarded Submit/Cancel actions. |
191
201
  | `stock-viewer` | Stock balance table with color-coded qty badges | Item details, recent movements, stock charts, and stock-entry navigation. |
192
202
  | `chart-viewer` | Universal chart renderer (12 types via Recharts) | Exact point/series navigation and active-context selection across simple and composed charts. |
193
203
  | `kanban-viewer` | Read-write kanban for Task, Opportunity, Issue | Drag-and-drop, inline editing, serialized saves, and typed related-document navigation. |
@@ -201,6 +211,9 @@ Viewers progressively select the best interaction supported by the host:
201
211
  - `serverTools` opens typed list, record, and chart targets inside the current
202
212
  viewer through `app.callServerTool()`. Back and breadcrumb navigation restore
203
213
  the state of each level.
214
+ - `downloadFile` lets the host confirm and save an attachment returned as a
215
+ bounded embedded resource. The viewer never opens an ERPNext file URL
216
+ directly.
204
217
  - `updateModelContext` lets chart, KPI, and funnel selections join a bounded
205
218
  active-context snapshot. The compact context chip keeps up to eight items and
206
219
  lets users remove one item or clear them all. The snapshot contains selected
@@ -219,7 +232,10 @@ that are not loaded.
219
232
  Read-only viewers revalidate on focus and through their refresh control.
220
233
  Mutations use an explicit read-only request to fetch committed state; a mutating
221
234
  tool is never replayed automatically. Overlapping or stale responses are ignored
222
- when a newer host payload or mutation has already won.
235
+ when a newer host payload or mutation has already won. A confirmed document
236
+ change marks every potentially derived snapshot in the current navigation stack
237
+ as stale; each marker is removed only when that surface has actually been read
238
+ again. Separate MCP Apps are not synchronized automatically in the 3.1 beta.
223
239
 
224
240
  ### Building UI viewers
225
241
 
@@ -231,8 +247,11 @@ node build-all.mjs
231
247
 
232
248
  ## Tools
233
249
 
234
- Each `_list` tool returns interactive results via the doclist-viewer with row
235
- click, inline detail, and cross-viewer navigation.
250
+ Record `_list` tools return interactive results via the doclist-viewer with row
251
+ click, inline detail, and cross-viewer navigation. The attachment-specific
252
+ `erpnext_file_list` tool does not render doclist-viewer. Generic and dedicated
253
+ document reads use `doc-viewer`, except Sales Order, Sales Invoice, and
254
+ Quotation, which retain the specialized invoice surface.
236
255
 
237
256
  - **Sales** — Customers, Sales Orders, Invoices, and Quotations with full CRUD,
238
257
  Submit, and Cancel.
@@ -247,9 +266,9 @@ click, inline detail, and cross-viewer navigation.
247
266
  - **Manufacturing** — BOMs, Work Orders, and Job Cards.
248
267
  - **CRM** — Leads, Opportunities, Contacts, and Campaigns.
249
268
  - **Assets** — Assets, Movements, Maintenance records, and Categories.
250
- - **Operations** — Generic CRUD, native assignment, and attachment listing or
251
- upload for any DocType (`erpnext_doc_*`, `erpnext_file_list`,
252
- `erpnext_file_upload`).
269
+ - **Operations** — Generic CRUD, native assignment, and attachment listing,
270
+ upload, or host-mediated download for any DocType (`erpnext_doc_*`,
271
+ `erpnext_file_*`).
253
272
  - **Kanban** — Read-write boards for Task, Opportunity, and Issue with
254
273
  drag-and-drop.
255
274
  - **Analytics** — Charts (bar, area, treemap, radar, scatter, P&L…), KPIs with
@@ -260,13 +279,14 @@ Full per-tool reference with parameters: [`docs/tools.md`](docs/tools.md).
260
279
 
261
280
  ## Environment Variables
262
281
 
263
- | Variable | Required | Description |
264
- | -------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------- |
265
- | `ERPNEXT_URL` | Yes | ERPNext base URL — self-hosted (e.g. `http://localhost:8000`) or cloud (e.g. `https://mycompany.erpnext.com`) |
266
- | `ERPNEXT_API_KEY` | Yes | API Key from User Settings |
267
- | `ERPNEXT_API_SECRET` | Yes | API Secret from User Settings |
268
- | `ERPNEXT_MAX_UPLOAD_BYTES` | No | Maximum decoded file-upload size in bytes (positive integer; default: 10 MiB) |
269
- | `MCP_MRTR_SIGNING_KEY` | No | Exactly 64 lowercase hex characters; enables signed ambiguous-link elicitation. **Single-instance deployments only** see below |
282
+ | Variable | Required | Description |
283
+ | ---------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------- |
284
+ | `ERPNEXT_URL` | Yes | ERPNext base URL — self-hosted (e.g. `http://localhost:8000`) or cloud (e.g. `https://mycompany.erpnext.com`) |
285
+ | `ERPNEXT_API_KEY` | Yes | API Key from User Settings |
286
+ | `ERPNEXT_API_SECRET` | Yes | API Secret from User Settings |
287
+ | `ERPNEXT_MAX_UPLOAD_BYTES` | No | Maximum decoded file-upload size in bytes (positive integer; default: 10 MiB) |
288
+ | `ERPNEXT_MAX_DOWNLOAD_BYTES` | No | Maximum attachment-download size in bytes (positive integer; default: 10 MiB) |
289
+ | `MCP_MRTR_SIGNING_KEY` | No | Exactly 64 lowercase hex characters; enables signed ambiguous-link elicitation. **Single-instance deployments only** — see below |
270
290
 
271
291
  MRTR is opt-in. Without this key, or when the client does not advertise
272
292
  elicitation, ambiguous links keep returning the existing actionable ambiguity