mcpField
C
CodeQL MCP Server

CodeQL MCP Server

Local
github.com/JordyZomerSecurity147Updated 82w ago

About CodeQL MCP Server

An MCP server that wraps the CodeQL query server for Cursor and AI agents. It provides structured operations for database registration, query execution, result decoding, symbol lookup, and documentation search.

Key features

  1. 01Register CodeQL databases
  2. 02Run full and quick queries
  3. 03Decode BQRS files to JSON
  4. 04Locate predicate and class symbols
  5. 05Search CodeQL documentation

Use cases

  1. 01Run CodeQL queries from an AI client
  2. 02Evaluate a symbol during code analysis
  3. 03Convert BQRS output for inspection
  4. 04Find a predicate or class definition

MCP support

Exposes CodeQL query-server operations to MCP clients, including database registration, query execution, BQRS decoding, symbol locations, and documentation search.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

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 and doc search.


Features

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

File Structure

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

Requirements

Install with uv:

uv pip install -r requirements.txt

or with pip:

pip install fastmcp httpx

Running the MCP Server

uv run mcp run server.py -t sse

Cursor Config

Make sure your .cusor/config.json contains:

{
  "mcpServers": {
    "CodeQL": {
      "url": "http://localhost:8000/sse"
    }
  }
}

Notes

  • Tools like Cursor will invoke these commands directly via natural language.
  • You must have a codeql binary in your $PATH, or hardcode its path in codeqlclient.py.
  • You should probably specify query locations, query write locations and database paths in your prompts.

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.