CodeQL

v1.0.0Securitystable

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 agents to interact with CodeQL through structured commands.

codeqlmcpai-integration
Share:
146
Stars
0
Downloads
0
Weekly
0/5

What is CodeQL?

CodeQL is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to 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 agents to interact with codeql through structured c...

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 agents to interact with CodeQL through structured commands.

This server falls under the Security category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • This project runs a Model Context Protocol (MCP) server that

Use Cases

Run CodeQL security queries on codebases
Detect vulnerabilities and suspicious patterns
Integrate with AI code analysis tools
JordyZomer

Maintainer

LicenseMIT
Languagepython
Versionv1.0.0
UpdatedMay 6, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

NPM

npx -y codeql

Manual Installation

npx -y codeql

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use CodeQL

The CodeQL MCP server wraps GitHub's CodeQL query server behind the Model Context Protocol, enabling AI tools like Cursor and AI agents to run static security analysis queries on codebases through structured natural language commands. It supports registering CodeQL databases, executing full queries or evaluating specific symbols, and converting binary result files to JSON — bridging the gap between conversational AI interfaces and industrial-strength code vulnerability detection.

Prerequisites

  • CodeQL CLI installed and available on your PATH (download from https://github.com/github/codeql-cli-binaries/releases)
  • Python 3.9+ with pip or uv package manager
  • A CodeQL database for the codebase you want to analyze (created with codeql database create)
  • Cursor or another MCP-compatible client that supports SSE transport
1

Install Python dependencies

Install the required Python packages using either uv or pip.

# Using uv (recommended)
uv pip install -r requirements.txt

# Or using pip directly
pip install fastmcp httpx
2

Clone the repository

Download the CodeQL MCP server source code from GitHub.

git clone https://github.com/JordyZomer/codeql-mcp.git
cd codeql-mcp
3

Verify CodeQL is on your PATH

The server requires a codeql binary to be accessible. Test it is available, or edit codeqlclient.py to hardcode the path if needed.

which codeql
codeql --version
4

Start the MCP server

Launch the server using SSE transport. It will listen on http://localhost:8000/sse by default.

uv run mcp run server.py -t sse
5

Configure Cursor to connect

Add the CodeQL MCP server to your Cursor configuration file at .cursor/config.json.

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

Create a CodeQL database for your project

Before running queries, you need a CodeQL database for the codebase you want to analyze. Use the CodeQL CLI to create one.

codeql database create /path/to/db --language=javascript --source-root /path/to/your/project

CodeQL Examples

Client configuration

Cursor configuration to connect to the locally running CodeQL MCP server via SSE.

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

Prompts to try

Example prompts to use with the CodeQL MCP server through an AI coding tool.

- "Register the CodeQL database at /path/to/myproject-db and list available query packs"
- "Run a taint-tracking query to find SQL injection vulnerabilities in /path/to/myproject-db"
- "Evaluate the main predicate of my query at /queries/find-xss.ql on the database"
- "Convert the results at /tmp/results.bqrs to JSON so I can read them"
- "Find where the getUserInput function is defined in the codebase"

Troubleshooting CodeQL

'codeql: command not found' when starting the server

Download the CodeQL CLI from https://github.com/github/codeql-cli-binaries/releases, extract it, and add the directory to your PATH. Alternatively, open codeqlclient.py in the repository and hardcode the full path to the codeql binary.

Server starts but Cursor cannot connect at localhost:8000

Ensure the server is running (check terminal for errors) and that port 8000 is not blocked. Verify the URL in Cursor config is http://localhost:8000/sse with the /sse path included.

Query execution fails with database error

Make sure the CodeQL database was created for the correct language and points to a valid path. Re-create the database if the project source has changed significantly since the database was created.

Frequently Asked Questions about CodeQL

What is CodeQL?

CodeQL is a Model Context Protocol (MCP) server that 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 agents to interact with codeql through structured commands. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install CodeQL?

Install via npm with the command: npx -y codeql. Then add the server configuration to your AI client's JSON config file (e.g., claude_desktop_config.json or .cursor/mcp.json).

Which AI clients work with CodeQL?

CodeQL works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is CodeQL free to use?

Yes, CodeQL is open source and available under the MIT license. You can use it freely in both personal and commercial projects.

CodeQL Alternatives — Similar Security Servers

Looking for alternatives to CodeQL? Here are other popular security servers you can use with Claude, Cursor, and VS Code.

Casdoor

13.6k

An open-source Agent-first Identity and Access Management (IAM) /LLM MCP & agent gateway and auth server with web UI supporting OpenClaw, MCP, OAuth, OIDC, SAML, CAS, LDAP, SCIM, WebAuthn, TOTP, MFA, Face ID, Google Workspace, Azure AD

ghidraMCP

9.0k

An Model Context Protocol server that enables LLMs to autonomously reverse engineer applications by exposing Ghidra's decompilation and analysis tools. It allows AI agents to list code structures, rename methods, and analyze binaries directly through

HexStrike AI

8.9k

HexStrike AI MCP Agents is an advanced MCP server that lets AI agents (Claude, GPT, Copilot, etc.) autonomously run 150+ cybersecurity tools for automated pentesting, vulnerability discovery, bug bounty automation, and security research. Seamlessly b

IDA Pro MCP

8.7k

Enables AI-assisted reverse engineering in IDA Pro by providing tools to analyze binaries, decompile functions, manage comments, search patterns, and interact with the IDA database through natural language.

Anthropic Cybersecurity Skills

6.6k

754 structured cybersecurity skills for AI agents · Mapped to 5 frameworks: MITRE ATT&CK, NIST CSF 2.0, MITRE ATLAS, D3FEND & NIST AI RMF · agentskills.io standard · Works with Claude Code, GitHub Copilot, Codex CLI, Cursor, Gemini CLI & 20+ platform

Hooker

5.1k

🔥🔥 hooker is a Frida-based reverse engineering toolkit for Android. It offers a user-friendly CLI, universal scripts, auto hook generation, memory roaming to detect activities/services, one-click SOCKS5 proxy setup, Frida JustTrustMe, and BoringSSL u

Browse More Security MCP Servers

Explore all security servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "codeql": { "command": "npx", "args": ["-y", "codeql"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use CodeQL?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides