MCP Server for scanning Python files for security vulnerabilities using Bandit, Semgrep, and Gemini AI analysis. Runs on macOS and Linux with local filesystem access.
Single tool 'scan_file' has a clear, detailed description (180+ chars) and proper input schema with type and description. However, the tool lacks output schema documentation, critical for LLM planning. No error handling guidance (e.g., 'file not found' recovery). Parameter description is good but could specify format constraints (absolute path only, .py files). No tool annotations (readOnlyHint, idempotentHint). The implementation shows defensive coding (file existence checks, permission handling) but this is not reflected in the tool contract. Baseline: 194 chars avg description (this tool ~180), but missing output schema and error recovery patterns drops score significantly.
Scan a LOCAL Python file on the user's macOS machine for security vulnerabilities using Semgrep and Gemini AI analysis. IMPORTANT: - This tool runs directly on the user's local filesystem - Accept absolute macOS/Linux paths like: /Users/name/Projects/test.py - Do NOT ask the user to upload files - Use the provided local path directly
No output schema documented. LLM cannot plan downstream actions or extract structured results. Tool returns Markdown report string but this is not declared in the tool definition.
No error handling guidance in description. Implementation catches FileNotFoundError, PermissionError, subprocess timeouts, but tool description does not explain recovery paths (e.g., 'If file not found, verify the absolute path'). LLM has no guidance on what to do if scan fails.
Parameter 'file_path' description includes example value ('/Users/nebumohan/Desktop/...') which LLMs may reuse literally. Should use format constraint (regex or pattern) instead.
No tool annotations. Tool is read-only (scan only, no side effects) but lacks readOnlyHint annotation. Idempotent (same file scanned twice yields same results) but lacks idempotentHint. These hints help LLMs reason about retry safety and composition.
Inferred effective spec: <=2025-11-25.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | F | 47 | <=2025-11-25 | v2 |
Gemini API key exposed as environment variable without server-side secret injection pattern. If agent logs or traces tool calls, GEMINI_API_KEY could leak. Should use secure vault or config-only injection.