@lintsure/mcp 0.1.2 → 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.
Files changed (2) hide show
  1. package/dist/src/index.js +13 -9
  2. package/package.json +2 -2
package/dist/src/index.js CHANGED
@@ -6,34 +6,38 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
6
6
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
7
7
  import { resolve } from "node:path";
8
8
  import { z } from "zod";
9
- import { AGENT_GUIDANCE, ALL_FRAMEWORKS, DISCLAIMER, classify, getKnowledge, nextSteps, readConfig, rules, scan, toMarkdown } from "@lintsure/core";
10
- const server = new McpServer({ name: "lintsure", version: "0.1.2" }, { instructions: AGENT_GUIDANCE });
9
+ import { AGENT_GUIDANCE, APPROVAL_RULES, ALL_FRAMEWORKS, DISCLAIMER, classify, getKnowledge, nextSteps, readConfig, rules, scan, toMarkdown } from "@lintsure/core";
10
+ const server = new McpServer({ name: "lintsure", version: "0.2.0" }, { instructions: AGENT_GUIDANCE });
11
+ // Every tool only reads. Clients can show this; none of them may treat a Lintsure tool as making changes.
12
+ const RO = { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false };
11
13
  const fw = z.array(z.enum(ALL_FRAMEWORKS)).optional()
12
14
  .describe("Frameworks to check. Default: lintsure.config.yaml in the repo, else all available.");
13
15
  // Every answer ends with the same disclaimer, so no tool output can be read as a verdict.
14
16
  const reply = (...texts) => ({ content: [...texts, `---\n${DISCLAIMER}`].map((text) => ({ type: "text", text })) });
15
- server.tool("scan", "Check a repo's code for compliance gaps. Returns findings with file, line, rules broken, fix and auditor note, plus what still needs doing outside code. Results are for a person to review; never present them as a pass, a certification or a decision.", { path: z.string().default(".").describe("Repo path"), frameworks: fw }, async ({ path, frameworks }) => {
17
+ server.tool("scan", "Check a repo's code for compliance gaps. Returns findings with file, line, rules broken, fix and auditor note, plus what still needs doing outside code. Results are for a person to review; never present them as a pass, a certification or a decision.", { path: z.string().default(".").describe("Repo path"), frameworks: fw }, RO, async ({ path, frameworks }) => {
16
18
  const root = resolve(path);
17
- const report = await scan(root, frameworks ?? (await readConfig(root)).frameworks ?? ALL_FRAMEWORKS);
19
+ const cfg = (await readConfig(root)).frameworks;
20
+ const why = frameworks ? "Chosen by the user through their coding agent." : cfg ? "Listed in lintsure.config.yaml." : undefined;
21
+ const report = await scan(root, frameworks ?? cfg ?? ALL_FRAMEWORKS, { why, source: "mcp" });
18
22
  const steps = nextSteps(report).map((s, i) => `${i + 1}. ${s}`).join("\n");
19
- return reply(toMarkdown(report), JSON.stringify(report), `Before acting, ask the user which findings to work on. Next steps for the user:\n${steps}`);
23
+ return reply(toMarkdown(report), JSON.stringify(report), `${APPROVAL_RULES}\n\nEach finding above already has its proposal (where, what, why, benefit). Ask the user which one to work on first.\n\nNext steps for the user:\n${steps}`);
20
24
  });
21
- server.tool("explain_rule", "Explain a Lintsure rule: what it checks, which controls it maps to, and how to fix it.", { ruleId: z.string() }, async ({ ruleId }) => {
25
+ server.tool("explain_rule", "Explain a Lintsure rule: what it checks, which controls it maps to, and how to fix it.", { ruleId: z.string() }, RO, async ({ ruleId }) => {
22
26
  const r = rules.find((x) => x.id === ruleId);
23
- return reply(r ? `${r.title}\nControls: ${r.controls.map((c) => `${c.framework} ${c.id}`).join(", ")}\nSuggested fix: ${r.fix}\nNote: ${r.note}\nShow the change to the user and apply it only after they approve.` : `No rule named ${ruleId}.`);
27
+ return reply(r ? `${r.title}\nControls: ${r.controls.map((c) => `${c.framework} ${c.id}`).join(", ")}\nSuggested fix: ${r.fix}\nNote: ${r.note}\n\n${APPROVAL_RULES}` : `No rule named ${ruleId}.`);
24
28
  });
25
29
  server.tool("classify", "Suggest which frameworks may apply, with a reason for each. These are suggestions only: the user decides, ideally with a compliance professional.", {
26
30
  euUsers: z.boolean().optional(), personalData: z.boolean().optional(), specialCategoryData: z.boolean().optional(),
27
31
  usesAI: z.boolean().optional(), generativeAI: z.boolean().optional(), interactsWithPeople: z.boolean().optional(),
28
32
  decisionArea: z.enum(["none", "credit", "employment", "education", "essential-services", "insurance", "biometrics", "law-enforcement", "migration", "justice", "critical-infrastructure"]).optional(),
29
33
  b2bCustomers: z.boolean().optional(), wantsCertification: z.boolean().optional(), usMarket: z.boolean().optional(),
30
- }, async (profile) => {
34
+ }, RO, async (profile) => {
31
35
  const s = classify(profile);
32
36
  return reply(s.length
33
37
  ? `These frameworks may apply, based on the answers given:\n${s.map((x) => `- ${x.name}: ${x.reason}`).join("\n")}\n\nThis is a suggestion, not a legal determination. Ask the user to confirm the list before running scan.`
34
38
  : "None of the available frameworks clearly apply from these answers. That is not a conclusion that no rules apply; ask the user, or a compliance professional, to confirm.");
35
39
  });
36
- server.tool("explain_framework", "Explain a framework in plain words: who it applies to, key dates, what it asks, and what code can and can't prove.", { framework: z.enum(ALL_FRAMEWORKS) }, async ({ framework }) => {
40
+ server.tool("explain_framework", "Explain a framework in plain words: who it applies to, key dates, what it asks, and what code can and can't prove.", { framework: z.enum(ALL_FRAMEWORKS) }, RO, async ({ framework }) => {
37
41
  const k = getKnowledge(framework);
38
42
  return reply([
39
43
  `# ${k.name}`, k.summary, "", `Applies to: ${k.whoItAppliesTo}`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lintsure/mcp",
3
- "version": "0.1.2",
3
+ "version": "0.2.0",
4
4
  "mcpName": "io.github.lintsure/lintsure",
5
5
  "description": "Lintsure MCP server for Claude Code, Cursor, Codex and Windsurf. Readiness checks, not an audit or legal advice.",
6
6
  "license": "Apache-2.0",
@@ -14,7 +14,7 @@
14
14
  "LICENSE"
15
15
  ],
16
16
  "dependencies": {
17
- "@lintsure/core": "0.1.1",
17
+ "@lintsure/core": "0.2.0",
18
18
  "@modelcontextprotocol/sdk": "^1.12.0",
19
19
  "zod": "^3.24.0"
20
20
  },