@casys/mcp-erpnext 3.2.2 → 3.3.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 CHANGED
@@ -10,13 +10,16 @@ English | [繁體中文](README.zh-TW.md)
10
10
  [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
11
11
 
12
12
  > [!IMPORTANT]
13
- > **Installing 3.2:** for npm/Node use `npx -y @casys/mcp-erpnext@latest`; for
14
- > Deno use `deno run -A jsr:@casys/mcp-erpnext@3.2.2/server`. 3.2.2 is the
13
+ > **Installing 3.3:** for npm/Node use `npx -y @casys/mcp-erpnext@latest`; for
14
+ > Deno use `deno run -A jsr:@casys/mcp-erpnext@3.3.0/server`. 3.3.0 is the
15
15
  > stable release and carries npm's `latest` tag; prereleases, when published,
16
- > use the `next` tag. 3.2 adds the generic document viewer and attachment
17
- > workflows, so test it with the MCP host your users actually run before
18
- > replacing an existing deployment. See the [CHANGELOG](CHANGELOG.md) for
19
- > release history.
16
+ > use the `next` tag. 3.3 adds graduated selection to the active context: list
17
+ > checkboxes, select-all over the filtered rows, Shift-click ranges and
18
+ > Ctrl/Cmd-click toggles, compact records for one to three selections,
19
+ > references up to eight and a single `erpnext_doc_list` query item beyond.
20
+ > Chart clicks snap to the nearest point in their column. Test it with the MCP
21
+ > host your users actually run before replacing an existing deployment. See the
22
+ > [CHANGELOG](CHANGELOG.md) for release history.
20
23
 
21
24
  Let any MCP-compatible AI agent operate your [ERPNext](https://erpnext.com) /
22
25
  Frappe instance — documents, workflows, and interactive viewers inside the host
@@ -96,7 +99,7 @@ stable 3.0.5 and 3.1.0 releases. Features remain capability-gated by the MCP
96
99
  host; Buy evidence does not purchase or qualify a live ERP.
97
100
 
98
101
  For stable npm installations use `@casys/mcp-erpnext@latest`; for Deno use
99
- `jsr:@casys/mcp-erpnext@3.2.2/server`.
102
+ `jsr:@casys/mcp-erpnext@3.3.0/server`.
100
103
 
101
104
  See the [CHANGELOG](CHANGELOG.md) for the full release history, or the
102
105
  [latest release](https://github.com/Casys-AI/mcp-erpnext/releases/latest) for
package/mcp-erpnext.mjs CHANGED
@@ -42720,6 +42720,7 @@ var FrappeClient = class {
42720
42720
  async requestOnce(method, path, body, multipart = false, signal) {
42721
42721
  const controller = new AbortController();
42722
42722
  const detach = relayAbort(signal, controller);
42723
+ const timer = setTimeout(() => controller.abort(), this.timeoutMs);
42723
42724
  try {
42724
42725
  return await this.sendOnce(
42725
42726
  method,
@@ -42730,12 +42731,12 @@ var FrappeClient = class {
42730
42731
  signal
42731
42732
  );
42732
42733
  } finally {
42734
+ clearTimeout(timer);
42733
42735
  detach();
42734
42736
  }
42735
42737
  }
42736
42738
  async sendOnce(method, path, body, multipart, controller, callerSignal) {
42737
42739
  const url2 = `${this.baseUrl}${path}`;
42738
- const timer = setTimeout(() => controller.abort(), this.timeoutMs);
42739
42740
  let response;
42740
42741
  try {
42741
42742
  response = await fetch(url2, {
@@ -42745,7 +42746,6 @@ var FrappeClient = class {
42745
42746
  signal: controller.signal
42746
42747
  });
42747
42748
  } catch (err) {
42748
- clearTimeout(timer);
42749
42749
  if (err instanceof Error && err.name === "AbortError") {
42750
42750
  if (callerSignal?.aborted) throw callerAbortError(method, path);
42751
42751
  throw new FrappeAPIError(
@@ -42760,12 +42760,18 @@ var FrappeClient = class {
42760
42760
  null
42761
42761
  );
42762
42762
  }
42763
- clearTimeout(timer);
42764
42763
  let rawText;
42765
42764
  try {
42766
42765
  rawText = await response.text();
42767
42766
  } catch (err) {
42768
42767
  if (callerSignal?.aborted) throw callerAbortError(method, path);
42768
+ if (err instanceof Error && err.name === "AbortError") {
42769
+ throw new FrappeAPIError(
42770
+ `Request timed out after ${this.timeoutMs}ms: ${method} ${path}`,
42771
+ 408,
42772
+ null
42773
+ );
42774
+ }
42769
42775
  throw err;
42770
42776
  }
42771
42777
  const contentType = response.headers.get("content-type") ?? "";
@@ -44473,6 +44479,9 @@ var salesTools = [
44473
44479
  }
44474
44480
  ];
44475
44481
 
44482
+ // src/ui/doc-list-defaults.ts
44483
+ var DOC_LIST_DEFAULT_LIMIT = 20;
44484
+
44476
44485
  // src/tools/errors.ts
44477
44486
  var ToolInputError = class extends Error {
44478
44487
  tool;
@@ -44506,7 +44515,6 @@ function formatToolInputError(tool, code, detail, recovery) {
44506
44515
  }
44507
44516
 
44508
44517
  // src/tools/doc-list-query.ts
44509
- var DOC_LIST_DEFAULT_LIMIT = 20;
44510
44518
  var DEFAULT_ORDER_BY = "modified desc";
44511
44519
  var FILTER_FORMS = "[fieldname, operator, value] or [child doctype, fieldname, operator, value]";
44512
44520
  var FRAPPE_FILTERS_INPUT_SCHEMA = {
@@ -54854,7 +54862,7 @@ var VIEWER_TOOL_CANDIDATES = {
54854
54862
  "erpnext_file_upload",
54855
54863
  "erpnext_file_download"
54856
54864
  ],
54857
- "ui://mcp-erpnext/doclist-viewer": [],
54865
+ "ui://mcp-erpnext/doclist-viewer": ["erpnext_doc_list"],
54858
54866
  "ui://mcp-erpnext/doc-viewer": [
54859
54867
  "erpnext_file_list",
54860
54868
  "erpnext_file_upload",
@@ -56140,6 +56148,9 @@ function loadMrtrConfig() {
56140
56148
  return { signingKey };
56141
56149
  }
56142
56150
 
56151
+ // src/server-instructions.ts
56152
+ var ACTIVE_CONTEXT_INSTRUCTIONS = 'User selections in ERPNext viewers are shared as model context on compatible hosts with schema "casys.erpnext/active-context", version 3, and an items array of {id, view, label, value?, fields?, query?}. This context identifies the documents and values the user is referring to. Document selections have IDs of the form record:<doctype>:<name>. Their <name> component is accepted as the name argument by the matching *_get tool; erpnext_doc_get accepts <doctype> and <name> as separate arguments. Child-row selections add :row:<table>:<row> to the document ID. fields holds a compact record. A query item represents selected rows: call query.tool with query.args to read them. truncated: true means only the first includedCount of selectedCount rows are listed.';
56153
+
56143
56154
  // server.ts
56144
56155
  var DEFAULT_HTTP_PORT = 3012;
56145
56156
  function registerBuyViewAppManifest(server) {
@@ -56201,7 +56212,8 @@ async function main() {
56201
56212
  assertNonEmptySelection(toolsClient.selection);
56202
56213
  const server = new McpApp({
56203
56214
  name: "mcp-erpnext",
56204
- version: "3.2.2",
56215
+ version: "3.3.0",
56216
+ instructions: ACTIVE_CONTEXT_INSTRUCTIONS,
56205
56217
  transport: "stateless",
56206
56218
  cache: {
56207
56219
  ttlMs: 36e5,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@casys/mcp-erpnext",
3
- "version": "3.2.2",
3
+ "version": "3.3.0",
4
4
  "description": "MCP server for ERPNext with interactive UI viewers",
5
5
  "type": "module",
6
6
  "bin": {