@casys/mcp-erpnext 3.0.1 → 3.1.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 CHANGED
@@ -8,12 +8,9 @@ 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
- MCP server for [ERPNext](https://erpnext.com) / Frappe ERP — **124 tools**
12
- across **14 categories**, with **7 interactive UI viewers**.
13
-
14
- Connect any MCP-compatible AI agent (Claude Desktop, Claude Code, VS Code
15
- Copilot, custom) to your ERPNext instance via the
16
- [Model Context Protocol](https://modelcontextprotocol.io).
11
+ Let any MCP-compatible AI agent operate your [ERPNext](https://erpnext.com) /
12
+ Frappe instance documents, workflows, and interactive viewers inside the host
13
+ (Claude Desktop, Claude Code, VS Code Copilot, or custom).
17
14
 
18
15
  Works with **self-hosted** and **ERPNext Cloud** (frappe.cloud) instances.
19
16
 
@@ -75,6 +72,11 @@ See the [CHANGELOG](CHANGELOG.md) for the full release history, or the
75
72
  [latest release](https://github.com/Casys-AI/mcp-erpnext/releases/latest) for
76
73
  the current version's highlights.
77
74
 
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.
79
+
78
80
  ## Documentation
79
81
 
80
82
  Organised by what you are doing, following [Diátaxis](https://diataxis.fr):
@@ -182,72 +184,77 @@ until it exists. See
182
184
  Seven interactive [MCP Apps](https://github.com/modelcontextprotocol/ext-apps)
183
185
  viewers, registered as `ui://mcp-erpnext/{name}`:
184
186
 
185
- | Viewer | Description | Interactive Features |
186
- | ---------------- | ---------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
187
- | `doclist-viewer` | Generic document table with sort, filter, pagination, CSV export | Row click inline detail panel with Submit/Cancel + sendMessage navigation. Chip filters for status columns. Max 6 columns, rest in detail panel. |
188
- | `invoice-viewer` | Sales/Purchase Invoice with parties, items, totals | Item click stock balance + item info panel. Submit/Cancel/Payment actions. sendMessage to payment entries and customer invoices. |
189
- | `stock-viewer` | Stock balance table with color-coded qty badges | Row click → item info + recent movements. sendMessage to stock chart, item details, stock entries. |
190
- | `chart-viewer` | Universal chart renderer (12 types via Recharts) | Click bar/pie/line data points sendMessage drill-down into underlying documents. |
191
- | `kanban-viewer` | Read-write kanban for Task, Opportunity, Issue | Drag-and-drop moves, inline edit (priority, progress, dates), sendMessage to Timesheets/Quotations/Related docs. |
192
- | `kpi-viewer` | Big number card with delta, sparkline, trend | Click number sendMessage to exception list. Click sparkline → trend chart. |
193
- | `funnel-viewer` | Trapezoid sales funnel with conversion rates | Click stage sendMessage to document list at that stage. Stage action buttons. |
194
-
195
- ### Cross-viewer navigation
196
-
197
- Viewers communicate via `app.sendMessage()` clicking a button in one viewer
198
- injects a message into the conversation, which triggers the AI to call the right
199
- tool and open the appropriate viewer.
200
-
201
- The server auto-injects navigation metadata into tool results:
202
-
203
- - `_rowAction` which tool to call when a row is clicked
204
- - `_sendMessageHints` navigation buttons shown in detail panels (e.g.
205
- "Orders", "Invoices")
206
- - `_drillDown` / `_trendDrillDown` sendMessage templates for KPI and chart
207
- click-through
187
+ | Viewer | Description | Interactive Features |
188
+ | ---------------- | ---------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
189
+ | `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. |
191
+ | `stock-viewer` | Stock balance table with color-coded qty badges | Item details, recent movements, stock charts, and stock-entry navigation. |
192
+ | `chart-viewer` | Universal chart renderer (12 types via Recharts) | Exact point/series navigation and active-context selection across simple and composed charts. |
193
+ | `kanban-viewer` | Read-write kanban for Task, Opportunity, Issue | Drag-and-drop, inline editing, serialized saves, and typed related-document navigation. |
194
+ | `kpi-viewer` | Big number card with delta, sparkline, trend | Number and trend navigation with bounded active-context selection. |
195
+ | `funnel-viewer` | Trapezoid sales funnel with conversion rates | Period-aware stage navigation and bounded active-context selection. |
196
+
197
+ ### Navigation and active context
198
+
199
+ Viewers progressively select the best interaction supported by the host:
200
+
201
+ - `serverTools` opens typed list, record, and chart targets inside the current
202
+ viewer through `app.callServerTool()`. Back and breadcrumb navigation restore
203
+ the state of each level.
204
+ - `updateModelContext` lets chart, KPI, and funnel selections join a bounded
205
+ active-context snapshot. The compact context chip keeps up to eight items and
206
+ lets users remove one item or clear them all. The snapshot contains selected
207
+ values, never hidden instructions for the model.
208
+ - `message.text` keeps `app.sendMessage()` as a conversational fallback when
209
+ direct navigation or context replacement is unavailable.
210
+ - Without these capabilities, local inspection remains available and unsupported
211
+ remote actions are omitted.
212
+
213
+ The server supplies typed navigation metadata and the exact `_availableTools`
214
+ allowed for each viewer, so category-filtered deployments do not expose tools
215
+ that are not loaded.
208
216
 
209
217
  ### Refresh model
210
218
 
211
- All viewers carry a `refreshRequest` payload for safe revalidation via
212
- `app.callServerTool()`:
213
-
214
- - `kanban-viewer` revalidates after mutations and on focus
215
- - All other viewers support focus refresh + manual refresh button
219
+ Read-only viewers revalidate on focus and through their refresh control.
220
+ Mutations use an explicit read-only request to fetch committed state; a mutating
221
+ tool is never replayed automatically. Overlapping or stale responses are ignored
222
+ when a newer host payload or mutation has already won.
216
223
 
217
224
  ### Building UI viewers
218
225
 
219
226
  ```bash
220
227
  cd src/ui
221
- npm install
228
+ npm ci
222
229
  node build-all.mjs
223
230
  ```
224
231
 
225
- ## Tools (124)
232
+ ## Tools
226
233
 
227
- 124 tools across 14 categories. Each `_list` tool returns interactive results
228
- via the doclist-viewer with row click, inline detail, and cross-viewer
229
- navigation.
234
+ Each `_list` tool returns interactive results via the doclist-viewer with row
235
+ click, inline detail, and cross-viewer navigation.
230
236
 
231
- - **Sales** (17) — Customers, Sales Orders, Invoices, and Quotations with full
232
- CRUD, Submit, and Cancel.
233
- - **Purchasing** (11) — Suppliers, Purchase Orders, Purchase Invoices, Receipts,
234
- and Supplier Quotations.
235
- - **Inventory** (9) — Items, Stock Balance, Warehouses, and Stock Entries.
236
- - **Accounting** (6) — Chart of Accounts, Journal Entries, and Payment Entries.
237
- - **HR** (12) — Employees, Attendance, Leave Applications, Salary Slips, Payroll
237
+ - **Sales** — Customers, Sales Orders, Invoices, and Quotations with full CRUD,
238
+ Submit, and Cancel.
239
+ - **Purchasing** — Suppliers, Purchase Orders, Purchase Invoices, Receipts, and
240
+ Supplier Quotations.
241
+ - **Inventory** — Items, Stock Balance, Warehouses, and Stock Entries.
242
+ - **Accounting** — Chart of Accounts, Journal Entries, and Payment Entries.
243
+ - **HR** — Employees, Attendance, Leave Applications, Salary Slips, Payroll
238
244
  Entries, and Expense Claims.
239
- - **Project** (9) — Projects, Tasks (with native assignment), and Timesheets.
240
- - **Delivery** (5) — Delivery Notes and Shipments.
241
- - **Manufacturing** (7) — BOMs, Work Orders, and Job Cards.
242
- - **CRM** (8) — Leads, Opportunities, Contacts, and Campaigns.
243
- - **Assets** (8) — Assets, Movements, Maintenance records, and Categories.
244
- - **Operations** (10) — Generic CRUD, native assignment, and file upload for any
245
- DocType (`erpnext_doc_*`, `erpnext_file_upload`).
246
- - **Kanban** (2) — Read-write boards for Task, Opportunity, and Issue with
245
+ - **Project** — Projects, Tasks (with native assignment), and Timesheets.
246
+ - **Delivery** — Delivery Notes and Shipments.
247
+ - **Manufacturing** — BOMs, Work Orders, and Job Cards.
248
+ - **CRM** — Leads, Opportunities, Contacts, and Campaigns.
249
+ - **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`).
253
+ - **Kanban** — Read-write boards for Task, Opportunity, and Issue with
247
254
  drag-and-drop.
248
- - **Analytics** (17) 11 analytics charts (bar, area, treemap, radar, scatter,
249
- P&L…), 5 KPIs with sparklines, and a sales funnel.
250
- - **Setup** (3) — Company creation and assignable user listing.
255
+ - **Analytics** — Charts (bar, area, treemap, radar, scatter, P&L…), KPIs with
256
+ sparklines, and a sales funnel.
257
+ - **Setup** — Company creation and assignable user listing.
251
258
 
252
259
  Full per-tool reference with parameters: [`docs/tools.md`](docs/tools.md).
253
260