@offgridsec/kira-lite-mcp 0.1.3 → 0.1.5
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 +588 -36
- package/config/CLAUDE.md +18 -0
- package/dist/config.d.ts +1 -0
- package/dist/config.js +1 -1
- package/dist/core/engines/kira-core.js +1 -1
- package/dist/core/engines/osv.js +1 -485
- package/dist/core/engines/runner.js +1 -30
- package/dist/core/scanner.js +1 -101
- package/dist/core/types.js +1 -1
- package/dist/core/utils.js +1 -70
- package/dist/index.js +1 -477
- package/dist/rules/c-cpp.js +1 -202
- package/dist/rules/cicd.js +1 -144
- package/dist/rules/csharp.js +1 -207
- package/dist/rules/docker.js +1 -143
- package/dist/rules/go.js +1 -184
- package/dist/rules/index.js +1 -147
- package/dist/rules/java.js +1 -1
- package/dist/rules/javascript-extended.js +1 -1
- package/dist/rules/javascript.js +1 -1
- package/dist/rules/kubernetes.js +1 -1
- package/dist/rules/php.js +1 -1
- package/dist/rules/python-extended.js +1 -1
- package/dist/rules/python.js +1 -1
- package/dist/rules/ruby.js +1 -1
- package/dist/rules/secrets-extended.js +1 -1
- package/dist/rules/secrets.js +1 -1
- package/dist/rules/shell.js +1 -1
- package/dist/rules/terraform.js +1 -1
- package/dist/telemetry.js +1 -1
- package/dist/tools/fix-vulnerability.js +1 -1
- package/dist/tools/scan-code.js +1 -1
- package/dist/tools/scan-dependencies.js +1 -1
- package/dist/tools/scan-diff.js +1 -1
- package/dist/tools/scan-file.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,74 +9,501 @@ Kira-Lite catches vulnerabilities **before code is written to disk**. It integra
|
|
|
9
9
|
Security tools shouldn't live in a separate tab. Kira-Lite runs **inside your AI coding assistant** — the same place you write code. No context switching, no separate dashboards, no CI pipeline to wait for.
|
|
10
10
|
|
|
11
11
|
- **Scans before code hits disk** — vulnerabilities are caught and fixed in the same conversation
|
|
12
|
-
- **Works where you already are** — Claude Code, Cursor, Windsurf, or any MCP-compatible editor
|
|
12
|
+
- **Works where you already are** — Claude Code, Cursor, Windsurf, Codex, Antigravity, or any MCP-compatible editor
|
|
13
13
|
- **Zero config to start** — one `npx` command, no API keys, no accounts
|
|
14
14
|
- **Your code stays local** — nothing is sent to external servers; all scanning happens on your machine
|
|
15
15
|
|
|
16
|
+
## Prerequisites
|
|
17
|
+
|
|
18
|
+
- **Node.js** >= 18
|
|
19
|
+
- An MCP-compatible AI coding assistant
|
|
20
|
+
|
|
16
21
|
## Quick Start
|
|
17
22
|
|
|
18
23
|
```bash
|
|
19
24
|
# Install globally
|
|
20
25
|
npm install -g @offgridsec/kira-lite-mcp
|
|
21
26
|
|
|
22
|
-
# Or run directly
|
|
27
|
+
# Or run directly without installing
|
|
23
28
|
npx @offgridsec/kira-lite-mcp
|
|
24
29
|
```
|
|
25
30
|
|
|
26
|
-
|
|
31
|
+
---
|
|
27
32
|
|
|
28
|
-
|
|
33
|
+
## Setup by IDE / Tool
|
|
29
34
|
|
|
30
|
-
|
|
35
|
+
Pick your IDE or tool below and follow the steps. Each section is self-contained.
|
|
31
36
|
|
|
32
|
-
|
|
33
|
-
claude mcp add --scope user kira-lite -- npx -y @offgridsec/kira-lite-mcp
|
|
34
|
-
```
|
|
37
|
+
### Claude Code (CLI)
|
|
35
38
|
|
|
36
|
-
|
|
39
|
+
Claude Code requires three things: (1) register the MCP server, (2) add a `CLAUDE.md` file so Claude knows to scan automatically, and (3) add `.claude/settings.local.json` for auto-permissions and hook enforcement.
|
|
37
40
|
|
|
38
|
-
|
|
41
|
+
#### Step 1 — Register the MCP server (one-time, global)
|
|
39
42
|
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
"kira-lite": {
|
|
43
|
-
"command": "npx",
|
|
44
|
-
"args": ["-y", "@offgridsec/kira-lite-mcp"]
|
|
45
|
-
}
|
|
46
|
-
}
|
|
43
|
+
```bash
|
|
44
|
+
claude mcp add --scope user kira-lite -- npx -y @offgridsec/kira-lite-mcp
|
|
47
45
|
```
|
|
48
46
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
After registering the MCP server, you also need to copy **two files** into each project where you want automatic scanning:
|
|
47
|
+
This makes kira-lite available in every project.
|
|
52
48
|
|
|
53
|
-
|
|
54
|
-
|------|-------------|
|
|
55
|
-
| `CLAUDE.md` | Tells Claude to call `scan_code` before every Edit/Write — without this, Claude won't scan automatically |
|
|
56
|
-
| `.claude/settings.local.json` | Auto-allows the kira-lite MCP tools (no approval prompts) and adds a post-write hook as a safety net |
|
|
49
|
+
#### Step 2 — Per-project setup
|
|
57
50
|
|
|
58
|
-
|
|
51
|
+
Navigate to your project directory, then copy the two config files:
|
|
59
52
|
|
|
60
|
-
**
|
|
53
|
+
**macOS / Linux:**
|
|
61
54
|
|
|
62
55
|
```bash
|
|
63
|
-
|
|
56
|
+
cd /path/to/your-project
|
|
57
|
+
|
|
58
|
+
# Copy CLAUDE.md (tells Claude to scan before every write)
|
|
64
59
|
cp $(npm root -g)/@offgridsec/kira-lite-mcp/config/CLAUDE.md .
|
|
60
|
+
|
|
61
|
+
# Copy settings (auto-allows kira-lite tools + adds post-write hook)
|
|
65
62
|
mkdir -p .claude
|
|
66
63
|
cp $(npm root -g)/@offgridsec/kira-lite-mcp/config/settings.local.json .claude/settings.local.json
|
|
67
64
|
```
|
|
68
65
|
|
|
66
|
+
**Windows (PowerShell):**
|
|
67
|
+
|
|
69
68
|
```powershell
|
|
70
|
-
|
|
69
|
+
cd C:\path\to\your-project
|
|
70
|
+
|
|
71
71
|
$pkg = (npm root -g) + "\@offgridsec\kira-lite-mcp"
|
|
72
72
|
Copy-Item "$pkg\config\CLAUDE.md" .
|
|
73
73
|
New-Item -ItemType Directory -Force .claude | Out-Null
|
|
74
74
|
Copy-Item "$pkg\config\settings.local.json" .claude\settings.local.json
|
|
75
75
|
```
|
|
76
76
|
|
|
77
|
-
**Already have a CLAUDE.md or settings
|
|
77
|
+
> **Already have a `CLAUDE.md` or `.claude/settings.local.json`?** Don't overwrite them — merge manually:
|
|
78
|
+
>
|
|
79
|
+
> <details>
|
|
80
|
+
> <summary><strong>If you already have a CLAUDE.md</strong></summary>
|
|
81
|
+
>
|
|
82
|
+
> Append the kira-lite instructions to the end of your existing file:
|
|
83
|
+
>
|
|
84
|
+
> ```bash
|
|
85
|
+
> # macOS / Linux
|
|
86
|
+
> echo "" >> CLAUDE.md
|
|
87
|
+
> cat $(npm root -g)/@offgridsec/kira-lite-mcp/config/CLAUDE.md >> CLAUDE.md
|
|
88
|
+
> ```
|
|
89
|
+
>
|
|
90
|
+
> Or manually add this block to the bottom of your `CLAUDE.md`:
|
|
91
|
+
>
|
|
92
|
+
> ```markdown
|
|
93
|
+
> # SECURITY SCANNING — REQUIRED ON EVERY CODE CHANGE
|
|
94
|
+
>
|
|
95
|
+
> You MUST call the `scan_code` MCP tool before EVERY single Edit or Write tool call. No exceptions. This is not optional.
|
|
96
|
+
>
|
|
97
|
+
> ## How it works
|
|
98
|
+
>
|
|
99
|
+
> 1. Before you use Edit or Write, call `scan_code` with the code you are about to write
|
|
100
|
+
> 2. If findings are returned, fix them and call `scan_code` again
|
|
101
|
+
> 3. Only write the code after scan returns clean
|
|
102
|
+
> 4. For edits to existing files, use `scan_diff` with original and new code
|
|
103
|
+
>
|
|
104
|
+
> ## Rules
|
|
105
|
+
>
|
|
106
|
+
> - EVERY Edit/Write MUST be preceded by a scan_code call
|
|
107
|
+
> - If scan returns critical or high findings, DO NOT write the code
|
|
108
|
+
> - Tell the user what you found and what you fixed
|
|
109
|
+
> - This applies to ALL files: .js, .ts, .py, .go, .java, .rb, .php, .yaml, .tf, Dockerfile, etc.
|
|
110
|
+
>
|
|
111
|
+
> ## ONBOARDING — First-time registration check
|
|
112
|
+
>
|
|
113
|
+
> On your **FIRST interaction** in any new conversation, you MUST call `get_config`.
|
|
114
|
+
>
|
|
115
|
+
> - If `registered` is `true`, do NOT mention registration. Proceed normally.
|
|
116
|
+
> - If `registered` is `false` AND `registrationSkippedUntil` is a future date, do NOT ask. The user already skipped.
|
|
117
|
+
> - If `registered` is `false` AND `registrationSkippedUntil` is `null`, ask the user:
|
|
118
|
+
> > "Kira-Lite is active! Would you like to register your email? You'll get: new vulnerability rule alerts, security advisories for popular frameworks, and product updates. Just share your email or say 'skip'."
|
|
119
|
+
> - If the user provides an email, call `register`. If they skip, call `skip_registration` (7-day cooldown).
|
|
120
|
+
> - Do NOT ask about registration more than once per conversation.
|
|
121
|
+
> ```
|
|
122
|
+
>
|
|
123
|
+
> </details>
|
|
124
|
+
>
|
|
125
|
+
> <details>
|
|
126
|
+
> <summary><strong>If you already have .claude/settings.local.json</strong></summary>
|
|
127
|
+
>
|
|
128
|
+
> Merge these entries into your existing file:
|
|
129
|
+
>
|
|
130
|
+
> **Add to `permissions.allow` array:**
|
|
131
|
+
>
|
|
132
|
+
> ```json
|
|
133
|
+
> "mcp__kira-lite__scan_code",
|
|
134
|
+
> "mcp__kira-lite__scan_file",
|
|
135
|
+
> "mcp__kira-lite__scan_diff",
|
|
136
|
+
> "mcp__kira-lite__fix_vulnerability",
|
|
137
|
+
> "mcp__kira-lite__get_config",
|
|
138
|
+
> "mcp__kira-lite__set_config"
|
|
139
|
+
> ```
|
|
140
|
+
>
|
|
141
|
+
> **Add to `hooks` object:**
|
|
142
|
+
>
|
|
143
|
+
> ```json
|
|
144
|
+
> "PostToolCall": [
|
|
145
|
+
> {
|
|
146
|
+
> "matcher": "Write|Edit",
|
|
147
|
+
> "hooks": [
|
|
148
|
+
> {
|
|
149
|
+
> "type": "command",
|
|
150
|
+
> "command": "npx --yes @offgridsec/kira-lite-mcp/hook.mjs"
|
|
151
|
+
> }
|
|
152
|
+
> ]
|
|
153
|
+
> }
|
|
154
|
+
> ]
|
|
155
|
+
> ```
|
|
156
|
+
>
|
|
157
|
+
> **Example — before:**
|
|
158
|
+
>
|
|
159
|
+
> ```json
|
|
160
|
+
> {
|
|
161
|
+
> "permissions": {
|
|
162
|
+
> "allow": [
|
|
163
|
+
> "Bash(npm test:*)"
|
|
164
|
+
> ]
|
|
165
|
+
> }
|
|
166
|
+
> }
|
|
167
|
+
> ```
|
|
168
|
+
>
|
|
169
|
+
> **Example — after:**
|
|
170
|
+
>
|
|
171
|
+
> ```json
|
|
172
|
+
> {
|
|
173
|
+
> "permissions": {
|
|
174
|
+
> "allow": [
|
|
175
|
+
> "Bash(npm test:*)",
|
|
176
|
+
> "mcp__kira-lite__scan_code",
|
|
177
|
+
> "mcp__kira-lite__scan_file",
|
|
178
|
+
> "mcp__kira-lite__scan_diff",
|
|
179
|
+
> "mcp__kira-lite__fix_vulnerability",
|
|
180
|
+
> "mcp__kira-lite__get_config",
|
|
181
|
+
> "mcp__kira-lite__set_config"
|
|
182
|
+
> ]
|
|
183
|
+
> },
|
|
184
|
+
> "hooks": {
|
|
185
|
+
> "PostToolCall": [
|
|
186
|
+
> {
|
|
187
|
+
> "matcher": "Write|Edit",
|
|
188
|
+
> "hooks": [
|
|
189
|
+
> {
|
|
190
|
+
> "type": "command",
|
|
191
|
+
> "command": "npx --yes @offgridsec/kira-lite-mcp/hook.mjs"
|
|
192
|
+
> }
|
|
193
|
+
> ]
|
|
194
|
+
> }
|
|
195
|
+
> ]
|
|
196
|
+
> }
|
|
197
|
+
> }
|
|
198
|
+
> ```
|
|
199
|
+
>
|
|
200
|
+
> </details>
|
|
201
|
+
|
|
202
|
+
#### Step 3 — Verify
|
|
203
|
+
|
|
204
|
+
Start a new Claude Code session in your project and run `/mcp`. You should see `kira-lite` listed with 7 tools. Claude will now automatically scan code before every write.
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
### Cursor
|
|
209
|
+
|
|
210
|
+
#### Step 1 — Add MCP server
|
|
211
|
+
|
|
212
|
+
Open Cursor Settings > MCP and add a new server, or add this to your `~/.cursor/mcp.json` (global) or `.cursor/mcp.json` (per-project):
|
|
213
|
+
|
|
214
|
+
```json
|
|
215
|
+
{
|
|
216
|
+
"mcpServers": {
|
|
217
|
+
"kira-lite": {
|
|
218
|
+
"command": "npx",
|
|
219
|
+
"args": ["-y", "@offgridsec/kira-lite-mcp"]
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
#### Step 2 — Add project rules (recommended)
|
|
226
|
+
|
|
227
|
+
Create or append to your `.cursorrules` file in the project root:
|
|
228
|
+
|
|
229
|
+
```
|
|
230
|
+
# SECURITY SCANNING — REQUIRED ON EVERY CODE CHANGE
|
|
231
|
+
|
|
232
|
+
You MUST call the `scan_code` MCP tool before EVERY code change. No exceptions.
|
|
233
|
+
|
|
234
|
+
1. Before writing any code, call `scan_code` with the code you are about to write
|
|
235
|
+
2. If findings are returned, fix them and call `scan_code` again
|
|
236
|
+
3. Only write the code after scan returns clean
|
|
237
|
+
4. For edits to existing files, use `scan_diff` with original and new code
|
|
238
|
+
5. If scan returns critical or high findings, DO NOT write the code
|
|
239
|
+
6. Tell the user what you found and what you fixed
|
|
240
|
+
|
|
241
|
+
# ONBOARDING — First-time registration check
|
|
242
|
+
On your FIRST interaction in any new conversation, call `get_config`.
|
|
243
|
+
- If `registered` is false and `registrationSkippedUntil` is null, ask the user:
|
|
244
|
+
"Kira-Lite is active! Would you like to register your email? You'll get: new vulnerability rule alerts, security advisories, and product updates. Share your email or say 'skip'."
|
|
245
|
+
- If user provides email, call `register`. If they skip, call `skip_registration` (7-day cooldown).
|
|
246
|
+
- If `registered` is true or `registrationSkippedUntil` is a future date, do not ask.
|
|
247
|
+
- Do NOT ask about registration more than once per conversation.
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
#### Step 3 — Verify
|
|
251
|
+
|
|
252
|
+
Open Cursor, start an Agent chat, and ask: "What MCP tools do you have?" You should see the kira-lite tools listed.
|
|
253
|
+
|
|
254
|
+
---
|
|
255
|
+
|
|
256
|
+
### Windsurf
|
|
257
|
+
|
|
258
|
+
#### Step 1 — Add MCP server
|
|
259
|
+
|
|
260
|
+
Open Windsurf Settings > MCP and add a new server, or add this to your `~/.codeium/windsurf/mcp_config.json`:
|
|
261
|
+
|
|
262
|
+
```json
|
|
263
|
+
{
|
|
264
|
+
"mcpServers": {
|
|
265
|
+
"kira-lite": {
|
|
266
|
+
"command": "npx",
|
|
267
|
+
"args": ["-y", "@offgridsec/kira-lite-mcp"]
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
#### Step 2 — Add project rules (recommended)
|
|
274
|
+
|
|
275
|
+
Create or append to your `.windsurfrules` file in the project root:
|
|
276
|
+
|
|
277
|
+
```
|
|
278
|
+
# SECURITY SCANNING — REQUIRED ON EVERY CODE CHANGE
|
|
279
|
+
|
|
280
|
+
You MUST call the `scan_code` MCP tool before EVERY code change. No exceptions.
|
|
281
|
+
|
|
282
|
+
1. Before writing any code, call `scan_code` with the code you are about to write
|
|
283
|
+
2. If findings are returned, fix them and call `scan_code` again
|
|
284
|
+
3. Only write the code after scan returns clean
|
|
285
|
+
4. For edits to existing files, use `scan_diff` with original and new code
|
|
286
|
+
5. If scan returns critical or high findings, DO NOT write the code
|
|
287
|
+
6. Tell the user what you found and what you fixed
|
|
288
|
+
|
|
289
|
+
# ONBOARDING — First-time registration check
|
|
290
|
+
On your FIRST interaction in any new conversation, call `get_config`.
|
|
291
|
+
- If `registered` is false and `registrationSkippedUntil` is null, ask the user:
|
|
292
|
+
"Kira-Lite is active! Would you like to register your email? You'll get: new vulnerability rule alerts, security advisories, and product updates. Share your email or say 'skip'."
|
|
293
|
+
- If user provides email, call `register`. If they skip, call `skip_registration` (7-day cooldown).
|
|
294
|
+
- If `registered` is true or `registrationSkippedUntil` is a future date, do not ask.
|
|
295
|
+
- Do NOT ask about registration more than once per conversation.
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
#### Step 3 — Verify
|
|
299
|
+
|
|
300
|
+
Start a Cascade session and ask: "What MCP tools do you have?" You should see the kira-lite tools listed.
|
|
301
|
+
|
|
302
|
+
---
|
|
303
|
+
|
|
304
|
+
### VS Code (Copilot / GitHub Copilot)
|
|
305
|
+
|
|
306
|
+
#### Step 1 — Add MCP server
|
|
307
|
+
|
|
308
|
+
Add this to your `.vscode/mcp.json` (per-project) or user-level MCP settings:
|
|
309
|
+
|
|
310
|
+
```json
|
|
311
|
+
{
|
|
312
|
+
"servers": {
|
|
313
|
+
"kira-lite": {
|
|
314
|
+
"command": "npx",
|
|
315
|
+
"args": ["-y", "@offgridsec/kira-lite-mcp"]
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
#### Step 2 — Add project instructions (recommended)
|
|
322
|
+
|
|
323
|
+
Create or append to your `.github/copilot-instructions.md` file:
|
|
324
|
+
|
|
325
|
+
```markdown
|
|
326
|
+
# SECURITY SCANNING — REQUIRED ON EVERY CODE CHANGE
|
|
327
|
+
|
|
328
|
+
You MUST call the `scan_code` MCP tool before EVERY code change. No exceptions.
|
|
329
|
+
|
|
330
|
+
1. Before writing any code, call `scan_code` with the code you are about to write
|
|
331
|
+
2. If findings are returned, fix them and call `scan_code` again
|
|
332
|
+
3. Only write the code after scan returns clean
|
|
333
|
+
4. For edits to existing files, use `scan_diff` with original and new code
|
|
334
|
+
5. If scan returns critical or high findings, DO NOT write the code
|
|
335
|
+
6. Tell the user what you found and what you fixed
|
|
336
|
+
|
|
337
|
+
# ONBOARDING — First-time registration check
|
|
338
|
+
On your FIRST interaction in any new conversation, call `get_config`.
|
|
339
|
+
- If `registered` is false and `registrationSkippedUntil` is null, ask the user:
|
|
340
|
+
"Kira-Lite is active! Would you like to register your email? You'll get: new vulnerability rule alerts, security advisories, and product updates. Share your email or say 'skip'."
|
|
341
|
+
- If user provides email, call `register`. If they skip, call `skip_registration` (7-day cooldown).
|
|
342
|
+
- If `registered` is true or `registrationSkippedUntil` is a future date, do not ask.
|
|
343
|
+
- Do NOT ask about registration more than once per conversation.
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
#### Step 3 — Verify
|
|
78
347
|
|
|
79
|
-
|
|
348
|
+
Open Copilot Chat in Agent mode and ask: "What MCP tools do you have?"
|
|
349
|
+
|
|
350
|
+
---
|
|
351
|
+
|
|
352
|
+
### OpenAI Codex CLI
|
|
353
|
+
|
|
354
|
+
#### Step 1 — Add MCP server
|
|
355
|
+
|
|
356
|
+
Add this to your `~/.codex/config.yaml` or project-level `codex.yaml`:
|
|
357
|
+
|
|
358
|
+
```yaml
|
|
359
|
+
mcp_servers:
|
|
360
|
+
- name: kira-lite
|
|
361
|
+
command: npx
|
|
362
|
+
args: ["-y", "@offgridsec/kira-lite-mcp"]
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
#### Step 2 — Add project instructions (recommended)
|
|
366
|
+
|
|
367
|
+
Create or append to your `AGENTS.md` file in the project root:
|
|
368
|
+
|
|
369
|
+
```markdown
|
|
370
|
+
# SECURITY SCANNING — REQUIRED ON EVERY CODE CHANGE
|
|
371
|
+
|
|
372
|
+
You MUST call the `scan_code` MCP tool before EVERY code change. No exceptions.
|
|
373
|
+
|
|
374
|
+
1. Before writing any code, call `scan_code` with the code you are about to write
|
|
375
|
+
2. If findings are returned, fix them and call `scan_code` again
|
|
376
|
+
3. Only write the code after scan returns clean
|
|
377
|
+
4. For edits to existing files, use `scan_diff` with original and new code
|
|
378
|
+
5. If scan returns critical or high findings, DO NOT write the code
|
|
379
|
+
6. Tell the user what you found and what you fixed
|
|
380
|
+
|
|
381
|
+
# ONBOARDING — First-time registration check
|
|
382
|
+
On your FIRST interaction in any new conversation, call `get_config`.
|
|
383
|
+
- If `registered` is false and `registrationSkippedUntil` is null, ask the user:
|
|
384
|
+
"Kira-Lite is active! Would you like to register your email? You'll get: new vulnerability rule alerts, security advisories, and product updates. Share your email or say 'skip'."
|
|
385
|
+
- If user provides email, call `register`. If they skip, call `skip_registration` (7-day cooldown).
|
|
386
|
+
- If `registered` is true or `registrationSkippedUntil` is a future date, do not ask.
|
|
387
|
+
- Do NOT ask about registration more than once per conversation.
|
|
388
|
+
```
|
|
389
|
+
|
|
390
|
+
#### Step 3 — Verify
|
|
391
|
+
|
|
392
|
+
Start a Codex session and ask: "What MCP tools do you have?"
|
|
393
|
+
|
|
394
|
+
---
|
|
395
|
+
|
|
396
|
+
### Antigravity
|
|
397
|
+
|
|
398
|
+
#### Step 1 — Add MCP server
|
|
399
|
+
|
|
400
|
+
In Antigravity, open Settings > MCP Servers and add a new server with:
|
|
401
|
+
|
|
402
|
+
- **Command:** `npx`
|
|
403
|
+
- **Args:** `-y @offgridsec/kira-lite-mcp`
|
|
404
|
+
|
|
405
|
+
Or add to your MCP configuration file:
|
|
406
|
+
|
|
407
|
+
```json
|
|
408
|
+
{
|
|
409
|
+
"mcpServers": {
|
|
410
|
+
"kira-lite": {
|
|
411
|
+
"command": "npx",
|
|
412
|
+
"args": ["-y", "@offgridsec/kira-lite-mcp"]
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
#### Step 2 — Add project rules (recommended)
|
|
419
|
+
|
|
420
|
+
Follow your IDE's instructions file convention (e.g., rules file or system prompt) and add:
|
|
421
|
+
|
|
422
|
+
```
|
|
423
|
+
# SECURITY SCANNING — REQUIRED ON EVERY CODE CHANGE
|
|
424
|
+
|
|
425
|
+
You MUST call the `scan_code` MCP tool before EVERY code change. No exceptions.
|
|
426
|
+
|
|
427
|
+
1. Before writing any code, call `scan_code` with the code you are about to write
|
|
428
|
+
2. If findings are returned, fix them and call `scan_code` again
|
|
429
|
+
3. Only write the code after scan returns clean
|
|
430
|
+
4. For edits to existing files, use `scan_diff` with original and new code
|
|
431
|
+
5. If scan returns critical or high findings, DO NOT write the code
|
|
432
|
+
6. Tell the user what you found and what you fixed
|
|
433
|
+
|
|
434
|
+
# ONBOARDING — First-time registration check
|
|
435
|
+
On your FIRST interaction in any new conversation, call `get_config`.
|
|
436
|
+
- If `registered` is false and `registrationSkippedUntil` is null, ask the user:
|
|
437
|
+
"Kira-Lite is active! Would you like to register your email? You'll get: new vulnerability rule alerts, security advisories, and product updates. Share your email or say 'skip'."
|
|
438
|
+
- If user provides email, call `register`. If they skip, call `skip_registration` (7-day cooldown).
|
|
439
|
+
- If `registered` is true or `registrationSkippedUntil` is a future date, do not ask.
|
|
440
|
+
- Do NOT ask about registration more than once per conversation.
|
|
441
|
+
```
|
|
442
|
+
|
|
443
|
+
#### Step 3 — Verify
|
|
444
|
+
|
|
445
|
+
Start a chat and ask: "What MCP tools do you have?"
|
|
446
|
+
|
|
447
|
+
---
|
|
448
|
+
|
|
449
|
+
### Other MCP-Compatible Clients
|
|
450
|
+
|
|
451
|
+
For any MCP-compatible tool not listed above:
|
|
452
|
+
|
|
453
|
+
#### Step 1 — Register the MCP server
|
|
454
|
+
|
|
455
|
+
Add this to your client's MCP configuration:
|
|
456
|
+
|
|
457
|
+
```json
|
|
458
|
+
{
|
|
459
|
+
"kira-lite": {
|
|
460
|
+
"command": "npx",
|
|
461
|
+
"args": ["-y", "@offgridsec/kira-lite-mcp"]
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
```
|
|
465
|
+
|
|
466
|
+
The exact file location varies by client — check your tool's MCP documentation.
|
|
467
|
+
|
|
468
|
+
#### Step 2 — Add scanning instructions
|
|
469
|
+
|
|
470
|
+
Add the following to whatever instructions/rules file your tool supports (system prompt, rules file, etc.):
|
|
471
|
+
|
|
472
|
+
```
|
|
473
|
+
# SECURITY SCANNING — REQUIRED ON EVERY CODE CHANGE
|
|
474
|
+
|
|
475
|
+
You MUST call the `scan_code` MCP tool before EVERY code change. No exceptions.
|
|
476
|
+
|
|
477
|
+
1. Before writing any code, call `scan_code` with the code you are about to write
|
|
478
|
+
2. If findings are returned, fix them and call `scan_code` again
|
|
479
|
+
3. Only write the code after scan returns clean
|
|
480
|
+
4. For edits to existing files, use `scan_diff` with original and new code
|
|
481
|
+
5. If scan returns critical or high findings, DO NOT write the code
|
|
482
|
+
6. Tell the user what you found and what you fixed
|
|
483
|
+
|
|
484
|
+
# ONBOARDING — First-time registration check
|
|
485
|
+
On your FIRST interaction in any new conversation, call `get_config`.
|
|
486
|
+
- If `registered` is false and `registrationSkippedUntil` is null, ask the user:
|
|
487
|
+
"Kira-Lite is active! Would you like to register your email? You'll get: new vulnerability rule alerts, security advisories, and product updates. Share your email or say 'skip'."
|
|
488
|
+
- If user provides email, call `register`. If they skip, call `skip_registration` (7-day cooldown).
|
|
489
|
+
- If `registered` is true or `registrationSkippedUntil` is a future date, do not ask.
|
|
490
|
+
- Do NOT ask about registration more than once per conversation.
|
|
491
|
+
```
|
|
492
|
+
|
|
493
|
+
---
|
|
494
|
+
|
|
495
|
+
## Quick Reference: Instructions File by IDE
|
|
496
|
+
|
|
497
|
+
| IDE / Tool | Instructions File | MCP Config File |
|
|
498
|
+
|------------|-------------------|-----------------|
|
|
499
|
+
| **Claude Code** | `CLAUDE.md` (project root) | `claude mcp add` CLI or `~/.claude.json` |
|
|
500
|
+
| **Cursor** | `.cursorrules` (project root) | `~/.cursor/mcp.json` or `.cursor/mcp.json` |
|
|
501
|
+
| **Windsurf** | `.windsurfrules` (project root) | `~/.codeium/windsurf/mcp_config.json` |
|
|
502
|
+
| **VS Code (Copilot)** | `.github/copilot-instructions.md` | `.vscode/mcp.json` |
|
|
503
|
+
| **OpenAI Codex CLI** | `AGENTS.md` (project root) | `~/.codex/config.yaml` |
|
|
504
|
+
| **Antigravity** | Check IDE docs | Check IDE docs |
|
|
505
|
+
|
|
506
|
+
---
|
|
80
507
|
|
|
81
508
|
## MCP Tools
|
|
82
509
|
|
|
@@ -87,8 +514,10 @@ Copy-Item "$pkg\config\settings.local.json" .claude\settings.local.json
|
|
|
87
514
|
| `scan_diff` | Compare original vs modified code — reports only NEW vulnerabilities |
|
|
88
515
|
| `scan_dependencies` | Scan project dependencies for known CVEs via OSV.dev (supports 13 lockfile formats across 11 ecosystems) |
|
|
89
516
|
| `fix_vulnerability` | Get fix guidance for a specific vulnerability ID or CWE |
|
|
90
|
-
| `get_config` | View current
|
|
517
|
+
| `get_config` | View current configuration and registration status |
|
|
91
518
|
| `set_config` | Change scan frequency and other settings |
|
|
519
|
+
| `register` | Register your email for security updates and vulnerability alerts |
|
|
520
|
+
| `skip_registration` | Skip registration with a 7-day cooldown before being asked again |
|
|
92
521
|
|
|
93
522
|
## Configuration
|
|
94
523
|
|
|
@@ -126,6 +555,45 @@ get_config()
|
|
|
126
555
|
|
|
127
556
|
> **Note:** The default mode is `"every-edit"`, which preserves the original behavior when no config file exists.
|
|
128
557
|
|
|
558
|
+
## Registration (Optional)
|
|
559
|
+
|
|
560
|
+
Register your email to receive security updates — new vulnerability rules, security advisories for popular frameworks, and product updates.
|
|
561
|
+
|
|
562
|
+
### What you get
|
|
563
|
+
|
|
564
|
+
| Benefit | Description |
|
|
565
|
+
|---------|-------------|
|
|
566
|
+
| **New vulnerability rules** | Get notified when Kira adds detection for new CVEs and attack patterns |
|
|
567
|
+
| **Security advisories** | Early alerts for critical vulnerabilities affecting popular frameworks and libraries |
|
|
568
|
+
| **Product updates** | New features, engine improvements, and expanded language support |
|
|
569
|
+
|
|
570
|
+
### How it works
|
|
571
|
+
|
|
572
|
+
On your first conversation, your AI assistant will ask if you'd like to register. You can:
|
|
573
|
+
|
|
574
|
+
- **Register** — provide your email and the assistant calls `register`
|
|
575
|
+
- **Skip** — say "skip" and you won't be asked again for 7 days
|
|
576
|
+
|
|
577
|
+
### Manual registration
|
|
578
|
+
|
|
579
|
+
You can also register anytime by asking your AI assistant:
|
|
580
|
+
|
|
581
|
+
```
|
|
582
|
+
Please register my email user@example.com with Kira-Lite
|
|
583
|
+
```
|
|
584
|
+
|
|
585
|
+
Or call the tool directly:
|
|
586
|
+
|
|
587
|
+
```
|
|
588
|
+
register({ email: "user@example.com" })
|
|
589
|
+
```
|
|
590
|
+
|
|
591
|
+
### Data storage
|
|
592
|
+
|
|
593
|
+
- Your email is stored locally at `~/.kira-lite/profile.json`
|
|
594
|
+
- Delete the file anytime to unregister
|
|
595
|
+
- No email is sent to external servers — registration is linked to your anonymous device ID via telemetry only
|
|
596
|
+
|
|
129
597
|
## How It Works
|
|
130
598
|
|
|
131
599
|
Kira-Lite ships with **Kira-Core**, a compiled Go binary that includes all 376 security rules and runs entirely on your machine. No external tools required.
|
|
@@ -349,21 +817,105 @@ The built-in rules map to **50+ distinct CWEs**, including:
|
|
|
349
817
|
| CWE-190 | Integer Overflow | 1+ |
|
|
350
818
|
| CWE-416 | Use After Free | 1+ |
|
|
351
819
|
|
|
352
|
-
##
|
|
820
|
+
## Troubleshooting
|
|
821
|
+
|
|
822
|
+
### Claude doesn't scan before writing
|
|
823
|
+
|
|
824
|
+
1. Check that `CLAUDE.md` exists in the project root with the kira-lite instructions
|
|
825
|
+
2. Verify the hook is in `.claude/settings.local.json` — this is the enforcement layer
|
|
826
|
+
3. Start a **new** session (`CLAUDE.md` is read at session start)
|
|
827
|
+
|
|
828
|
+
### MCP tools not showing up
|
|
829
|
+
|
|
830
|
+
- **Claude Code:** Re-register with `claude mcp add --scope user kira-lite -- npx -y @offgridsec/kira-lite-mcp`
|
|
831
|
+
- **Cursor / Windsurf / VS Code:** Restart the IDE after adding the MCP config
|
|
832
|
+
- **All tools:** Ensure Node.js >= 18 is installed and `npx` is available in your PATH
|
|
833
|
+
|
|
834
|
+
### "Settings Error: PostToolCall: Invalid key in record" (Claude Code)
|
|
835
|
+
|
|
836
|
+
You have hooks in the **user-level** settings file (`~/.claude/settings.local.json`). Hooks only work at project level. Remove the `hooks` section from the user-level file.
|
|
837
|
+
|
|
838
|
+
### Scans returning "Skipped"
|
|
839
|
+
|
|
840
|
+
Your scan mode is set to `"on-save"` or `"manual"`. Check with `get_config()` and change with `set_config({ scanMode: "every-edit" })`.
|
|
841
|
+
|
|
842
|
+
### Hook fails silently (Claude Code)
|
|
843
|
+
|
|
844
|
+
Make sure Node.js can find the hook script:
|
|
353
845
|
|
|
354
846
|
```bash
|
|
355
|
-
npm
|
|
356
|
-
npm run build
|
|
357
|
-
npm run dev # watch mode
|
|
847
|
+
node $(npm root -g)/@offgridsec/kira-lite-mcp/hook.mjs
|
|
358
848
|
```
|
|
359
849
|
|
|
850
|
+
If it exits with no output, it's working. If it throws an error, check the path.
|
|
851
|
+
|
|
852
|
+
## Uninstall
|
|
853
|
+
|
|
854
|
+
### Remove from a single project
|
|
855
|
+
|
|
856
|
+
Delete the kira-lite section from your instructions file (`CLAUDE.md`, `.cursorrules`, `.windsurfrules`, etc.) and remove the MCP config entry.
|
|
857
|
+
|
|
858
|
+
For Claude Code projects, also remove kira-lite entries from `.claude/settings.local.json`.
|
|
859
|
+
|
|
860
|
+
### Remove globally
|
|
861
|
+
|
|
862
|
+
```bash
|
|
863
|
+
# Claude Code
|
|
864
|
+
claude mcp remove --scope user kira-lite
|
|
865
|
+
|
|
866
|
+
# npm
|
|
867
|
+
npm uninstall -g @offgridsec/kira-lite-mcp
|
|
868
|
+
|
|
869
|
+
# Remove config
|
|
870
|
+
rm -rf ~/.kira-lite
|
|
871
|
+
```
|
|
872
|
+
|
|
873
|
+
For Cursor/Windsurf/VS Code, remove the `kira-lite` entry from your MCP configuration file.
|
|
874
|
+
|
|
360
875
|
## Privacy
|
|
361
876
|
|
|
362
877
|
Kira-Lite collects **anonymous, non-personalized** telemetry (tool usage stats, rule IDs, scan durations). No source code, file paths, or personal data is ever collected.
|
|
363
878
|
|
|
364
879
|
**Opt out** by setting `KIRA_TELEMETRY=off` in your environment.
|
|
365
880
|
|
|
366
|
-
|
|
881
|
+
<details>
|
|
882
|
+
<summary><strong>Full privacy details</strong></summary>
|
|
883
|
+
|
|
884
|
+
### What we collect
|
|
885
|
+
|
|
886
|
+
- **Tool usage** — which scan tools are called (e.g. `scan_code`, `scan_file`)
|
|
887
|
+
- **Scan statistics** — number of lines scanned, number of findings, severity counts, scan duration
|
|
888
|
+
- **Vulnerability rule IDs and titles** — which rules triggered (e.g. `KIRA-JS-SQLI-001`, `CWE-89`)
|
|
889
|
+
- **Environment metadata** — Node.js version, platform (win32/linux/darwin), Kira-Lite version
|
|
890
|
+
- **Anonymous device ID** — a randomly generated UUID stored locally at `~/.kira-lite/device-id`
|
|
891
|
+
|
|
892
|
+
### What we do NOT collect
|
|
893
|
+
|
|
894
|
+
- **No source code** — your code never leaves your machine
|
|
895
|
+
- **No file paths** — we do not log file names or directory structures
|
|
896
|
+
- **No personal information** — no names, emails, IP addresses, or account identifiers
|
|
897
|
+
- **No code snippets** — scan findings reference rule IDs only, not your actual code
|
|
898
|
+
- **No project metadata** — no repository names, branch names, or commit hashes
|
|
899
|
+
|
|
900
|
+
### How to opt out
|
|
901
|
+
|
|
902
|
+
```bash
|
|
903
|
+
# macOS / Linux — add to ~/.bashrc or ~/.zshrc
|
|
904
|
+
export KIRA_TELEMETRY=off
|
|
905
|
+
```
|
|
906
|
+
|
|
907
|
+
```powershell
|
|
908
|
+
# Windows (PowerShell)
|
|
909
|
+
[System.Environment]::SetEnvironmentVariable("KIRA_TELEMETRY", "off", "User")
|
|
910
|
+
```
|
|
911
|
+
|
|
912
|
+
When telemetry is off, **no data is sent anywhere**. Kira-Lite functions exactly the same.
|
|
913
|
+
|
|
914
|
+
Telemetry is sent to [PostHog](https://posthog.com) (US region) using an anonymous device ID. This ID is a random UUID generated on first run and stored locally. It cannot be traced back to you.
|
|
915
|
+
|
|
916
|
+
Questions? Reach us at [contact@offgridsec.com](mailto:contact@offgridsec.com).
|
|
917
|
+
|
|
918
|
+
</details>
|
|
367
919
|
|
|
368
920
|
## License
|
|
369
921
|
|