@casys/mcp-erpnext 0.1.8 → 0.2.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.
- package/README.md +44 -12
- package/mcp-erpnext.mjs +1743 -509
- package/package.json +19 -5
- package/ui-dist/chart-viewer/index.html +217 -0
- package/ui-dist/doclist-viewer/index.html +152 -0
- package/ui-dist/funnel-viewer/index.html +150 -0
- package/ui-dist/invoice-viewer/index.html +150 -0
- package/ui-dist/kanban-viewer/index.html +150 -0
- package/ui-dist/kpi-viewer/index.html +150 -0
- package/ui-dist/stock-viewer/index.html +150 -0
package/README.md
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
# @casys/mcp-erpnext
|
|
2
2
|
|
|
3
|
-
MCP server for [ERPNext](https://erpnext.com) / Frappe ERP — **120 tools** across **
|
|
3
|
+
MCP server for [ERPNext](https://erpnext.com) / Frappe ERP — **120 tools** across **14 categories**, with **7 interactive UI viewers**.
|
|
4
4
|
|
|
5
5
|
Connect any MCP-compatible AI agent (Claude Desktop, PML, custom) to your ERPNext instance via the standard [Model Context Protocol](https://modelcontextprotocol.io).
|
|
6
6
|
|
|
7
|
+
## Current Surface
|
|
8
|
+
|
|
9
|
+
- `kanban-viewer` is the canonical read-write MCP App viewer
|
|
10
|
+
- kanban is live for `Task`, `Opportunity`, and `Issue`
|
|
11
|
+
- `doclist-viewer`, `stock-viewer`, `invoice-viewer`, `chart-viewer`, `kpi-viewer`, and `funnel-viewer` are refresh-aware MCP Apps
|
|
12
|
+
- `order-pipeline-viewer` and the legacy order/purchase pipeline tools have been removed
|
|
13
|
+
|
|
7
14
|
## Quick Start
|
|
8
15
|
|
|
9
16
|
### Prerequisites
|
|
@@ -247,14 +254,21 @@ These tools work with **any** ERPNext DocType:
|
|
|
247
254
|
| `erpnext_doc_submit` | Submit | Any submittable document |
|
|
248
255
|
| `erpnext_doc_cancel` | Cancel | Any submitted document |
|
|
249
256
|
|
|
250
|
-
###
|
|
257
|
+
### Kanban (2)
|
|
258
|
+
|
|
259
|
+
Tools that power the canonical read-write kanban MCP App.
|
|
260
|
+
|
|
261
|
+
| Tool | Viewer | Description |
|
|
262
|
+
|------|--------|-------------|
|
|
263
|
+
| `erpnext_kanban_get_board` | `kanban-viewer` | Get a normalized kanban board for `Task`, `Opportunity`, or `Issue` |
|
|
264
|
+
| `erpnext_kanban_move_card` | `kanban-viewer` | Execute a validated card move and return reconciliation data / business errors |
|
|
265
|
+
|
|
266
|
+
### Analytics (17)
|
|
251
267
|
|
|
252
|
-
Tools that return shaped data for chart,
|
|
268
|
+
Tools that return shaped data for chart, KPI, and funnel viewers.
|
|
253
269
|
|
|
254
270
|
| Tool | Viewer | Description |
|
|
255
271
|
|------|--------|-------------|
|
|
256
|
-
| `erpnext_order_pipeline` | order-pipeline-viewer | Sales orders kanban by status |
|
|
257
|
-
| `erpnext_purchase_pipeline` | order-pipeline-viewer | Purchase orders kanban by status |
|
|
258
272
|
| `erpnext_stock_chart` | chart-viewer | Bar chart of stock levels by item/warehouse |
|
|
259
273
|
| `erpnext_sales_chart` | chart-viewer | Revenue by customer, item, or status (bar/donut) |
|
|
260
274
|
| `erpnext_revenue_trend` | chart-viewer | Monthly revenue trend (line/area, per customer) |
|
|
@@ -275,7 +289,7 @@ Tools that return shaped data for chart, pipeline, KPI, and funnel viewers.
|
|
|
275
289
|
|
|
276
290
|
## UI Viewers
|
|
277
291
|
|
|
278
|
-
Seven interactive [MCP Apps](https://github.com/
|
|
292
|
+
Seven interactive [MCP Apps](https://github.com/modelcontextprotocol/ext-apps) viewers, registered as `ui://mcp-erpnext/{name}`:
|
|
279
293
|
|
|
280
294
|
| Viewer | Description |
|
|
281
295
|
|--------|-------------|
|
|
@@ -283,10 +297,21 @@ Seven interactive [MCP Apps](https://github.com/anthropics/mcp-apps-sdk) viewers
|
|
|
283
297
|
| `invoice-viewer` | Single invoice display (header, items, totals, payment status) |
|
|
284
298
|
| `stock-viewer` | Stock balance table with color-coded qty badges |
|
|
285
299
|
| `chart-viewer` | Universal chart renderer (12 chart types via Recharts) |
|
|
286
|
-
| `
|
|
300
|
+
| `kanban-viewer` | Canonical read-write kanban board with optimistic updates, AX, and server reconciliation |
|
|
287
301
|
| `kpi-viewer` | Single metric card with delta, sparkline, trend indicator |
|
|
288
302
|
| `funnel-viewer` | Trapezoid sales funnel with conversion rates between stages |
|
|
289
303
|
|
|
304
|
+
### Why not native ERPNext kanban?
|
|
305
|
+
|
|
306
|
+
`kanban-viewer` exists because the user is already inside an MCP host conversation. Instead of sending them back into the ERPNext web app, the viewer keeps the context in-chat, reads through MCP tools, and writes back through `app.callServerTool()` with the server as source of truth.
|
|
307
|
+
|
|
308
|
+
### Refresh model
|
|
309
|
+
|
|
310
|
+
Interactive and long-lived viewers carry their own `refreshRequest` payload so they can safely revalidate through MCP without depending on host-provided `tool-input` echoes.
|
|
311
|
+
|
|
312
|
+
- `kanban-viewer` revalidates after successful mutations and refreshes on focus
|
|
313
|
+
- `doclist-viewer`, `stock-viewer`, `invoice-viewer`, `chart-viewer`, `kpi-viewer`, and `funnel-viewer` support focus refresh plus a manual fallback refresh action
|
|
314
|
+
|
|
290
315
|
### Building UI viewers
|
|
291
316
|
|
|
292
317
|
```bash
|
|
@@ -304,9 +329,8 @@ To rebuild for npm from source:
|
|
|
304
329
|
```bash
|
|
305
330
|
cd lib/erpnext
|
|
306
331
|
deno task ui:build # Build UI viewers
|
|
307
|
-
./scripts/build-node.sh # Generate dist-node/
|
|
308
|
-
cd dist-node &&
|
|
309
|
-
cd bin && npm publish --access public
|
|
332
|
+
./scripts/build-node.sh # Generate dist-node/ and a publishable dist-node/bin/
|
|
333
|
+
cd dist-node/bin && npm publish --access public
|
|
310
334
|
```
|
|
311
335
|
|
|
312
336
|
## Environment Variables
|
|
@@ -329,6 +353,10 @@ src/
|
|
|
329
353
|
api/
|
|
330
354
|
frappe-client.ts # Frappe REST HTTP client
|
|
331
355
|
types.ts # Type definitions
|
|
356
|
+
kanban/
|
|
357
|
+
adapters/ # Per-DocType kanban adapters
|
|
358
|
+
definitions.ts # V1 board registry
|
|
359
|
+
types.ts # Shared kanban contracts
|
|
332
360
|
tools/
|
|
333
361
|
sales.ts # 17 sales tools
|
|
334
362
|
inventory.ts # 9 inventory tools
|
|
@@ -342,7 +370,8 @@ src/
|
|
|
342
370
|
assets.ts # 8 asset tools
|
|
343
371
|
operations.ts # 7 generic CRUD tools
|
|
344
372
|
setup.ts # 2 company/setup tools
|
|
345
|
-
|
|
373
|
+
kanban.ts # 2 read-write kanban tools
|
|
374
|
+
analytics.ts # 17 analytics tools (charts, KPIs, funnel)
|
|
346
375
|
mod.ts # Registry
|
|
347
376
|
types.ts # Tool interface
|
|
348
377
|
client.ts # ErpNextToolsClient
|
|
@@ -353,11 +382,14 @@ src/
|
|
|
353
382
|
invoice-viewer/ # Invoice display
|
|
354
383
|
stock-viewer/ # Stock balance display
|
|
355
384
|
chart-viewer/ # Universal chart renderer (Recharts)
|
|
356
|
-
|
|
385
|
+
kanban-viewer/ # Canonical read-write kanban
|
|
357
386
|
kpi-viewer/ # Single metric card
|
|
358
387
|
funnel-viewer/ # Sales funnel
|
|
359
388
|
shared/ # Shared theme + branding
|
|
389
|
+
viewers.ts # UI viewer registry
|
|
360
390
|
tests/
|
|
391
|
+
kanban/ # Kanban domain tests
|
|
392
|
+
ui/ # Kanban UI state tests
|
|
361
393
|
docs/
|
|
362
394
|
coverage.md # Full coverage matrix
|
|
363
395
|
ROADMAP.md # Viewer & analytics roadmap
|