{"at":"2026-11-23T05:03:17.832Z","dir":"sent","era":"server_discover","message":{"id":1,"jsonrpc":"2.0","method":"server/discover","params":{"_meta":{"io.modelcontextprotocol/clientCapabilities":{},"io.modelcontextprotocol/clientInfo":{"name":"didrun-lab","version":"0.1.0"},"io.modelcontextprotocol/protocolVersion":"2026-07-28"}}}}
{"at":"2026-11-23T05:03:18.162Z","dir":"received","era":"server_discover","message":{"error":{"code":-32601,"message":"Method not found: server/discover"},"id":1,"jsonrpc":"2.0"}}
{"at":"2026-11-23T05:03:18.262Z","dir":"sent","era":"initialize","message":{"id":1,"jsonrpc":"2.0","method":"initialize","params":{"capabilities":{},"clientInfo":{"name":"didrun-lab","version":"0.1.0"},"protocolVersion":"2025-11-25"}}}
{"at":"2026-11-23T05:03:18.633Z","dir":"received","era":"initialize","message":{"id":1,"jsonrpc":"2.0","result":{"capabilities":{"tools":{}},"protocolVersion":"2024-11-05","serverInfo":{"name":"code-health-suite","version":"0.8.0"}}}}
{"at":"2026-11-23T05:03:18.633Z","dir":"sent","era":"initialize","message":{"jsonrpc":"2.0","method":"notifications/initialized"}}
{"at":"2026-11-23T05:03:18.633Z","dir":"sent","era":"initialize","message":{"id":2,"jsonrpc":"2.0","method":"tools/list","params":{}}}
{"at":"2026-11-23T05:03:18.633Z","dir":"received","era":"initialize","message":{"id":2,"jsonrpc":"2.0","result":{"tools":[{"description":"Analyze Python code complexity for a file or directory. Returns per-function metrics: cyclomatic complexity (McCabe), cognitive complexity, nesting depth, function length, and letter grades (A-F).","inputSchema":{"properties":{"path":{"description":"File or directory path to analyze.","type":"string"},"sort_by":{"default":"complexity","description":"Sort metric (default: complexity).","enum":["complexity","cognitive","length","nesting"],"type":"string"},"threshold":{"default":10,"description":"Cyclomatic complexity threshold (default: 10).","type":"integer"},"top":{"default":20,"description":"Return only top N functions by complexity. 0 = all.","type":"integer"}},"required":["path"],"type":"object"},"name":"analyze_complexity"},{"description":"Get an overall complexity health score (0-100) with letter grade (A-F), complexity profile classification, and top offenders. Quick project health check.","inputSchema":{"properties":{"path":{"description":"Directory path to analyze.","type":"string"}},"required":["path"],"type":"object"},"name":"get_complexity_score"},{"description":"Detect unused imports, functions, variables, and arguments in Python code. Supports cross-module analysis to reduce false positives.","inputSchema":{"properties":{"category":{"description":"Filter by category. Omit for all categories.","enum":["unused-import","unused-function","unused-variable","unused-argument"],"type":"string"},"min_severity":{"default":"info","description":"Minimum severity level (default: info).","enum":["info","low","medium","high","critical"],"type":"string"},"path":{"description":"File or directory path to scan.","type":"string"}},"required":["path"],"type":"object"},"name":"find_dead_code"},{"description":"Scan Python code for security vulnerabilities: command injection, SQL injection, path traversal, hardcoded secrets, unsafe deserialization, XSS, and more. Maps findings to CWE identifiers.","inputSchema":{"properties":{"path":{"description":"File or directory path to scan.","type":"string"}},"required":["path"],"type":"object"},"name":"security_scan"},{"description":"Get an overall security health score (0-100) with grade, profile, and top vulnerability rules. Quick security posture assessment.","inputSchema":{"properties":{"path":{"description":"Directory path to scan.","type":"string"}},"required":["path"],"type":"object"},"name":"get_security_score"},{"description":"Analyze Python import dependency graph. Returns module metrics, circular dependencies (cycles), orphan modules, hub modules, and instability scores. Use to understand project architecture.","inputSchema":{"properties":{"path":{"description":"Root directory of the Python project to analyze.","type":"string"}},"required":["path"],"type":"object"},"name":"analyze_imports"},{"description":"Get an import graph health score (0-100) with grade. Penalizes circular dependencies, orphan modules, unstable modules, and hub concentration. Quick architecture health check.","inputSchema":{"properties":{"path":{"description":"Root directory to analyze.","type":"string"}},"required":["path"],"type":"object"},"name":"get_import_health"},{"description":"Detect code clones (duplicated code blocks) in a Python project. Finds Type-1 (exact), Type-2 (renamed), and Type-3 (near-miss) clones. Returns clone pairs with similarity scores and cluster analysis.","inputSchema":{"properties":{"min_lines":{"default":5,"description":"Minimum function length to consider (default: 5).","type":"integer"},"path":{"description":"Directory path to scan for clones.","type":"string"},"threshold":{"default":0.8,"description":"Similarity threshold 0.0-1.0 (default: 0.8).","type":"number"}},"required":["path"],"type":"object"},"name":"find_clones"},{"description":"Analyze test suite quality: assertion density, test length, naming conventions, magic numbers, and more. Returns per-file and per-test metrics with a quality score (0-100) and grade.","inputSchema":{"properties":{"max_length":{"default":50,"description":"Max test function length before flagging (default: 50).","type":"integer"},"path":{"description":"Root directory containing test files.","type":"string"}},"required":["path"],"type":"object"},"name":"analyze_test_quality"},{"description":"Find code hotspots — files with high git churn AND high complexity. These are the riskiest files in a project: frequently changed AND hard to understand. Requires a git repository. Returns hotspot scores, risk levels, and churn/complexity breakdown.","inputSchema":{"properties":{"path":{"description":"Git repository root path.","type":"string"},"since_days":{"default":180,"description":"Look back N days for churn data (default: 180).","type":"integer"},"top":{"default":20,"description":"Return top N hotspots (default: 20).","type":"integer"}},"required":["path"],"type":"object"},"name":"find_hotspots"},{"description":"Get overall hotspot health score (0-100) with grade. Measures concentration of risk (churn x complexity). Lower scores indicate more hotspots that need attention.","inputSchema":{"properties":{"path":{"description":"Git repository root path.","type":"string"}},"required":["path"],"type":"object"},"name":"get_hotspot_score"},{"description":"Audit Python project dependencies for outdated packages and known vulnerabilities. Reads requirements.txt and/or pyproject.toml. Returns per-dependency status, latest versions, and CVE/vulnerability details.","inputSchema":{"properties":{"path":{"description":"Project root directory containing requirements.txt or pyproject.toml.","type":"string"}},"required":["path"],"type":"object"},"name":"audit_dependencies"},{"description":"Analyze the ripple effect of changing specific files. Shows direct dependents, transitive impact, affected tests, and an impact score (fraction of project affected). Use before refactoring to understand blast radius.","inputSchema":{"properties":{"changed_files":{"description":"List of file paths (relative to root) that are being changed.","items":{"type":"string"},"type":"array"},"max_depth":{"default":10,"description":"Max transitive dependency depth (default: 10).","type":"integer"},"path":{"description":"Project root directory.","type":"string"}},"required":["path","changed_files"],"type":"object"},"name":"analyze_change_impact"},{"description":"Analyze module coupling metrics: afferent coupling (Ca), efferent coupling (Ce), instability (Ce/(Ca+Ce)), and hub scores. Identifies tightly-coupled modules that may resist change.","inputSchema":{"properties":{"path":{"description":"Project root directory.","type":"string"}},"required":["path"],"type":"object"},"name":"analyze_coupling"},{"description":"Analyze Python type annotation coverage: function signatures, parameters, return types, Any usage, and type: ignore comments. Returns per-file metrics and coverage percentages.","inputSchema":{"properties":{"path":{"description":"File or directory path to analyze.","type":"string"}},"required":["path"],"type":"object"},"name":"analyze_type_coverage"},{"description":"Get overall type coverage health score (0-100) with grade. Measures annotation completeness, Any usage, and type: ignore density.","inputSchema":{"properties":{"path":{"description":"File or directory path to analyze.","type":"string"}},"required":["path"],"type":"object"},"name":"get_type_score"},{"description":"Audit environment variable usage: find undefined vars referenced in code, unused vars in .env files, secrets in templates, and missing .env.example entries. Supports Python, JavaScript, and shell scripts.","inputSchema":{"properties":{"path":{"description":"Project root directory.","type":"string"}},"required":["path"],"type":"object"},"name":"audit_env_vars"},{"description":"Audit recent git commits in a repository. Extracts changed files and runs static analysis (security scan, complexity) on each commit. Returns per-commit grades, security findings, and complexity violations.","inputSchema":{"properties":{"author":{"description":"Filter commits by author name.","type":"string"},"commits":{"default":10,"description":"Number of recent commits to audit (default: 10).","type":"integer"},"repo":{"description":"Path to the git repository to audit.","type":"string"},"severity":{"default":"low","description":"Minimum security finding severity (default: low).","enum":["critical","high","medium","low","info"],"type":"string"},"since":{"description":"Audit commits since date (e.g., '3 days ago', '2026-03-01').","type":"string"},"threshold":{"default":10,"description":"Complexity threshold for flagging functions (default: 10).","type":"integer"}},"required":["repo"],"type":"object"},"name":"audit_git_commits"},{"description":"Get a quick overall grade and score for recent commits in a repo. Returns the aggregate score, grade, commit count, and security summary.","inputSchema":{"properties":{"commits":{"default":10,"description":"Number of recent commits to audit (default: 10).","type":"integer"},"repo":{"description":"Path to the git repository.","type":"string"}},"required":["repo"],"type":"object"},"name":"get_git_audit_score"},{"description":"Check Python naming conventions (PEP 8). Detects violations: functions/methods must be snake_case, classes must be CamelCase, constants must be UPPER_SNAKE_CASE. Returns violations with suggestions.","inputSchema":{"properties":{"path":{"description":"File or directory path to check.","type":"string"}},"required":["path"],"type":"object"},"name":"check_naming"},{"description":"Get a naming convention health score (0-100) with grade. Measures PEP 8 naming compliance: snake_case functions, CamelCase classes, UPPER_SNAKE_CASE constants.","inputSchema":{"properties":{"path":{"description":"Directory path to check.","type":"string"}},"required":["path"],"type":"object"},"name":"get_naming_score"},{"description":"Scan source code for technical debt markers: TODO, FIXME, HACK, XXX, BUG, NOTE, OPTIMIZE, REFACTOR comments. Returns items with file, line, tag, severity, and message. Optionally enriches with git blame metadata.","inputSchema":{"properties":{"blame":{"default":false,"description":"Enrich with git blame metadata (author, date). Slower.","type":"boolean"},"path":{"description":"File or directory path to scan.","type":"string"},"severity":{"description":"Filter by minimum severity level.","enum":["high","medium","low"],"type":"string"},"tag":{"description":"Filter by specific tag (e.g., TODO, FIXME, HACK).","type":"string"}},"required":["path"],"type":"object"},"name":"scan_todos"},{"description":"Get a technical debt health score (0-100) with grade based on density and severity of TODO/FIXME/HACK markers. Shows hotspot files.","inputSchema":{"properties":{"path":{"description":"Directory path to scan.","type":"string"}},"required":["path"],"type":"object"},"name":"get_todo_score"},{"description":"Detect common Python semantic bugs using AST analysis. Finds 8 categories: missing f-strings, mutable class variables, late-binding closures, call-expression defaults (datetime.now()), mutable default arguments, assert-on-tuple, unreachable code, and unreachable exception handlers. Every finding indicates a likely real bug, not a style violation.","inputSchema":{"properties":{"min_severity":{"default":"info","description":"Minimum severity to report (default: info).","enum":["error","warning","info"],"type":"string"},"path":{"description":"File or directory path to scan.","type":"string"},"rules":{"description":"Filter by specific rules. Options: missing-fstring, mutable-class-var, late-binding-closure, call-default, mutable-default-arg, assert-tuple, unreachable-code, unreachable-except. Omit for all rules.","items":{"type":"string"},"type":"array"}},"required":["path"],"type":"object"},"name":"detect_bugs"},{"description":"Get a bug detection health score (0-100) with grade (A-F), bug profile classification (clean/fstring_heavy/closure_heavy/etc.), and breakdown by rule and severity. Quick bug health check.","inputSchema":{"properties":{"path":{"description":"Directory path to scan.","type":"string"}},"required":["path"],"type":"object"},"name":"get_bug_score"},{"description":"Audit Python docstring coverage and quality. Checks public functions, methods, classes, and modules for missing or low-quality docstrings. Returns per-entity coverage, missing docstrings, and quality issues.","inputSchema":{"properties":{"path":{"description":"File or directory path to audit.","type":"string"}},"required":["path"],"type":"object"},"name":"audit_docstrings"},{"description":"Get a docstring coverage health score (0-100) with grade. Measures what percentage of public entities have docstrings and penalizes low-quality docstrings. Shows worst files.","inputSchema":{"properties":{"path":{"description":"Directory path to audit.","type":"string"}},"required":["path"],"type":"object"},"name":"get_docstring_score"},{"description":"Run all analyses (complexity + dead code + security + imports + clones + test quality + type coverage + env audit + naming + TODO debt + bug detection + docstring coverage) on a Python project and return a combined health report with scores, grades, and top issues. Note: hotspot, dependency, and change impact require additional context (git repo, requirements files, changed files) so are excluded from this scan.","inputSchema":{"properties":{"path":{"description":"Directory path to analyze.","type":"string"}},"required":["path"],"type":"object"},"name":"full_health_check"}]}}}
