@casys/mcp-erpnext 3.1.0 → 3.2.0-beta.1
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 +137 -70
- package/THIRD_PARTY_NOTICES.txt +58 -992
- package/mcp-erpnext.mjs +3264 -168
- package/package.json +4 -4
- package/ui-dist/buy-evidence-viewer/index.html +2562 -0
- package/ui-dist/chart-viewer/index.html +58 -99
- package/ui-dist/doc-viewer/index.html +116 -0
- package/ui-dist/doclist-viewer/index.html +44 -82
- package/ui-dist/funnel-viewer/index.html +42 -41
- package/ui-dist/invoice-viewer/index.html +42 -86
- package/ui-dist/kanban-viewer/index.html +42 -80
- package/ui-dist/kpi-viewer/index.html +42 -41
- package/ui-dist/stock-viewer/index.html +42 -80
package/README.md
CHANGED
|
@@ -4,20 +4,31 @@ English | [繁體中文](README.zh-TW.md)
|
|
|
4
4
|
|
|
5
5
|
[](https://jsr.io/@casys/mcp-erpnext)
|
|
6
6
|
[](https://www.npmjs.com/package/@casys/mcp-erpnext)
|
|
7
|
-
[](https://github.com/superWorldSavior/mcp-erpnext/actions/workflows/test.yml)
|
|
8
8
|
[](https://modelcontextprotocol.io)
|
|
9
9
|
[](https://m8ven.ai/mcp/casys-ai-mcp-erpnext-1kev4k)
|
|
10
10
|
[](LICENSE)
|
|
11
11
|
|
|
12
|
+
> [!IMPORTANT]
|
|
13
|
+
> **Installing the 3.2 beta:** for npm/Node use
|
|
14
|
+
> `npx -y @casys/mcp-erpnext@next`; for Deno use
|
|
15
|
+
> `deno run -A jsr:@casys/mcp-erpnext@3.2.0-beta.1/server`. npm's `next` tag
|
|
16
|
+
> follows the current prerelease; the JSR command pins this exact beta because
|
|
17
|
+
> JSR has no dist-tags. Stable **3.1.0** is available through npm's `latest`
|
|
18
|
+
> tag. The beta retains the generic document viewer and attachment workflows, so
|
|
19
|
+
> test it with the MCP host your users actually run before replacing a stable
|
|
20
|
+
> deployment. See the [CHANGELOG](CHANGELOG.md) for release history.
|
|
21
|
+
|
|
12
22
|
Let any MCP-compatible AI agent operate your [ERPNext](https://erpnext.com) /
|
|
13
23
|
Frappe instance — documents, workflows, and interactive viewers inside the host
|
|
14
24
|
(Claude Desktop, Claude Code, VS Code Copilot, or custom).
|
|
15
25
|
|
|
16
26
|
Works with **self-hosted** and **ERPNext Cloud** (frappe.cloud) instances.
|
|
17
27
|
|
|
18
|
-
> Built on
|
|
19
|
-
>
|
|
20
|
-
>
|
|
28
|
+
> Built on
|
|
29
|
+
> **[@casys/mcp-server](https://github.com/superWorldSavior/mcp-platform)** —
|
|
30
|
+
> the MCP server framework (concurrency, auth, MCP Apps, observability) that
|
|
31
|
+
> powers this project.
|
|
21
32
|
|
|
22
33
|
## Screenshots
|
|
23
34
|
|
|
@@ -69,19 +80,17 @@ results.
|
|
|
69
80
|
|
|
70
81
|
## What's New
|
|
71
82
|
|
|
72
|
-
**3.1.0 is the stable release.** KPI and funnel viewers now use the refreshed
|
|
73
|
-
interface and support selecting context for the next conversation turn.
|
|
74
|
-
Recognized creation errors include recovery guidance in the existing tools. The
|
|
75
|
-
other five viewers keep their existing interactions.
|
|
76
|
-
|
|
77
|
-
For stable npm installations use `@casys/mcp-erpnext@latest`; for Deno use
|
|
78
|
-
`jsr:@casys/mcp-erpnext@3.1.0/server`. The separate 3.2 beta remains on npm
|
|
79
|
-
`@next` and includes the generic document viewer, attachment workflows and Buy
|
|
80
|
-
evidence features.
|
|
81
|
-
|
|
82
83
|
See the [CHANGELOG](CHANGELOG.md) for the full release history, or the
|
|
83
|
-
[latest release](https://github.com/
|
|
84
|
-
the current version's highlights.
|
|
84
|
+
[latest release](https://github.com/superWorldSavior/mcp-erpnext/releases/latest)
|
|
85
|
+
for the current version's highlights.
|
|
86
|
+
|
|
87
|
+
> **3.2.0-beta.1 preview:** the beta includes the creation-error guidance,
|
|
88
|
+
> ERPNext 16 Opportunity compatibility and calendar-date fixes carried into
|
|
89
|
+
> stable 3.1.0, alongside its generic document viewer, child tables,
|
|
90
|
+
> attachments, in-view navigation and recorded Buy evidence. KPI percentage
|
|
91
|
+
> changes, funnel currencies and context clearing on unsupported hosts are also
|
|
92
|
+
> corrected. Features remain capability-gated by the MCP host; Buy evidence does
|
|
93
|
+
> not purchase or qualify a live ERP.
|
|
85
94
|
|
|
86
95
|
## Documentation
|
|
87
96
|
|
|
@@ -187,52 +196,55 @@ until it exists. See
|
|
|
187
196
|
|
|
188
197
|
## UI Viewers
|
|
189
198
|
|
|
190
|
-
|
|
199
|
+
Nine interactive [MCP Apps](https://github.com/modelcontextprotocol/ext-apps)
|
|
191
200
|
viewers, registered as `ui://mcp-erpnext/{name}`:
|
|
192
201
|
|
|
193
|
-
| Viewer
|
|
194
|
-
|
|
|
195
|
-
| `
|
|
196
|
-
| `
|
|
197
|
-
| `
|
|
198
|
-
| `
|
|
199
|
-
| `
|
|
200
|
-
| `
|
|
201
|
-
| `
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
202
|
+
| Viewer | Description | Interactive Features |
|
|
203
|
+
| --------------------- | ---------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
|
|
204
|
+
| `doc-viewer` | Generic ERPNext document with fields and child tables | Capability-gated attachments, typed navigation, guarded Submit/Cancel, and raw JSON fallback. |
|
|
205
|
+
| `doclist-viewer` | Generic document table with sort, filter, pagination, CSV export | Inline details, typed nested navigation, Submit/Cancel, and compact status filters. |
|
|
206
|
+
| `invoice-viewer` | Sales Orders, Sales Invoices, and Quotations with line totals | Item, stock, party, and payment navigation plus guarded Submit/Cancel actions. |
|
|
207
|
+
| `stock-viewer` | Stock balance table with color-coded qty badges | Item details, recent movements, stock charts, and stock-entry navigation. |
|
|
208
|
+
| `chart-viewer` | Universal chart renderer (12 types via Recharts) | Exact point/series navigation and active-context selection across simple and composed charts. |
|
|
209
|
+
| `kanban-viewer` | Read-write kanban for Task, Opportunity, Issue | Drag-and-drop, inline editing, serialized saves, and typed related-document navigation. |
|
|
210
|
+
| `kpi-viewer` | Big number card with delta, sparkline, trend | Number and trend navigation with bounded active-context selection. |
|
|
211
|
+
| `funnel-viewer` | Trapezoid sales funnel with conversion rates | Period-aware stage navigation and bounded active-context selection. |
|
|
212
|
+
| `buy-evidence-viewer` | Immutable sealed Buy evidence (recorded session only) | Complete, partial, unresolved, and unavailable projections; no live ERP refresh or mutation. |
|
|
213
|
+
|
|
214
|
+
### Navigation and active context
|
|
215
|
+
|
|
216
|
+
Viewers progressively select the best interaction supported by the host:
|
|
217
|
+
|
|
218
|
+
- `serverTools` opens typed list, record, and chart targets inside the current
|
|
219
|
+
viewer through `app.callServerTool()`. Back and breadcrumb navigation restore
|
|
220
|
+
the state of each level.
|
|
221
|
+
- `downloadFile` lets the host confirm and save an attachment returned as a
|
|
222
|
+
bounded embedded resource. The viewer never opens an ERPNext file URL
|
|
223
|
+
directly.
|
|
224
|
+
- `updateModelContext` lets chart, KPI, and funnel selections join a bounded
|
|
225
|
+
active-context snapshot. The compact context chip keeps up to eight items and
|
|
226
|
+
lets users remove one item or clear them all. The snapshot contains selected
|
|
227
|
+
values, never hidden instructions for the model.
|
|
228
|
+
- `message.text` keeps `app.sendMessage()` as a conversational fallback when
|
|
229
|
+
direct navigation or context replacement is unavailable.
|
|
230
|
+
- Without these capabilities, local inspection remains available and unsupported
|
|
231
|
+
remote actions are omitted.
|
|
232
|
+
- The Buy evidence viewer is recorded-session only. It does not call server
|
|
233
|
+
tools, refresh live documents, or mutate ERP state.
|
|
234
|
+
|
|
235
|
+
The server supplies typed navigation metadata and the exact `_availableTools`
|
|
236
|
+
allowed for each viewer, so category-filtered deployments do not expose tools
|
|
237
|
+
that are not loaded.
|
|
228
238
|
|
|
229
239
|
### Refresh model
|
|
230
240
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
241
|
+
Read-only viewers revalidate on focus and through their refresh control.
|
|
242
|
+
Mutations use an explicit read-only request to fetch committed state; a mutating
|
|
243
|
+
tool is never replayed automatically. Overlapping or stale responses are ignored
|
|
244
|
+
when a newer host payload or mutation has already won. A confirmed document
|
|
245
|
+
change marks every potentially derived snapshot in the current navigation stack
|
|
246
|
+
as stale; each marker is removed only when that surface has actually been read
|
|
247
|
+
again. Separate MCP Apps are not synchronized automatically in the 3.2 beta.
|
|
236
248
|
|
|
237
249
|
### Building UI viewers
|
|
238
250
|
|
|
@@ -242,10 +254,52 @@ npm ci
|
|
|
242
254
|
node build-all.mjs
|
|
243
255
|
```
|
|
244
256
|
|
|
257
|
+
## Buy evidence capture
|
|
258
|
+
|
|
259
|
+
**One** read-only tool and **one** recorded App. They do not purchase, create a
|
|
260
|
+
BOM/RFQ/PO, refresh live documents, replace generic ERP viewers, or qualify a
|
|
261
|
+
live ERPNext instance.
|
|
262
|
+
|
|
263
|
+
- Tool: `erpnext_buy_capture`. Closed DocTypes only (Item, BOM, Item Price,
|
|
264
|
+
Supplier Quotation, Supplier, Price List, UOM, Currency Exchange). Two
|
|
265
|
+
`skipCache` reads must agree on `modified` and the closed projection
|
|
266
|
+
fingerprint. Return is ephemeral canonical JSON + SHA-256 + byte count. The
|
|
267
|
+
caller cannot pass `sourceInstance`, URL, credentials, `capturedAt`, or a
|
|
268
|
+
digest. Digital Thread stores those bytes in its own CAS; this server does not
|
|
269
|
+
keep a second CAS.
|
|
270
|
+
- App: `io.casys.mcp-erpnext.buy-evidence` `3.2.0-beta.1`, resource
|
|
271
|
+
`ui://mcp-erpnext/buy-evidence-viewer` (`text/html;profile=mcp-app`), manifest
|
|
272
|
+
`ui://mcp-erpnext/buy-evidence-manifest` (`application/json`),
|
|
273
|
+
`acceptedActions` = `viewer.session.apply` only. Complete, partial,
|
|
274
|
+
unresolved, and unavailable projections stay labelled. No live DocViewer
|
|
275
|
+
refresh, mutation, or `app.callServerTool`. Session `anchor` is the sealed
|
|
276
|
+
Digital Thread artefact (`provenance.bundleRef`), not a hash of the displayed
|
|
277
|
+
projection.
|
|
278
|
+
- Schemas: `io.casys.mcp-erpnext.buy-source-capture/1.0`,
|
|
279
|
+
`io.casys.mcp-erpnext.buy-recorded-result/1.0` and `/2.0`,
|
|
280
|
+
`io.casys.mcp-erpnext.buy-recorded-session/1.0`.
|
|
281
|
+
- Result `/2.0` carries bounded `excludedLines` metadata for selected lines
|
|
282
|
+
absent from priced `lines`: exact line ID, quantity, unit, and stated reason.
|
|
283
|
+
It carries no amount, currency, or price source; covered subtotals remain
|
|
284
|
+
sealed values and unresolved lines remain visible.
|
|
285
|
+
- The viewer is built with the other MCP Apps
|
|
286
|
+
(`cd src/ui && npm ci && node
|
|
287
|
+
build-all.mjs`). Published JSR/npm artifacts
|
|
288
|
+
include `src/ui/dist/` and the Buy TypeScript module; the HTML resource and
|
|
289
|
+
generated manifest are what a published installation serves.
|
|
290
|
+
|
|
291
|
+
Digital Thread owns configuration/seal (`buy-configuration/1.0`,
|
|
292
|
+
`buy-cost-bundle/1.0`, `buy.capture-configuration-cost@1`,
|
|
293
|
+
`buy.seal-configuration-cost@1`). A qualified
|
|
294
|
+
`commerce.read-erpnext-buy-source@1` binding is required before dispatch.
|
|
295
|
+
|
|
245
296
|
## Tools
|
|
246
297
|
|
|
247
|
-
|
|
248
|
-
click, inline detail, and cross-viewer navigation.
|
|
298
|
+
Record `_list` tools return interactive results via the doclist-viewer with row
|
|
299
|
+
click, inline detail, and cross-viewer navigation. The attachment-specific
|
|
300
|
+
`erpnext_file_list` tool does not render doclist-viewer. Generic and dedicated
|
|
301
|
+
document reads use `doc-viewer`, except Sales Order, Sales Invoice, and
|
|
302
|
+
Quotation, which retain the specialized invoice surface.
|
|
249
303
|
|
|
250
304
|
- **Sales** — Customers, Sales Orders, Invoices, and Quotations with full CRUD,
|
|
251
305
|
Submit, and Cancel.
|
|
@@ -260,27 +314,31 @@ click, inline detail, and cross-viewer navigation.
|
|
|
260
314
|
- **Manufacturing** — BOMs, Work Orders, and Job Cards.
|
|
261
315
|
- **CRM** — Leads, Opportunities, Contacts, and Campaigns.
|
|
262
316
|
- **Assets** — Assets, Movements, Maintenance records, and Categories.
|
|
263
|
-
- **Operations** — Generic CRUD, native assignment,
|
|
264
|
-
deny-by-default Frappe method calls
|
|
265
|
-
`erpnext_method_call`).
|
|
317
|
+
- **Operations** — Generic CRUD, native assignment, attachment listing, upload,
|
|
318
|
+
host-mediated download, and deny-by-default Frappe method calls
|
|
319
|
+
(`erpnext_doc_*`, `erpnext_file_*`, `erpnext_method_call`).
|
|
266
320
|
- **Kanban** — Read-write boards for Task, Opportunity, and Issue with
|
|
267
321
|
drag-and-drop.
|
|
268
322
|
- **Analytics** — Charts (bar, area, treemap, radar, scatter, P&L…), KPIs with
|
|
269
323
|
sparklines, and a sales funnel.
|
|
324
|
+
- **Buy** — Read-only sealed capture of closed commercial documents
|
|
325
|
+
(`erpnext_buy_capture`) and an immutable recorded-session evidence viewer. Not
|
|
326
|
+
a purchase, BOM/RFQ/PO, or live ERP qualification.
|
|
270
327
|
- **Setup** — Company creation and assignable user listing.
|
|
271
328
|
|
|
272
329
|
Full per-tool reference with parameters: [`docs/tools.md`](docs/tools.md).
|
|
273
330
|
|
|
274
331
|
## Environment Variables
|
|
275
332
|
|
|
276
|
-
| Variable
|
|
277
|
-
|
|
|
278
|
-
| `ERPNEXT_URL`
|
|
279
|
-
| `ERPNEXT_API_KEY`
|
|
280
|
-
| `ERPNEXT_API_SECRET`
|
|
281
|
-
| `ERPNEXT_MAX_UPLOAD_BYTES`
|
|
282
|
-
| `
|
|
283
|
-
| `
|
|
333
|
+
| Variable | Required | Description |
|
|
334
|
+
| ---------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------- |
|
|
335
|
+
| `ERPNEXT_URL` | Yes | ERPNext base URL — self-hosted (e.g. `http://localhost:8000`) or cloud (e.g. `https://mycompany.erpnext.com`) |
|
|
336
|
+
| `ERPNEXT_API_KEY` | Yes | API Key from User Settings |
|
|
337
|
+
| `ERPNEXT_API_SECRET` | Yes | API Secret from User Settings |
|
|
338
|
+
| `ERPNEXT_MAX_UPLOAD_BYTES` | No | Maximum decoded file-upload size in bytes (positive integer; default: 10 MiB) |
|
|
339
|
+
| `ERPNEXT_MAX_DOWNLOAD_BYTES` | No | Maximum attachment-download size in bytes (positive integer; default: 10 MiB) |
|
|
340
|
+
| `ERPNEXT_METHOD_ALLOWLIST` | No | Comma-separated exact method paths or `prefix.*`; unset means `erpnext_method_call` denies every method, while `*` allows all |
|
|
341
|
+
| `MCP_MRTR_SIGNING_KEY` | No | Exactly 64 lowercase hex characters; enables signed ambiguous-link elicitation. **Single-instance deployments only** — see below |
|
|
284
342
|
|
|
285
343
|
MRTR is opt-in. Without this key, or when the client does not advertise
|
|
286
344
|
elicitation, ambiguous links keep returning the existing actionable ambiguity
|
|
@@ -317,3 +375,12 @@ started, and [AGENTS.md](AGENTS.md) for the full architecture and conventions.
|
|
|
317
375
|
## License
|
|
318
376
|
|
|
319
377
|
MIT
|
|
378
|
+
|
|
379
|
+
Viewers and Buy result fields use the host locale: English, French, Simplified
|
|
380
|
+
Chinese, Traditional Chinese, Hindi, Bengali, Tamil and Urdu. Chinese script
|
|
381
|
+
tags take precedence over region tags; `zh-TW`, `zh-HK` and `zh-MO` select
|
|
382
|
+
Traditional Chinese when no script is specified. Urdu uses right-to-left
|
|
383
|
+
document direction, and a later host locale change updates the language and
|
|
384
|
+
direction without reloading the viewer. App-level waiting and rejection screens
|
|
385
|
+
retain English labels in this beta; host-context support for those shared
|
|
386
|
+
surface screens remains an upstream MCP View follow-up.
|