@lintsure/mcp 0.1.1 → 0.1.3
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/dist/src/index.js +10 -8
- package/package.json +3 -2
package/dist/src/index.js
CHANGED
|
@@ -6,34 +6,36 @@ 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.
|
|
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.1.3" }, { 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
19
|
const report = await scan(root, frameworks ?? (await readConfig(root)).frameworks ?? ALL_FRAMEWORKS);
|
|
18
20
|
const steps = nextSteps(report).map((s, i) => `${i + 1}. ${s}`).join("\n");
|
|
19
|
-
return reply(toMarkdown(report), JSON.stringify(report),
|
|
21
|
+
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
22
|
});
|
|
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 }) => {
|
|
23
|
+
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
24
|
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}\
|
|
25
|
+
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
26
|
});
|
|
25
27
|
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
28
|
euUsers: z.boolean().optional(), personalData: z.boolean().optional(), specialCategoryData: z.boolean().optional(),
|
|
27
29
|
usesAI: z.boolean().optional(), generativeAI: z.boolean().optional(), interactsWithPeople: z.boolean().optional(),
|
|
28
30
|
decisionArea: z.enum(["none", "credit", "employment", "education", "essential-services", "insurance", "biometrics", "law-enforcement", "migration", "justice", "critical-infrastructure"]).optional(),
|
|
29
31
|
b2bCustomers: z.boolean().optional(), wantsCertification: z.boolean().optional(), usMarket: z.boolean().optional(),
|
|
30
|
-
}, async (profile) => {
|
|
32
|
+
}, RO, async (profile) => {
|
|
31
33
|
const s = classify(profile);
|
|
32
34
|
return reply(s.length
|
|
33
35
|
? `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
36
|
: "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
37
|
});
|
|
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 }) => {
|
|
38
|
+
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
39
|
const k = getKnowledge(framework);
|
|
38
40
|
return reply([
|
|
39
41
|
`# ${k.name}`, k.summary, "", `Applies to: ${k.whoItAppliesTo}`,
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lintsure/mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
|
+
"mcpName": "io.github.lintsure/lintsure",
|
|
4
5
|
"description": "Lintsure MCP server for Claude Code, Cursor, Codex and Windsurf. Readiness checks, not an audit or legal advice.",
|
|
5
6
|
"license": "Apache-2.0",
|
|
6
7
|
"type": "module",
|
|
@@ -13,7 +14,7 @@
|
|
|
13
14
|
"LICENSE"
|
|
14
15
|
],
|
|
15
16
|
"dependencies": {
|
|
16
|
-
"@lintsure/core": "0.1.
|
|
17
|
+
"@lintsure/core": "0.1.3",
|
|
17
18
|
"@modelcontextprotocol/sdk": "^1.12.0",
|
|
18
19
|
"zod": "^3.24.0"
|
|
19
20
|
},
|