A straightforward wrapper around CodeQL's JSON-RPC query server that lets you register databases, run queries, and decode BQRS files through MCP tools. You can quick-evaluate symbols, locate predicate positions, and perform full CodeQL analysis directly from Cursor or other AI coding assistants. Requires CodeQL binary in your PATH and handles the JSON-RPC communication so you don't have to. Useful when you want to integrate static analysis into your AI-assisted workflow without manually switching between your editor and CodeQL command line tools.
This project runs a Model Context Protocol (MCP) server that wraps the CodeQL query server. It enables tools like Cursor or AI agents to interact with CodeQL through structured commands and doc search.
.bqrs files into JSON| File | Purpose |
|---|---|
server.py | Main FastMCP server exposing CodeQL tools |
codeqlclient.py | CodeQLQueryServer implementation (JSON-RPC handler) |
Install with uv:
uv pip install -r requirements.txt
or with pip:
pip install fastmcp httpx
uv run mcp run server.py -t sse
Make sure your .cusor/config.json contains:
{
"mcpServers": {
"CodeQL": {
"url": "http://localhost:8000/sse"
}
}
}