@casys/mcp-erpnext 2.4.1 → 2.4.2

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.
Files changed (2) hide show
  1. package/mcp-erpnext.mjs +20 -2
  2. package/package.json +1 -1
package/mcp-erpnext.mjs CHANGED
@@ -3775,6 +3775,7 @@ var require_fast_uri = __commonJS({
3775
3775
  return uriTokens.join("");
3776
3776
  }
3777
3777
  var URI_PARSE = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;
3778
+ var AUTHORITY_PREFIX = /^(?:[^#/:?]+:)?\/\/([^/?#]*)/;
3778
3779
  function getParseError(parsed, matches) {
3779
3780
  if (matches[2] !== void 0 && parsed.path && parsed.path[0] !== "/") {
3780
3781
  return 'URI path must start with "/" when authority is present.';
@@ -3804,6 +3805,11 @@ var require_fast_uri = __commonJS({
3804
3805
  uri = "//" + uri;
3805
3806
  }
3806
3807
  }
3808
+ const authorityMatch = uri.match(AUTHORITY_PREFIX);
3809
+ if (authorityMatch !== null && authorityMatch[1].indexOf("\\") !== -1) {
3810
+ parsed.error = "URI authority must not contain a literal backslash.";
3811
+ malformedAuthorityOrPort = true;
3812
+ }
3807
3813
  const matches = uri.match(URI_PARSE);
3808
3814
  if (matches) {
3809
3815
  parsed.scheme = matches[1];
@@ -29680,6 +29686,12 @@ var parseBody = async (request, options = /* @__PURE__ */ Object.create(null)) =
29680
29686
  return {};
29681
29687
  };
29682
29688
  async function parseFormData(request, options) {
29689
+ if (!isRawRequest(request) && request.bodyCache.formData) {
29690
+ return convertFormDataToBodyData(
29691
+ await request.bodyCache.formData,
29692
+ options
29693
+ );
29694
+ }
29683
29695
  const headers = isRawRequest(request) ? request.headers : request.raw.headers;
29684
29696
  const arrayBuffer = await request.arrayBuffer();
29685
29697
  const formDataPromise = bufferToFormData(arrayBuffer, headers.get("Content-Type") || "");
@@ -45338,13 +45350,13 @@ async function main() {
45338
45350
  const portArg = args.find((arg) => arg.startsWith("--port="));
45339
45351
  const httpPort = portArg ? parseInt(portArg.split("=")[1], 10) : DEFAULT_HTTP_PORT;
45340
45352
  const hostnameArg = args.find((arg) => arg.startsWith("--hostname="));
45341
- const hostname = hostnameArg ? hostnameArg.split("=")[1] : "0.0.0.0";
45353
+ const hostname = hostnameArg ? hostnameArg.split("=")[1] : "127.0.0.1";
45342
45354
  const toolsClient = new ErpNextToolsClient(
45343
45355
  categories ? { categories } : void 0
45344
45356
  );
45345
45357
  const server = new McpApp({
45346
45358
  name: "mcp-erpnext",
45347
- version: "2.4.1",
45359
+ version: "2.4.2",
45348
45360
  maxConcurrent: 10,
45349
45361
  backpressureStrategy: "queue",
45350
45362
  validateSchema: true,
@@ -45390,6 +45402,12 @@ async function main() {
45390
45402
  `[mcp-erpnext] Initialized \u2014 ${toolsClient.count} tools${categories ? ` (categories: ${categories.join(", ")})` : ""}`
45391
45403
  );
45392
45404
  if (httpFlag) {
45405
+ const isLoopback = hostname === "127.0.0.1" || hostname === "::1" || hostname === "localhost";
45406
+ if (!isLoopback) {
45407
+ console.error(
45408
+ `[mcp-erpnext] WARNING: binding to ${hostname} exposes the HTTP server to the network. Every tool acts with the server's ERPNext API key, so restrict access (firewall, private network, or an authenticating reverse proxy).`
45409
+ );
45410
+ }
45393
45411
  await server.startHttp({
45394
45412
  port: httpPort,
45395
45413
  hostname,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@casys/mcp-erpnext",
3
- "version": "2.4.1",
3
+ "version": "2.4.2",
4
4
  "description": "MCP server for ERPNext with interactive UI viewers",
5
5
  "type": "module",
6
6
  "bin": {