Skip to content

Commit ae9ffd6

Browse files
authored
Implement a local MCP server to calculate the final line numbers of the security findings (#41)
* Implement a local MCP server to calculate the final line numbers of the security findings. * Resolve all the comments: move line numbers instructions to GEMINI.md, fix error with CWD.
1 parent 1df9af1 commit ae9ffd6

File tree

6 files changed

+1877
-2
lines changed

6 files changed

+1877
-2
lines changed

GEMINI.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ For each identified vulnerability, provide the following:
178178

179179
* **Vulnerability:** A brief name for the issue (e.g., "Cross-Site Scripting," "Hardcoded API Key").
180180
* **Severity:** Critical, High, Medium, or Low.
181-
* **Location:** The file path where the vulnerability was introduced.
181+
* **Location:** The file path where the vulnerability was introduced and the line numbers if that is available.
182182
* **Line Content:** The complete line of code where the vulnerability was found.
183183
* **Description:** A short explanation of the vulnerability and the potential impact stemming from this change.
184184
* **Recommendation:** A clear suggestion on how to remediate the issue within the new code.
@@ -259,6 +259,7 @@ For EVERY task, you MUST follow this procedure. This loop separates high-level s
259259
* **Action:** This phase begins when all analysis tasks in `SECURITY_ANALYSIS_TODO.md` are complete.
260260
* **Action:** Read the entire `DRAFT_SECURITY_REPORT.md` file.
261261
* **Action:** Critically review **every single finding** in the draft against the **"High-Fidelity Reporting & Minimizing False Positives"** principles and its five-question checklist.
262+
* **Action:** You must use the `gemini-cli-security` MCP server to get the line numbers for each finding. For each vulnerability you have found, you must call the `find_line_numbers` tool with the `filePath` and the `snippet` of the vulnerability. You will then add the `startLine` and `endLine` to the final report.
262263
* **Action:** Construct the final, clean report in your memory.
263264
264265
5. **Phase 4: Final Reporting & Cleanup**

gemini-extension.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
{
22
"name": "gemini-cli-security",
33
"version": "0.1.0",
4-
"contextFileName": "GEMINI.md"
4+
"contextFileName": "GEMINI.md",
5+
"mcpServers": {
6+
"securityServer": {
7+
"command": "node",
8+
"args": ["${extensionPath}/mcp-server/security.ts"]
9+
}
10+
}
511
}

0 commit comments

Comments
 (0)