{"at":"2026-11-23T02:36:15.840Z","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-23T02:36:16.481Z","dir":"received","era":"server_discover","message":{"error":{"code":-32601,"message":"Method not found: server/discover"},"id":1,"jsonrpc":"2.0"}}
{"at":"2026-11-23T02:36:16.582Z","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-23T02:36:17.163Z","dir":"received","era":"initialize","message":{"id":1,"jsonrpc":"2.0","result":{"capabilities":{"tools":{"listChanged":false}},"instructions":"CodeDiag statically analyzes Node.js projects. Use find_unprotected_routes when asked which API routes, form actions, or procedures lack auth or input validation; scan_project for an overall health or security review; explain_rule to explain the rule ID in a finding. Pass the project's absolute path as `path`: this server's working directory may not be the project. Findings are heuristic: open the cited file and check where auth actually runs before telling the user a route is vulnerable. Routes that are public on purpose, such as sign-in, health checks, or signed webhooks, can be suppressed with a `// codediag-ignore-next-line <rule> -- <reason>` comment.","protocolVersion":"2025-11-25","serverInfo":{"name":"codediag","title":"CodeDiag","version":"0.13.0"}}}}
{"at":"2026-11-23T02:36:17.163Z","dir":"sent","era":"initialize","message":{"jsonrpc":"2.0","method":"notifications/initialized"}}
{"at":"2026-11-23T02:36:17.163Z","dir":"sent","era":"initialize","message":{"id":2,"jsonrpc":"2.0","method":"tools/list","params":{}}}
{"at":"2026-11-23T02:36:17.163Z","dir":"received","era":"initialize","message":{"id":2,"jsonrpc":"2.0","result":{"tools":[{"annotations":{"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"description":"List the API routes, form actions, and procedures in a Node.js project that anyone can call: no recognizable auth check, or no input validation. Understands where auth runs in Next.js, SvelteKit, React Router/Remix, Express, Fastify, Hono, Elysia, NestJS, and tRPC (middleware and its matcher, hooks, guards, route middleware, tRPC context). Runs offline. Static analysis: read the cited file before calling a route vulnerable.","inputSchema":{"additionalProperties":false,"properties":{"check":{"description":"auth: routes without an auth check; validation: routes without input validation; both (default).","enum":["auth","validation","both"],"type":"string"},"maxResults":{"description":"The most routes to return. Defaults to 100.","maximum":500,"minimum":1,"type":"integer"},"path":{"description":"Absolute path of the project directory. Pass it: the server's working directory may not be the project. A relative path resolves against that working directory, the default.","type":"string"}},"type":"object"},"name":"find_unprotected_routes","outputSchema":{"properties":{"directory":{"type":"string"},"framework":{"type":"string"},"omitted":{"type":"number"},"project":{"type":"string"},"routes":{"items":{"properties":{"check":{"enum":["auth","validation"],"type":"string"},"confidence":{"enum":["high","medium","low"],"type":"string"},"file":{"type":"string"},"fix":{"type":"string"},"line":{"type":"number"},"message":{"type":"string"},"rule":{"type":"string"},"severity":{"enum":["critical","warning","info"],"type":"string"}},"required":["check","rule","severity","message"],"type":"object"},"type":"array"},"summary":{"type":"string"},"supported":{"type":"boolean"},"suppressed":{"type":"number"}},"required":["project","directory","framework","supported","summary","routes","suppressed","omitted"],"type":"object"},"title":"Find unprotected API routes"},{"annotations":{"idempotentHint":true,"openWorldHint":true,"readOnlyHint":true},"description":"Run a full CodeDiag scan of a Node.js project: a 0-100 health score with API health, security, dependency, test, and structure findings, each with a rule ID, file, line, and suggested fix. Security includes Supabase tables without row level security, from supabase/migrations. Most severe findings first. Offline unless audit is true.","inputSchema":{"additionalProperties":false,"properties":{"audit":{"description":"Also run the package manager's vulnerability audit, which needs network access. Defaults to false.","type":"boolean"},"maxFindings":{"description":"The most findings to return. Defaults to 50.","maximum":500,"minimum":1,"type":"integer"},"minSeverity":{"description":"Leave out findings below this severity. Defaults to warning.","enum":["critical","warning","info"],"type":"string"},"path":{"description":"Absolute path of the project directory. Pass it: the server's working directory may not be the project. A relative path resolves against that working directory, the default.","type":"string"}},"type":"object"},"name":"scan_project","outputSchema":{"properties":{"analyzers":{"items":{"properties":{"findings":{"type":"number"},"name":{"type":"string"},"score":{"type":"number"}},"required":["name","score","findings"],"type":"object"},"type":"array"},"directory":{"type":"string"},"findings":{"items":{"properties":{"analyzer":{"type":"string"},"confidence":{"enum":["high","medium","low"],"type":"string"},"file":{"type":"string"},"fix":{"type":"string"},"line":{"type":"number"},"message":{"type":"string"},"rule":{"type":"string"},"severity":{"enum":["critical","warning","info"],"type":"string"}},"required":["analyzer","rule","severity","message"],"type":"object"},"type":"array"},"framework":{"type":"string"},"grade":{"type":"string"},"omitted":{"type":"number"},"project":{"type":"string"},"score":{"type":"number"},"summary":{"type":"string"}},"required":["project","directory","framework","score","grade","summary","analyzers","findings","omitted"],"type":"object"},"title":"Scan project health"},{"annotations":{"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"description":"Explain a CodeDiag rule ID (the ID in a finding, such as missing-auth-check): what it detects, its severity, CWE and OWASP mapping, documentation link, and how to suppress a finding that is intentional.","inputSchema":{"additionalProperties":false,"properties":{"ruleId":{"description":"The rule ID, for example missing-auth-check.","type":"string"}},"required":["ruleId"],"type":"object"},"name":"explain_rule","outputSchema":{"properties":{"analyzer":{"type":"string"},"cwe":{"items":{"type":"string"},"type":"array"},"defaultSeverity":{"enum":["critical","warning","info"],"type":"string"},"description":{"type":"string"},"docs":{"type":"string"},"id":{"type":"string"},"owasp":{"items":{"type":"string"},"type":"array"},"suppress":{"type":"string"},"title":{"type":"string"}},"required":["id","title","analyzer","defaultSeverity","description","cwe","owasp","docs","suppress"],"type":"object"},"title":"Explain a CodeDiag rule"}]}}}
