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 interact with CodeQL through structured commands. That is what the codeql mcp server brings to an AI assistant: the same capability, reachable through the Model Context Protocol rather than a separate app or dashboard.

The short version

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

Getting it running

Installation goes through your MCP client rather than a global install: point it at fastmcp on PyPI and it is fetched when the client starts. The copy-paste blocks for Claude Desktop, Claude Code and Cursor are further down this page.

The tools it exposes

The server publishes 3 tools. What each one is for:

  • File — Purpose
  • server.py — Main FastMCP server exposing CodeQL tools
  • codeqlclient.py — CodeQLQueryServer implementation (JSON-RPC handler)

What it needs from you

Install with uv: or with pip:

Things to watch

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • Keep per-call confirmation enabled while you learn its behaviour; it is the cheapest safeguard you have.

How it compares

Plenty of developer tooling servers cover similar ground. The differences that matter in practice are scope of access and how much setup stands between you and a working tool call. CodeQL's toolset — File, server.py, codeqlclient.py — is a fair guide to whether it matches your workflow. It is maintained by JordyZomer; worth a glance at recent repository activity before you build anything load-bearing on it.

SyncDev reviews every entry in this directory against the project's own documentation before publishing, and revisits them as servers change.

Available tools

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

How to install the CodeQL MCP server

{
  "mcpServers": {
    "codeql": {
      "command": "uvx",
      "args": ["fastmcp"]
    }
  }
}

Add to claude_desktop_config.json, then restart Claude Desktop.

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`).