CodeQL MCP Server

This project runs a Model Context Protocol (MCP) server that wraps the CodeQL query server. It enables tools like [Cursor](https://cursor.sh/) or AI

Local serverstdio

What is the CodeQL MCP Server?

This project runs a Model Context Protocol (MCP) server that wraps the CodeQL query server. It enables tools like Cursor or AI agents to

The short version

  • ✅ Register CodeQL databases
  • ✅ Run full queries or quick-evaluate a symbol
  • ✅ Decode .bqrs files into JSON
  • ✅ Locate predicate/class symbol positions

What it needs from you

Install with uv: or with pip:

More MCP options

Compare MCP servers by category, or browse hosted MCP servers if you prefer an endpoint over a local process.

Maintainer setup documentation.

Recorded tools

Check the linked publisher documentation and your connected client's tool list. Names and availability can vary with the server version and account permissions.

ToolWhat it does
server.pyMain FastMCP server exposing CodeQL tools
codeqlclient.pyCodeQLQueryServer implementation (JSON-RPC handler)

Configuration

Install with uv: or with pip:

Example prompts to try

  • “Use CodeQL to File.”
  • “Use CodeQL to server.py.”
  • “Use CodeQL to codeqlclient.py.”

Frequently asked questions

Python packages `fastmcp` and `httpx` are required, and a `codeql` binary must be available in your `$PATH` (or its path can be hardcoded in `codeqlclient.py`).