@lintsure/mcp 0.3.9 → 0.3.11
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/README.md +1 -1
- package/dist/src/index.js +22 -6
- package/package.json +51 -51
package/README.md
CHANGED
|
@@ -10,6 +10,6 @@ claude mcp add lintsure -- npx -y @lintsure/mcp
|
|
|
10
10
|
|
|
11
11
|
Then ask your agent: *check this repo for compliance*.
|
|
12
12
|
|
|
13
|
-
Tools: `scan`, `classify`, `explain_framework`, `explain_rule`. Setup for Cursor, Codex and Devin Desktop (formerly Windsurf): https://lintsure.com/docs/mcp
|
|
13
|
+
Tools: `scan`, `plan_checks`, `classify`, `explain_framework`, `explain_rule`. Setup for Cursor, Codex and Devin Desktop (formerly Windsurf): https://lintsure.com/docs/mcp
|
|
14
14
|
|
|
15
15
|
Source: https://github.com/lintsure/lintsure · Apache-2.0
|
package/dist/src/index.js
CHANGED
|
@@ -6,11 +6,12 @@ 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, APPROVAL_RULES, TRIAGE_GUIDE, ALL_FRAMEWORKS, DISCLAIMER, classify, getKnowledge, nextSteps, readConfig, rules, scan, toMarkdown } from "@lintsure/core";
|
|
10
|
-
const server = new McpServer({ name: "lintsure", version: "0.3.
|
|
9
|
+
import { AGENT_GUIDANCE, APPROVAL_RULES, TRIAGE_GUIDE, ALL_FRAMEWORKS, DISCLAIMER, checksFor, classify, getKnowledge, nextSteps, readConfig, rules, scan, toMarkdown } from "@lintsure/core";
|
|
10
|
+
const server = new McpServer({ name: "lintsure", version: "0.3.11" }, { 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
|
+
// Checked in the handler, not a startup enum, so frameworks from a repo's rule packs are accepted too.
|
|
14
|
+
const fw = z.array(z.string()).optional()
|
|
14
15
|
.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
16
|
// Every answer ends with the same disclaimer, so no tool output can be read as a verdict.
|
|
16
17
|
const reply = (...texts) => ({ content: [...texts, `---\n${DISCLAIMER}`].map((text) => ({ type: "text", text })) });
|
|
@@ -25,7 +26,13 @@ server.tool("scan", "Scan a repository's source code for compliance and security
|
|
|
25
26
|
format: z.enum(["summary", "full"]).default("summary").describe("\"summary\" keeps the reply small; \"full\" returns the Markdown report and the JSON."),
|
|
26
27
|
}, RO, async ({ path, frameworks, files, rules: only, status, limit, all, format }) => {
|
|
27
28
|
const root = resolve(path);
|
|
28
|
-
const
|
|
29
|
+
const config = await readConfig(root), cfg = config.frameworks;
|
|
30
|
+
// Same as the CLI: a typo in the config must not quietly widen or narrow the scan.
|
|
31
|
+
if (config.problems.length)
|
|
32
|
+
return { isError: true, content: [{ type: "text", text: `Fix lintsure.config.yaml first, so the scan checks what was meant:\n${config.problems.map((p) => `- ${p}`).join("\n")}` }] };
|
|
33
|
+
const unknown = (frameworks ?? []).filter((f) => !ALL_FRAMEWORKS.includes(f));
|
|
34
|
+
if (unknown.length)
|
|
35
|
+
return { isError: true, content: [{ type: "text", text: `Unknown framework: ${unknown.join(", ")}. Known: ${ALL_FRAMEWORKS.join(", ")}.` }] };
|
|
29
36
|
const why = frameworks ? "Chosen by the user through their coding agent." : cfg ? "Listed in lintsure.config.yaml." : undefined;
|
|
30
37
|
const report = await scan(root, frameworks ?? cfg ?? ALL_FRAMEWORKS, { why, source: "mcp", all });
|
|
31
38
|
const steps = nextSteps(report).map((s, i) => `${i + 1}. ${s}`).join("\n");
|
|
@@ -50,7 +57,7 @@ server.tool("scan", "Scan a repository's source code for compliance and security
|
|
|
50
57
|
});
|
|
51
58
|
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 }) => {
|
|
52
59
|
const r = rules.find((x) => x.id === ruleId);
|
|
53
|
-
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.`);
|
|
60
|
+
return reply(r ? `${r.title}\nControls: ${r.controls.map((c) => `${c.framework} ${c.id}`).join(", ")}\nSuggested fix: ${r.fix}\nNote: ${r.note}${(r.seenIn ?? []).map((s) => `\nSeen in a real incident: ${s.title} (${s.url})`).join("")}\n\n${APPROVAL_RULES}` : `No rule named ${ruleId}. Rule ids look like "pii.logged"; see lintsure.com/rules.`);
|
|
54
61
|
});
|
|
55
62
|
// One list of questions: it describes the inputs and is what the agent asks when it has no answers yet.
|
|
56
63
|
const QUESTIONS = {
|
|
@@ -102,8 +109,17 @@ server.tool("classify", "Suggest which compliance frameworks may apply to a prod
|
|
|
102
109
|
? `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.`
|
|
103
110
|
: "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.");
|
|
104
111
|
});
|
|
105
|
-
server.tool("
|
|
112
|
+
server.tool("plan_checks", "Before writing a feature, list the Lintsure checks it is most likely to run into, with what each looks for and how to avoid it. Use when the user describes something to build ('add a file upload', 'a login page with Supabase', 'a chat with Claude'). Word matching, not a code review: it reads only the description. Returns text; read-only.", { feature: z.string().min(3).max(2000).describe("The feature in plain words, for example \"users upload a profile picture that we store in Supabase\".") }, RO, async ({ feature }) => {
|
|
113
|
+
const found = checksFor(feature);
|
|
114
|
+
if (!found.length)
|
|
115
|
+
return reply("No Lintsure check matches this description. Run the scan tool after writing the code.");
|
|
116
|
+
return reply([`Checks this feature is likely to meet (${found.length}), best match first. Build it so these don't fire:`, "",
|
|
117
|
+
...found.map((r) => `- ${r.id}: ${r.title}. Avoid it: ${r.fix}`), "", "Run the scan tool when the code is written. These are hints from the description, not findings."].join("\n"));
|
|
118
|
+
});
|
|
119
|
+
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.string().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 }) => {
|
|
106
120
|
const k = getKnowledge(framework);
|
|
121
|
+
if (!k)
|
|
122
|
+
return { isError: true, content: [{ type: "text", text: `Unknown framework: ${framework}. Known: ${ALL_FRAMEWORKS.join(", ")}.` }] };
|
|
107
123
|
const today = new Date().toISOString().slice(0, 10);
|
|
108
124
|
return reply([
|
|
109
125
|
`# ${k.name}`, k.summary, "", `Applies to: ${k.whoItAppliesTo}`,
|
package/package.json
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@lintsure/mcp",
|
|
3
|
-
"version": "0.3.
|
|
4
|
-
"mcpName": "io.github.lintsure/lintsure",
|
|
5
|
-
"description": "Lintsure MCP server for Claude Code, Cursor, Codex and Windsurf. Readiness checks, not an audit or legal advice.",
|
|
6
|
-
"license": "Apache-2.0",
|
|
7
|
-
"type": "module",
|
|
8
|
-
"bin": {
|
|
9
|
-
"lintsure-mcp": "dist/src/index.js"
|
|
10
|
-
},
|
|
11
|
-
"files": [
|
|
12
|
-
"dist/src",
|
|
13
|
-
"README.md",
|
|
14
|
-
"LICENSE"
|
|
15
|
-
],
|
|
16
|
-
"dependencies": {
|
|
17
|
-
"@lintsure/core": "0.3.
|
|
18
|
-
"@modelcontextprotocol/sdk": "^1.12.0",
|
|
19
|
-
"zod": "^4.6.7"
|
|
20
|
-
},
|
|
21
|
-
"author": "Lintsure <hello@lintsure.com>",
|
|
22
|
-
"homepage": "https://lintsure.com/docs",
|
|
23
|
-
"repository": {
|
|
24
|
-
"type": "git",
|
|
25
|
-
"url": "git+https://github.com/lintsure/lintsure.git"
|
|
26
|
-
},
|
|
27
|
-
"bugs": {
|
|
28
|
-
"url": "https://github.com/lintsure/lintsure/issues",
|
|
29
|
-
"email": "support@lintsure.com"
|
|
30
|
-
},
|
|
31
|
-
"engines": {
|
|
32
|
-
"node": ">=22"
|
|
33
|
-
},
|
|
34
|
-
"publishConfig": {
|
|
35
|
-
"access": "public"
|
|
36
|
-
},
|
|
37
|
-
"keywords": [
|
|
38
|
-
"compliance",
|
|
39
|
-
"gdpr",
|
|
40
|
-
"eu-ai-act",
|
|
41
|
-
"mcp",
|
|
42
|
-
"static-analysis",
|
|
43
|
-
"readiness",
|
|
44
|
-
"mcp-server",
|
|
45
|
-
"claude-code",
|
|
46
|
-
"cursor"
|
|
47
|
-
],
|
|
48
|
-
"scripts": {
|
|
49
|
-
"prepublishOnly": "cd ../.. && npm test"
|
|
50
|
-
}
|
|
51
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@lintsure/mcp",
|
|
3
|
+
"version": "0.3.11",
|
|
4
|
+
"mcpName": "io.github.lintsure/lintsure",
|
|
5
|
+
"description": "Lintsure MCP server for Claude Code, Cursor, Codex and Windsurf. Readiness checks, not an audit or legal advice.",
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"bin": {
|
|
9
|
+
"lintsure-mcp": "dist/src/index.js"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"dist/src",
|
|
13
|
+
"README.md",
|
|
14
|
+
"LICENSE"
|
|
15
|
+
],
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@lintsure/core": "0.3.11",
|
|
18
|
+
"@modelcontextprotocol/sdk": "^1.12.0",
|
|
19
|
+
"zod": "^4.6.7"
|
|
20
|
+
},
|
|
21
|
+
"author": "Lintsure <hello@lintsure.com>",
|
|
22
|
+
"homepage": "https://lintsure.com/docs",
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "git+https://github.com/lintsure/lintsure.git"
|
|
26
|
+
},
|
|
27
|
+
"bugs": {
|
|
28
|
+
"url": "https://github.com/lintsure/lintsure/issues",
|
|
29
|
+
"email": "support@lintsure.com"
|
|
30
|
+
},
|
|
31
|
+
"engines": {
|
|
32
|
+
"node": ">=22"
|
|
33
|
+
},
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"access": "public"
|
|
36
|
+
},
|
|
37
|
+
"keywords": [
|
|
38
|
+
"compliance",
|
|
39
|
+
"gdpr",
|
|
40
|
+
"eu-ai-act",
|
|
41
|
+
"mcp",
|
|
42
|
+
"static-analysis",
|
|
43
|
+
"readiness",
|
|
44
|
+
"mcp-server",
|
|
45
|
+
"claude-code",
|
|
46
|
+
"cursor"
|
|
47
|
+
],
|
|
48
|
+
"scripts": {
|
|
49
|
+
"prepublishOnly": "cd ../.. && npm test"
|
|
50
|
+
}
|
|
51
|
+
}
|