@runsec/mcp 1.0.2 → 1.0.5

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/dist/index.js +8 -11
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -40,17 +40,14 @@ var import_js_yaml = __toESM(require("js-yaml"));
40
40
  var cachedDataDirectory = null;
41
41
  function getDataDirectory() {
42
42
  if (cachedDataDirectory) return cachedDataDirectory;
43
- const prodPath = import_node_path.default.join(__dirname, "data");
44
- const fallbackPath = import_node_path.default.join(__dirname, "..", "src", "rules", "data");
45
- if (import_node_fs.default.existsSync(prodPath) && import_node_fs.default.statSync(prodPath).isDirectory()) {
46
- cachedDataDirectory = import_node_path.default.resolve(prodPath);
43
+ const dataPath = import_node_path.default.join(__dirname, "data");
44
+ if (import_node_fs.default.existsSync(dataPath) && import_node_fs.default.statSync(dataPath).isDirectory()) {
45
+ cachedDataDirectory = import_node_path.default.resolve(dataPath);
47
46
  return cachedDataDirectory;
48
47
  }
49
- if (import_node_fs.default.existsSync(fallbackPath) && import_node_fs.default.statSync(fallbackPath).isDirectory()) {
50
- cachedDataDirectory = import_node_path.default.resolve(fallbackPath);
51
- return cachedDataDirectory;
52
- }
53
- throw new Error(`Cannot find rules data directory. Looked in: ${prodPath}, ${fallbackPath}`);
48
+ const errorMsg = `Data directory not found. Checked: ${dataPath} (__dirname=${__dirname})`;
49
+ console.error(errorMsg);
50
+ throw new Error(errorMsg);
54
51
  }
55
52
  var PCI_CWE = /* @__PURE__ */ new Set(["CWE-798", "CWE-327", "CWE-256", "CWE-89", "CWE-79", "CWE-22", "CWE-287", "CWE-285", "CWE-522"]);
56
53
  var SOC2_CWE = /* @__PURE__ */ new Set(["CWE-285", "CWE-306", "CWE-287", "CWE-863", "CWE-16", "CWE-200", "CWE-862"]);
@@ -208,7 +205,7 @@ function validateRules() {
208
205
  };
209
206
  Object.keys(RULES_REGISTRY).forEach((standard) => {
210
207
  const count = RULES_REGISTRY[standard].length;
211
- console.log(`Loaded ${count} rules for ${standard}`);
208
+ console.error(`Loaded ${count} rules for ${standard}`);
212
209
  if (count <= 0) {
213
210
  throw new Error(`Rules pack for ${standard} is empty`);
214
211
  }
@@ -585,7 +582,7 @@ server.setRequestHandler(import_types.CallToolRequestSchema, async (request) =>
585
582
  });
586
583
  async function main() {
587
584
  const summary = validateRules();
588
- console.log("Rules registry validated:", summary);
585
+ console.error("Rules registry validated:", summary);
589
586
  const transport = new import_stdio.StdioServerTransport();
590
587
  await server.connect(transport);
591
588
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runsec/mcp",
3
- "version": "1.0.2",
3
+ "version": "1.0.5",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist",