MCP Integration
Let your AI assistant read findings, fix code, and verify fixes, without leaving your editor.
What Is MCP?
MCP (Model Context Protocol) is a standard that lets AI tools call functions on external servers. Think of it like an API, but designed for AI assistants instead of browsers. When brakit is running, your AI assistant can ask “what security issues exist?” and get back structured data it can act on.
Setup
Add this to your editor's MCP configuration. The exact file depends on your editor:
Claude Code and Cursor both use .mcp.json in your project root:
{
"mcpServers": {
"brakit": {
"command": "npx",
"args": ["brakit", "mcp"]
}
}
}npx brakit install automatically creates this .mcp.json file. You may not need to do this manually.How It Works
The MCP server runs as a separate process alongside your app. It discovers your running brakit instance by reading the port file at .brakit/port, then calls the same dashboard API that powers the browser UI. The AI assistant gets structured data back, not HTML, not screenshots, but actual findings and metrics it can reason about.
Available Tools
The MCP server exposes 6 tools. Each is a function your AI assistant can call:
The Fix Loop
Here's what a typical AI-assisted fix looks like:
- AI calls
get_findings, sees 3 open issues - AI calls
get_request_detailon the worst one, sees the exact SQL query - AI reads your source code and fixes it
- You re-trigger the endpoint (reload the page, resubmit the form)
- AI calls
verify_fix, confirms the issue is gone
Finding Lifecycle
Every finding brakit detects goes through a lifecycle:
Findings persist across app restarts in .brakit/findings.json. Each finding gets a stable ID (SHA-256 hash of the rule, endpoint, and description) so the AI can refer to it consistently.