@casys/mcp-erpnext 3.0.2 → 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
@@ -72,6 +72,11 @@ See the [CHANGELOG](CHANGELOG.md) for the full release history, or the
72
72
  [latest release](https://github.com/Casys-AI/mcp-erpnext/releases/latest) for
73
73
  the current version's highlights.
74
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
+
75
80
  ## Documentation
76
81
 
77
82
  Organised by what you are doing, following [Diátaxis](https://diataxis.fr):
@@ -179,43 +184,48 @@ until it exists. See
179
184
  Seven interactive [MCP Apps](https://github.com/modelcontextprotocol/ext-apps)
180
185
  viewers, registered as `ui://mcp-erpnext/{name}`:
181
186
 
182
- | Viewer | Description | Interactive Features |
183
- | ---------------- | ---------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
184
- | `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. |
185
- | `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. |
186
- | `stock-viewer` | Stock balance table with color-coded qty badges | Row click → item info + recent movements. sendMessage to stock chart, item details, stock entries. |
187
- | `chart-viewer` | Universal chart renderer (12 types via Recharts) | Click bar/pie/line data points sendMessage drill-down into underlying documents. |
188
- | `kanban-viewer` | Read-write kanban for Task, Opportunity, Issue | Drag-and-drop moves, inline edit (priority, progress, dates), sendMessage to Timesheets/Quotations/Related docs. |
189
- | `kpi-viewer` | Big number card with delta, sparkline, trend | Click number sendMessage to exception list. Click sparkline → trend chart. |
190
- | `funnel-viewer` | Trapezoid sales funnel with conversion rates | Click stage sendMessage to document list at that stage. Stage action buttons. |
191
-
192
- ### Cross-viewer navigation
193
-
194
- Viewers communicate via `app.sendMessage()` clicking a button in one viewer
195
- injects a message into the conversation, which triggers the AI to call the right
196
- tool and open the appropriate viewer.
197
-
198
- The server auto-injects navigation metadata into tool results:
199
-
200
- - `_rowAction` which tool to call when a row is clicked
201
- - `_sendMessageHints` navigation buttons shown in detail panels (e.g.
202
- "Orders", "Invoices")
203
- - `_drillDown` / `_trendDrillDown` sendMessage templates for KPI and chart
204
- 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.
205
216
 
206
217
  ### Refresh model
207
218
 
208
- All viewers carry a `refreshRequest` payload for safe revalidation via
209
- `app.callServerTool()`:
210
-
211
- - `kanban-viewer` revalidates after mutations and on focus
212
- - 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.
213
223
 
214
224
  ### Building UI viewers
215
225
 
216
226
  ```bash
217
227
  cd src/ui
218
- npm install
228
+ npm ci
219
229
  node build-all.mjs
220
230
  ```
221
231
 
@@ -237,8 +247,9 @@ click, inline detail, and cross-viewer navigation.
237
247
  - **Manufacturing** — BOMs, Work Orders, and Job Cards.
238
248
  - **CRM** — Leads, Opportunities, Contacts, and Campaigns.
239
249
  - **Assets** — Assets, Movements, Maintenance records, and Categories.
240
- - **Operations** — Generic CRUD, native assignment, and file upload for any
241
- DocType (`erpnext_doc_*`, `erpnext_file_upload`).
250
+ - **Operations** — Generic CRUD, native assignment, and attachment listing or
251
+ upload for any DocType (`erpnext_doc_*`, `erpnext_file_list`,
252
+ `erpnext_file_upload`).
242
253
  - **Kanban** — Read-write boards for Task, Opportunity, and Issue with
243
254
  drag-and-drop.
244
255
  - **Analytics** — Charts (bar, area, treemap, radar, scatter, P&L…), KPIs with