Skip to main content

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

File Purpose
server.py Main FastMCP server exposing CodeQL tools
codeqlclient.py CodeQLQueryServer 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
  • Starts the server at http://localhost:8000/sse
  • Required for Cursor or AI agent use

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.

Metadata

Release files for iflow-mcp_jordyzomer_codeql-mcp 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for iflow-mcp_jordyzomer_codeql-mcp 1.0.0
File Size Uploaded
iflow_mcp_jordyzomer_codeql_mcp-1.0.0.tar.gz 5.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for iflow-mcp_jordyzomer_codeql-mcp 1.0.0
File Interpreter ABI Platform
iflow_mcp_jordyzomer_codeql_mcp-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 10.9 kB

Release files / iflow_mcp_jordyzomer_codeql_mcp-1.0.0.tar.gz

Download URL iflow_mcp_jordyzomer_codeql_mcp-1.0.0.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
6a1a65d627cf0b9c4f1b8ac41a493d97628e2924565db528738cb1d9b3b4ec89
BLAKE2b-256 checksum
How to use checksums
f48b0cd6fea97d225247b1892a64083b6017c056c033660c5c07de06909524ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / iflow_mcp_jordyzomer_codeql_mcp-1.0.0-py3-none-any.whl

Download URL iflow_mcp_jordyzomer_codeql_mcp-1.0.0-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c346e46d4c4ce9a64c0b712b9c47d211944d25f1561cd47c9d7b6fbb8ae832bb
BLAKE2b-256 checksum
How to use checksums
e2c776631c315a6d2ba019feafaee96b0fb004a30675ae6e1e7a2058b0986382
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page