kollguard-mcp 0.1.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.
- package/LICENSE +21 -0
- package/README.md +47 -0
- package/index.mjs +91 -0
- package/package.json +21 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Kollitech
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# kollguard-mcp
|
|
2
|
+
|
|
3
|
+
An [MCP](https://modelcontextprotocol.io) server for **KollGuard**. It exposes your
|
|
4
|
+
SOC 2 / HIPAA security findings and posture as tools, so an AI agent in **any** MCP
|
|
5
|
+
client — Claude Code, Cursor, VS Code (Cline/Continue), Windsurf, Zed — can read
|
|
6
|
+
your live KollGuard data and suggest or apply fixes in your repo.
|
|
7
|
+
|
|
8
|
+
Read-only by design: it only issues `GET` requests, authenticated with a read-only
|
|
9
|
+
`kgr_` API key, so it can never change anything in your account.
|
|
10
|
+
|
|
11
|
+
## Setup
|
|
12
|
+
|
|
13
|
+
1. In KollGuard → **Settings → API keys**, create a key and copy it (shown once).
|
|
14
|
+
2. Add the server to your client's MCP config, with the key:
|
|
15
|
+
|
|
16
|
+
```json
|
|
17
|
+
{
|
|
18
|
+
"mcpServers": {
|
|
19
|
+
"kollguard": {
|
|
20
|
+
"command": "npx",
|
|
21
|
+
"args": ["-y", "kollguard-mcp"],
|
|
22
|
+
"env": { "KOLLGUARD_API_KEY": "kgr_your_key_here" }
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
- **Claude Code**: `.mcp.json` in your project root (or `claude mcp add`).
|
|
29
|
+
- **Cursor**: `.cursor/mcp.json`.
|
|
30
|
+
- **VS Code (Cline/Continue)** / **Windsurf** / **Zed**: their MCP settings use the same shape.
|
|
31
|
+
|
|
32
|
+
Override the endpoint with `KOLLGUARD_API_URL` (defaults to `https://api.kollguard.com/v1`).
|
|
33
|
+
|
|
34
|
+
## Tools
|
|
35
|
+
|
|
36
|
+
| Tool | What it returns |
|
|
37
|
+
|---|---|
|
|
38
|
+
| `kollguard_list_findings` | Findings (filter by `severity` / `status` / `framework`), each mapped to controls + remediation |
|
|
39
|
+
| `kollguard_get_posture` | Open findings, risk score, per-framework gaps, top risks |
|
|
40
|
+
| `kollguard_list_scans` | Recent scan runs with severity counts |
|
|
41
|
+
| `kollguard_stats` | Headline stats (open findings, by severity/framework, scans last 7d) |
|
|
42
|
+
|
|
43
|
+
## Example prompts
|
|
44
|
+
|
|
45
|
+
- "Pull my open critical and high KollGuard findings and propose fixes for the repo."
|
|
46
|
+
- "What's my SOC 2 posture? Which controls are failing and why?"
|
|
47
|
+
- "List database findings and write the SQL migrations to remediate them."
|
package/index.mjs
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// KollGuard MCP server. Exposes a tenant's security/compliance findings & posture
|
|
3
|
+
// as MCP tools, so an AI agent in ANY MCP client (Claude Code, Cursor, VS Code,
|
|
4
|
+
// Windsurf, Zed) can read live KollGuard data and suggest/apply fixes in-repo.
|
|
5
|
+
//
|
|
6
|
+
// Auth: a read-only `kgr_` API key (Settings -> API keys). Read-only by design —
|
|
7
|
+
// the server only ever issues GET requests, and the key itself can't mutate.
|
|
8
|
+
//
|
|
9
|
+
// Env:
|
|
10
|
+
// KOLLGUARD_API_KEY required — your kgr_ read key
|
|
11
|
+
// KOLLGUARD_API_URL optional — defaults to https://api.kollguard.com/v1
|
|
12
|
+
|
|
13
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
14
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
15
|
+
import { ListToolsRequestSchema, CallToolRequestSchema } from '@modelcontextprotocol/sdk/types.js';
|
|
16
|
+
|
|
17
|
+
const API_URL = (process.env.KOLLGUARD_API_URL || 'https://api.kollguard.com/v1').replace(/\/$/, '');
|
|
18
|
+
const API_KEY = process.env.KOLLGUARD_API_KEY;
|
|
19
|
+
if (!API_KEY) {
|
|
20
|
+
console.error('kollguard-mcp: KOLLGUARD_API_KEY is required (create a read key in Settings → API keys).');
|
|
21
|
+
process.exit(1);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
async function kgGet(path) {
|
|
25
|
+
const res = await fetch(API_URL + path, { headers: { Authorization: `Bearer ${API_KEY}` } });
|
|
26
|
+
const text = await res.text();
|
|
27
|
+
if (!res.ok) throw new Error(`KollGuard API ${res.status}: ${text.slice(0, 300)}`);
|
|
28
|
+
return text;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const TOOLS = [
|
|
32
|
+
{
|
|
33
|
+
name: 'kollguard_list_findings',
|
|
34
|
+
description:
|
|
35
|
+
'List your security/compliance findings from KollGuard scans (GitHub repos + databases), each mapped to SOC 2 / HIPAA and 10 more frameworks with remediation. Optionally filter.',
|
|
36
|
+
inputSchema: {
|
|
37
|
+
type: 'object',
|
|
38
|
+
properties: {
|
|
39
|
+
severity: { type: 'string', enum: ['low', 'medium', 'high', 'critical'], description: 'Filter by severity' },
|
|
40
|
+
status: { type: 'string', description: "Filter by status (e.g. 'open', 'acknowledged', 'remediated', 'accepted_risk')" },
|
|
41
|
+
framework: { type: 'string', description: "Filter to a framework (e.g. 'SOC2', 'HIPAA', 'ISO 27001')" },
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: 'kollguard_get_posture',
|
|
47
|
+
description: 'Aggregated security posture: open findings, weighted risk score, per-framework gaps, per-project gate, and top risks.',
|
|
48
|
+
inputSchema: { type: 'object', properties: {} },
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: 'kollguard_list_scans',
|
|
52
|
+
description: 'List recent scan runs (GitHub + database) with per-severity finding counts and status.',
|
|
53
|
+
inputSchema: { type: 'object', properties: {} },
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: 'kollguard_stats',
|
|
57
|
+
description: 'Headline stats: open findings, breakdown by severity and framework, and scans in the last 7 days.',
|
|
58
|
+
inputSchema: { type: 'object', properties: {} },
|
|
59
|
+
},
|
|
60
|
+
];
|
|
61
|
+
|
|
62
|
+
const server = new Server({ name: 'kollguard', version: '0.1.0' }, { capabilities: { tools: {} } });
|
|
63
|
+
|
|
64
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));
|
|
65
|
+
|
|
66
|
+
server.setRequestHandler(CallToolRequestSchema, async (req) => {
|
|
67
|
+
const { name, arguments: args = {} } = req.params;
|
|
68
|
+
let path;
|
|
69
|
+
if (name === 'kollguard_list_findings') {
|
|
70
|
+
const qs = new URLSearchParams();
|
|
71
|
+
for (const k of ['severity', 'status', 'framework']) if (args[k]) qs.set(k, String(args[k]));
|
|
72
|
+
path = '/findings' + (qs.toString() ? `?${qs.toString()}` : '');
|
|
73
|
+
} else if (name === 'kollguard_get_posture') {
|
|
74
|
+
path = '/posture';
|
|
75
|
+
} else if (name === 'kollguard_list_scans') {
|
|
76
|
+
path = '/scans';
|
|
77
|
+
} else if (name === 'kollguard_stats') {
|
|
78
|
+
path = '/stats';
|
|
79
|
+
} else {
|
|
80
|
+
return { content: [{ type: 'text', text: `Unknown tool: ${name}` }], isError: true };
|
|
81
|
+
}
|
|
82
|
+
try {
|
|
83
|
+
return { content: [{ type: 'text', text: await kgGet(path) }] };
|
|
84
|
+
} catch (e) {
|
|
85
|
+
return { content: [{ type: 'text', text: `Error: ${e?.message || e}` }], isError: true };
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
const transport = new StdioServerTransport();
|
|
90
|
+
await server.connect(transport);
|
|
91
|
+
console.error(`kollguard-mcp connected (API: ${API_URL})`);
|
package/package.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "kollguard-mcp",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "MCP server for KollGuard — read your SOC 2 / HIPAA security findings & posture from any MCP client (Claude Code, Cursor, VS Code, Windsurf, Zed).",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"kollguard-mcp": "index.mjs"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"index.mjs",
|
|
11
|
+
"README.md"
|
|
12
|
+
],
|
|
13
|
+
"engines": {
|
|
14
|
+
"node": ">=18"
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@modelcontextprotocol/sdk": "^1.0.0"
|
|
18
|
+
},
|
|
19
|
+
"keywords": ["mcp", "kollguard", "soc2", "hipaa", "compliance", "security"],
|
|
20
|
+
"license": "MIT"
|
|
21
|
+
}
|