@lintsure/mcp 0.3.14 → 0.3.16
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 +2 -2
- package/dist/src/index.js +8 -7
- package/package.json +54 -51
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @lintsure/mcp
|
|
2
2
|
|
|
3
|
-
Lintsure as an MCP server for Claude Code, Cursor, Codex, Devin Desktop (formerly Windsurf) and other MCP clients. Runs on your machine over stdio, never writes files, never uploads your code.
|
|
3
|
+
**Keep your AI coding agents on track.** Lintsure as an MCP server for Claude Code, Cursor, Codex, Devin Desktop (formerly Windsurf) and other MCP clients: the agent asks which checks apply before it writes code, and scans its own work before it says it is done. Runs on your machine over stdio, never writes files, never uploads your code.
|
|
4
4
|
|
|
5
5
|
> **Lintsure is a readiness tool, not an audit, a certification or legal advice.** It tells your coding agent not to call you compliant, certified or ready, not to decide for you, and to ask before changing anything. A person makes the final call.
|
|
6
6
|
|
|
@@ -8,7 +8,7 @@ Lintsure as an MCP server for Claude Code, Cursor, Codex, Devin Desktop (formerl
|
|
|
8
8
|
claude mcp add lintsure -- npx -y @lintsure/mcp
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
Then ask your agent: *check this repo for
|
|
11
|
+
Then ask your agent: *check this repo for security problems*.
|
|
12
12
|
|
|
13
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
|
|
package/dist/src/index.js
CHANGED
|
@@ -6,8 +6,8 @@ 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, checksFor, 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, isHygiene, nextSteps, readConfig, rules, scan, toMarkdown, crossStandardLinks, verifyText } from "@lintsure/core";
|
|
10
|
+
const server = new McpServer({ name: "lintsure", version: "0.3.16" }, { 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.
|
|
@@ -42,11 +42,12 @@ server.tool("scan", "Scan a repository's source code for compliance and security
|
|
|
42
42
|
const scope = files?.map(norm);
|
|
43
43
|
const picked = report.findings.filter((f) => (!scope || scope.some((p) => f.file === p || f.file.startsWith(p + "/")))
|
|
44
44
|
&& (!only || only.includes(f.ruleId)) && (status === "all" || f.status === status) && !(f.accepted && !f.accepted.expired));
|
|
45
|
-
const rank = (f) => (f.status === "gap" ? 0 : 3) + { high: 0, medium: 1, low: 2 }[f.severity];
|
|
45
|
+
const rank = (f) => (isHygiene(f) ? 6 : 0) + (f.status === "gap" ? 0 : 3) + { high: 0, medium: 1, low: 2 }[f.severity] + (f.reach?.status === "unreachable" ? 0.5 : 0);
|
|
46
46
|
const shown = [...picked].sort((a, b) => rank(a) - rank(b)).slice(0, limit);
|
|
47
47
|
const gaps = picked.filter((f) => f.status === "gap").length;
|
|
48
|
+
const hygiene = picked.filter(isHygiene).length; // sorted last, so the limit drops these first
|
|
48
49
|
return reply([
|
|
49
|
-
`Lintsure ${report.rulesVersion}: ${picked.length} open finding${picked.length === 1 ? "" : "s"} (${gaps} gap, ${picked.length - gaps} partial)${scope || only ? " in the files and rules asked for" : ""}, ${report.filesChecked} files read${report.filesSkipped ? `, ${report.filesSkipped} skipped (over 1 MB, binary or unreadable)` : ""}.`,
|
|
50
|
+
`Lintsure ${report.rulesVersion}: ${picked.length} open finding${picked.length === 1 ? "" : "s"} (${gaps} gap, ${picked.length - gaps} partial${hygiene && hygiene < picked.length ? `; ${hygiene} are repo hygiene, listed last` : ""})${scope || only ? " in the files and rules asked for" : ""}, ${report.filesChecked} files read${report.filesSkipped ? `, ${report.filesSkipped} skipped (over 1 MB, binary or unreadable)` : ""}.`,
|
|
50
51
|
...(picked.length > shown.length ? [`Showing the first ${shown.length}; raise limit or narrow with files to see more.`] : []),
|
|
51
52
|
"",
|
|
52
53
|
...shown.map((f) => `- ${f.id} ${f.status === "gap" ? "Gap" : "Partial"} · ${f.severity} · ${f.file}:${f.line} · ${f.ruleId}: ${f.title}. Fix: ${f.fix}`),
|
|
@@ -55,9 +56,9 @@ server.tool("scan", "Scan a repository's source code for compliance and security
|
|
|
55
56
|
"", `${APPROVAL_RULES}\n\nAsk the user which finding to work on first. Call explain_rule for detail on a rule, or format "full" for the complete report.`,
|
|
56
57
|
].join("\n"));
|
|
57
58
|
});
|
|
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
|
|
59
|
+
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, how to fix it, and what to check before calling a finding real. 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 }) => {
|
|
59
60
|
const r = rules.find((x) => x.id === ruleId);
|
|
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.`);
|
|
61
|
+
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("")}${crossStandardLinks(r).length ? `\nThe same weakness in other standards: ${crossStandardLinks(r).join(" ")}` : ""}\n\n${verifyText(r.id)}\n\n${APPROVAL_RULES}` : `No rule named ${ruleId}. Rule ids look like "pii.logged"; see lintsure.com/rules.`);
|
|
61
62
|
});
|
|
62
63
|
// One list of questions: it describes the inputs and is what the agent asks when it has no answers yet.
|
|
63
64
|
const QUESTIONS = {
|
|
@@ -116,7 +117,7 @@ server.tool("plan_checks", "Before writing a feature, list the Lintsure checks i
|
|
|
116
117
|
return reply([`Checks this feature is likely to meet (${found.length}), best match first. Build it so these don't fire:`, "",
|
|
117
118
|
...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
|
});
|
|
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 }) => {
|
|
120
|
+
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\", \"owasp-ast\" (agent skills), \"owasp-api\" or \"cwe-top25\". Rule packs installed with Lintsure add more.") }, RO, async ({ framework }) => {
|
|
120
121
|
const k = getKnowledge(framework);
|
|
121
122
|
if (!k)
|
|
122
123
|
return { isError: true, content: [{ type: "text", text: `Unknown framework: ${framework}. Known: ${ALL_FRAMEWORKS.join(", ")}.` }] };
|
package/package.json
CHANGED
|
@@ -1,51 +1,54 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@lintsure/mcp",
|
|
3
|
-
"version": "0.3.
|
|
4
|
-
"mcpName": "io.github.lintsure/lintsure",
|
|
5
|
-
"description": "Lintsure MCP server
|
|
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
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
"
|
|
50
|
-
|
|
51
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@lintsure/mcp",
|
|
3
|
+
"version": "0.3.16",
|
|
4
|
+
"mcpName": "io.github.lintsure/lintsure",
|
|
5
|
+
"description": "Lintsure MCP server: lets Claude Code, Cursor, Codex and other agents check their own code before they say they are done. Runs locally. 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.16",
|
|
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
|
+
"mcp",
|
|
39
|
+
"mcp-server",
|
|
40
|
+
"model-context-protocol",
|
|
41
|
+
"ai-agents",
|
|
42
|
+
"claude-code",
|
|
43
|
+
"cursor",
|
|
44
|
+
"codex",
|
|
45
|
+
"guardrails",
|
|
46
|
+
"security",
|
|
47
|
+
"owasp",
|
|
48
|
+
"gdpr",
|
|
49
|
+
"eu-ai-act"
|
|
50
|
+
],
|
|
51
|
+
"scripts": {
|
|
52
|
+
"prepublishOnly": "cd ../.. && npm test"
|
|
53
|
+
}
|
|
54
|
+
}
|