@lintsure/mcp 0.3.3 → 0.3.4
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 +56 -13
- package/package.json +3 -5
package/dist/src/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// Lintsure MCP server over stdio. Works with any MCP client (Claude Code, Cursor, Codex,
|
|
2
|
+
// Lintsure MCP server over stdio. Works with any MCP client (Claude Code, Cursor, Codex, Devin Desktop).
|
|
3
3
|
// Read-only: it never writes files. The Fixer's suggestions come back as text for your agent to apply.
|
|
4
4
|
// Every response carries the disclaimer, and the server tells the calling agent how to talk about results.
|
|
5
5
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
@@ -7,14 +7,17 @@ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
|
|
|
7
7
|
import { resolve } from "node:path";
|
|
8
8
|
import { z } from "zod";
|
|
9
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.3.
|
|
10
|
+
const server = new McpServer({ name: "lintsure", version: "0.3.4" }, { instructions: AGENT_GUIDANCE });
|
|
11
11
|
// Every tool only reads. Clients can show this; none of them may treat a Lintsure tool as making changes.
|
|
12
12
|
const RO = { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false };
|
|
13
13
|
const fw = z.array(z.enum(ALL_FRAMEWORKS)).optional()
|
|
14
|
-
.describe("Frameworks to check.
|
|
14
|
+
.describe("Frameworks to check, for example [\"gdpr\", \"owasp-top10\"]. Leave out to use lintsure.config.yaml in the repo, or all six if there is none.");
|
|
15
15
|
// Every answer ends with the same disclaimer, so no tool output can be read as a verdict.
|
|
16
16
|
const reply = (...texts) => ({ content: [...texts, `---\n${DISCLAIMER}`].map((text) => ({ type: "text", text })) });
|
|
17
|
-
server.tool("scan", "
|
|
17
|
+
server.tool("scan", "Scan a repository's source code for compliance and security gaps against the chosen frameworks. Use when the user asks things like 'is this ready to ship?', 'are we GDPR ready?' or 'check this repo for security issues'. Returns a Markdown report and the same data as JSON: each finding with file, line, status (Gap or Partial), the controls it relates to, a suggested fix and a proposal the user must approve, plus work that can't be checked in code. Read-only: it never changes files. Call classify first if you don't know which frameworks apply. Results are for a person to review, never a pass, certification or decision.", {
|
|
18
|
+
path: z.string().default(".").describe("Folder to scan, absolute or relative to where the server runs. Example: \".\" for the current project, or \"apps/web\"."),
|
|
19
|
+
frameworks: fw,
|
|
20
|
+
}, RO, async ({ path, frameworks }) => {
|
|
18
21
|
const root = resolve(path);
|
|
19
22
|
const cfg = (await readConfig(root)).frameworks;
|
|
20
23
|
const why = frameworks ? "Chosen by the user through their coding agent." : cfg ? "Listed in lintsure.config.yaml." : undefined;
|
|
@@ -22,26 +25,66 @@ server.tool("scan", "Check a repo's code for compliance gaps. Returns findings w
|
|
|
22
25
|
const steps = nextSteps(report).map((s, i) => `${i + 1}. ${s}`).join("\n");
|
|
23
26
|
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}`);
|
|
24
27
|
});
|
|
25
|
-
server.tool("explain_rule", "Explain
|
|
28
|
+
server.tool("explain_rule", "Explain one Lintsure rule in plain words: what it looks for, which framework controls it relates to (for example GDPR Art. 32 or OWASP A05), why it matters and how to fix it. Use after scan, when the user asks about a finding ('what does pii.logged mean?', 'why is this a problem?'). Returns text; read-only.", { ruleId: z.string().describe("The rule id shown on a scan finding. Examples: \"pii.logged\" (personal data in logs), \"secret.in-source\", \"supabase.rls-disabled\". The full list is at lintsure.com/rules.") }, RO, async ({ ruleId }) => {
|
|
26
29
|
const r = rules.find((x) => x.id === 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}.`);
|
|
30
|
+
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}. Rule ids look like "pii.logged"; see lintsure.com/rules.`);
|
|
28
31
|
});
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
// One list of questions: it describes the inputs and is what the agent asks when it has no answers yet.
|
|
33
|
+
const QUESTIONS = {
|
|
34
|
+
euUsers: "Do you have users or customers in the EU?",
|
|
35
|
+
personalData: "Do you store or process data about people (names, emails, addresses, IP addresses)?",
|
|
36
|
+
specialCategoryData: "Any sensitive data, such as health, biometrics, ethnicity, religion, politics, sexual orientation or union membership?",
|
|
37
|
+
usesAI: "Does any feature use an AI model, including third-party ones like OpenAI or Gemini?",
|
|
38
|
+
generativeAI: "Does the AI create text, images, audio or video that people see?",
|
|
39
|
+
interactsWithPeople: "Do people talk or chat with the AI directly, for example a chatbot or voice assistant?",
|
|
40
|
+
decisionArea: "Does the AI help decide something important about people? If so, which area (for example \"employment\" for screening job applicants, \"credit\" for loan scoring), otherwise \"none\".",
|
|
41
|
+
b2bCustomers: "Do you sell to businesses, whose security teams may ask for SOC 2 or ISO 27001?",
|
|
42
|
+
wantsCertification: "Do customers or partners ask for a security certificate or report, such as ISO 27001 or a SOC 2 report?",
|
|
43
|
+
digitalProductEU: "Do you sell or supply software, an app or a connected device in the EU as a business?",
|
|
44
|
+
mobileApp: "Do you have a mobile app (iOS, Android, React Native, Expo or Flutter)?",
|
|
45
|
+
healthDataUS: "Do you handle health information for US patients, as a healthcare provider or for one (business associate)?",
|
|
46
|
+
governmentCustomers: "Do you sell software to US government agencies or their suppliers?",
|
|
47
|
+
euConsumers: "Do you sell to consumers in the EU, for example an online shop, banking, travel booking, e-books or a messaging service?",
|
|
48
|
+
cardPayments: "Do you take card payments?",
|
|
49
|
+
usMarket: "Do you sell in the United States?",
|
|
50
|
+
};
|
|
51
|
+
const yes = (k) => z.boolean().optional().describe(`${QUESTIONS[k]} True or false; leave out if unknown.`);
|
|
52
|
+
server.tool("classify", "Suggest which compliance frameworks may apply to a product, with a short reason for each, from a few yes/no answers about it. Use when the user asks 'which rules apply to us?' or before a first scan. Call it with no answers to get the questions to ask the user; then call it again with what you know and leave the rest out. Returns a list of frameworks to confirm with the user before running scan. Suggestions only: the user decides, ideally with a compliance professional. Read-only.", {
|
|
53
|
+
euUsers: yes("euUsers"),
|
|
54
|
+
personalData: yes("personalData"),
|
|
55
|
+
specialCategoryData: yes("specialCategoryData"),
|
|
56
|
+
usesAI: yes("usesAI"),
|
|
57
|
+
generativeAI: yes("generativeAI"),
|
|
58
|
+
interactsWithPeople: yes("interactsWithPeople"),
|
|
59
|
+
decisionArea: z.enum(["none", "credit", "employment", "education", "essential-services", "insurance", "biometrics", "law-enforcement", "migration", "justice", "critical-infrastructure"]).optional()
|
|
60
|
+
.describe(QUESTIONS.decisionArea),
|
|
61
|
+
b2bCustomers: yes("b2bCustomers"),
|
|
62
|
+
wantsCertification: yes("wantsCertification"),
|
|
63
|
+
digitalProductEU: yes("digitalProductEU"),
|
|
64
|
+
mobileApp: yes("mobileApp"),
|
|
65
|
+
healthDataUS: yes("healthDataUS"),
|
|
66
|
+
governmentCustomers: yes("governmentCustomers"),
|
|
67
|
+
euConsumers: yes("euConsumers"),
|
|
68
|
+
cardPayments: yes("cardPayments"),
|
|
69
|
+
usMarket: yes("usMarket"),
|
|
34
70
|
}, RO, async (profile) => {
|
|
71
|
+
// No answers yet: hand back the questions, so the agent asks the user instead of guessing.
|
|
72
|
+
if (!Object.values(profile).some((v) => v !== undefined))
|
|
73
|
+
return reply([
|
|
74
|
+
"Ask the user these questions, then call classify again with their answers (leave out anything they don't know):",
|
|
75
|
+
...Object.entries(QUESTIONS).map(([k, q]) => `- ${k}: ${q}`),
|
|
76
|
+
].join("\n"));
|
|
35
77
|
const s = classify(profile);
|
|
36
78
|
return reply(s.length
|
|
37
79
|
? `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.`
|
|
38
80
|
: "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.");
|
|
39
81
|
});
|
|
40
|
-
server.tool("explain_framework", "Explain a framework in plain words: who it applies to, key dates, what it asks,
|
|
82
|
+
server.tool("explain_framework", "Explain a compliance framework in plain words: what it is, who it applies to, key dates (marked as already applying or upcoming), what it asks for, which parts Lintsure can check in code and which need work outside code. Use when the user asks 'what is the EU AI Act?', 'does the Cyber Resilience Act apply to us?', 'when does it apply?' or 'what does SOC 2 need from our code?', often before a scan. Returns text; read-only.", { framework: z.enum(ALL_FRAMEWORKS).describe("Which framework to explain: \"eu-ai-act\", \"gdpr\", \"owasp-top10\", \"cra\" (EU Cyber Resilience Act), \"owasp-llm\" or \"cwe-top25\". Rule packs installed with Lintsure add more.") }, RO, async ({ framework }) => {
|
|
41
83
|
const k = getKnowledge(framework);
|
|
84
|
+
const today = new Date().toISOString().slice(0, 10);
|
|
42
85
|
return reply([
|
|
43
86
|
`# ${k.name}`, k.summary, "", `Applies to: ${k.whoItAppliesTo}`,
|
|
44
|
-
...(k.timeline ? ["", "Key dates:", ...k.timeline.map((m) => `- ${m.date}: ${m.what}`)] : []),
|
|
87
|
+
...(k.timeline ? ["", "Key dates:", ...k.timeline.map((m) => `- ${m.date} (${m.date <= today ? "already applies" : "upcoming"}): ${m.what}`)] : []),
|
|
45
88
|
"", "What it asks:", ...k.obligations.map((o) => `- ${o.ref} ${o.title} [${o.inCode === "yes" ? "checked in code" : o.inCode === "partly" ? "partly in code" : "outside code"}]: ${o.plain}`),
|
|
46
89
|
"", "Watch out:", ...k.watchOut.map((w) => `- ${w}`),
|
|
47
90
|
"", `Summary in our own words, checked on ${k.checkedOn}. Read the official text for anything you rely on.`,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lintsure/mcp",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4",
|
|
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.3.
|
|
17
|
+
"@lintsure/core": "0.3.4",
|
|
18
18
|
"@modelcontextprotocol/sdk": "^1.12.0",
|
|
19
19
|
"zod": "^4.6.7"
|
|
20
20
|
},
|
|
@@ -36,9 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"keywords": [
|
|
38
38
|
"compliance",
|
|
39
|
-
"gdpr",
|
|
40
|
-
"soc2",
|
|
41
|
-
"iso27001",
|
|
39
|
+
"gdpr",
|
|
42
40
|
"eu-ai-act",
|
|
43
41
|
"mcp",
|
|
44
42
|
"static-analysis",
|