home / mcp / codeql mcp server
Provides a CodeQL-based MCP server that runs queries, decodes results, and supports symbol lookups via a live SSE endpoint.
Configuration
View docs{
"mcpServers": {
"jordyzomer-codeql-mcp": {
"url": "http://localhost:8000/sse"
}
}
}You set up an MCP server that wraps the CodeQL query infrastructure, exposing a structured API so tools and AI agents can run queries, inspect results, and search documentation through clear commands.
Connect your MCP client to the CodeQL MCP Server at the URL provided when the server is running. You can register CodeQL databases, run full queries or quick-evaluate symbols, decode .bqrs files into JSON, and locate symbol positions. Use natural language prompts to issue these capabilities through your client, and rely on the server to translate your requests into CodeQL actions.
Prerequisites: ensure you have Python available and a tool to run MCP servers. You will also need a CodeQL binary accessible in your system PATH.
uv pip install -r requirements.txtAlternatively, you can install the MCP runtime dependencies directly with pip.
pip install fastmcp httpxLaunch the MCP server so it serves requests over the SSE endpoint. The server will listen at the specified URL for client connections.
uv run mcp run server.py -t sseConfigure your MCP client to point at the server URL. If you use a Cursor-like tool, place the URL in its MCP configuration so it can issue queries to CodeQL through the MCP server.
Example MCP server connection configuration for your client:
{
"mcpServers": {
"CodeQL": {
"url": "http://localhost:8000/sse"
}
}
}Register CodeQL databases so they can be used by queries and symbol lookups.
Execute full CodeQL queries or perform quick-evaluate operations on a given symbol.
Decode .bqrs results into JSON for easy consumption by clients.
Locate predicate or class symbol positions within codebase contexts.