|
1 | 1 | # CodeQL Development MCP Server |
2 | 2 |
|
3 | | -A comprehensive Model Context Protocol (MCP) server designed specifically for agentic AI development of CodeQL (QL) code. This server provides tools and resources to help AI assistants write, validate, and optimize CodeQL queries for security analysis and code quality. |
| 3 | +> Enabling AI-assisted CodeQL query development through the Model Context Protocol |
4 | 4 |
|
5 | | -## Quick Start |
| 5 | +A comprehensive [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server designed specifically for agentic AI development of CodeQL (QL) code. This server provides tools, prompts, and resources to help AI assistants write, validate, and optimize CodeQL queries for security analysis and code quality. |
6 | 6 |
|
7 | | -For users who want to quickly get started with the MCP server: |
| 7 | +## Features |
8 | 8 |
|
9 | | -### Download and Install |
| 9 | +- **Comprehensive Tool Suite** - Wraps CodeQL CLI commands for query compilation, execution, testing, and database operations |
| 10 | +- **Multi-Language Support** - Supports CodeQL query development for 9 languages including Python, JavaScript, Java, C/C++, and more |
| 11 | +- **AI-Optimized Prompts** - Built-in prompts and resources that guide AI assistants through CodeQL development workflows |
| 12 | +- **Test-Driven Development** - Integrated testing tools for validating query accuracy with expected results |
| 13 | +- **Flexible Transport** - Supports both stdio and HTTP transport modes for different integration scenarios |
10 | 14 |
|
11 | | -1. Download the latest release from [GitHub Releases](https://github.com/advanced-security/codeql-development-mcp-server/releases) |
12 | | -2. Extract the archive: |
| 15 | +## Limitations |
| 16 | + |
| 17 | +- Requires CodeQL CLI to be installed separately |
| 18 | +- Performance depends on the size of CodeQL databases being analyzed |
| 19 | +- Some advanced CodeQL CLI features may not yet be exposed as tools |
| 20 | + |
| 21 | +## Project Status |
| 22 | + |
| 23 | +**Active Development** - This project is actively maintained and used in production environments for AI-assisted CodeQL development. |
13 | 24 |
|
14 | | - ```bash |
15 | | - tar -xzvf codeql-development-mcp-server-vX.X.X.tar.gz -C /path/to/destination |
16 | | - ``` |
| 25 | +## Background |
17 | 26 |
|
18 | | -3. Configure VS Code by adding to your `mcp.json`: |
| 27 | +The `codeql-development-mcp-server` project is maintained by GitHub's CodeQL Expert Services team and builds (and hopefully improves) on the concepts from the [`advanced-security/codeql-development-template`](https://github.com/advanced-security/codeql-development-template) repository template. |
19 | 28 |
|
20 | | - ```json |
21 | | - { |
22 | | - "servers": { |
23 | | - "codeql-dev-mcp-server": { |
24 | | - "command": "node", |
25 | | - "args": ["/path/to/destination/server/dist/ql-mcp-server.js"], |
26 | | - "type": "stdio" |
27 | | - } |
28 | | - } |
29 | | - } |
30 | | - ``` |
| 29 | +The main advantages of using the `codeql-development-mcp-server` are: |
31 | 30 |
|
32 | | -## Contributing |
| 31 | +1. **Agnostic of development environment** |
| 32 | +2. **Agnostic of calling Large Language Model (LLM)** |
| 33 | +3. **MCP server tools codify advanced CodeQL development practices** |
33 | 34 |
|
34 | | -We welcome contributions to this project! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for detailed guidelines on how to contribute. |
| 35 | +### Roadmap |
| 36 | + |
| 37 | +Development priorities and open issues are tracked in [GitHub Issues](https://github.com/advanced-security/codeql-development-mcp-server/issues). |
| 38 | + |
| 39 | +### Contributing |
| 40 | + |
| 41 | +We welcome contributions! Whether it's bug fixes, new features, documentation improvements, or additional language support, please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines. |
35 | 42 |
|
36 | 43 | Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms. |
37 | 44 |
|
| 45 | +## Requirements |
| 46 | + |
| 47 | +### Environment |
| 48 | + |
| 49 | +- **Node.js** v25.2.1 or later ([nodejs.org](https://nodejs.org/)) |
| 50 | +- **Some calling LLM** Bring your own LLM, but some LLMs are (much) better than others. |
| 51 | + |
| 52 | +### External Dependencies |
| 53 | + |
| 54 | +- **CodeQL CLI** - Must be installed and available in PATH ([github.com/github/codeql-cli-binaries](https://github.com/github/codeql-cli-binaries/releases)) |
| 55 | + |
| 56 | +## Quick Start |
| 57 | + |
| 58 | +### Download and Install |
| 59 | + |
| 60 | +1. Download the latest release from [GitHub Releases](https://github.com/advanced-security/codeql-development-mcp-server/releases) |
| 61 | +2. Extract the archive: |
| 62 | + |
| 63 | +```bash |
| 64 | +unzip codeql-development-mcp-server-vX.X.X.zip -d /path/to/destination |
| 65 | +``` |
| 66 | + |
| 67 | +### VS Code Configuration |
| 68 | + |
| 69 | +Add to your `mcp.json` file: |
| 70 | + |
| 71 | +| OS | Location | |
| 72 | +| ------- | -------------------------------------------------- | |
| 73 | +| Linux | `~/.config/Code/User/mcp.json` | |
| 74 | +| macOS | `~/Library/Application Support/Code/User/mcp.json` | |
| 75 | +| Windows | `%APPDATA%\Code\User\mcp.json` | |
| 76 | + |
| 77 | +```json |
| 78 | +{ |
| 79 | + "servers": { |
| 80 | + "codeql-dev-mcp-server": { |
| 81 | + "command": "node", |
| 82 | + "args": ["/path/to/destination/server/dist/ql-mcp-server.js"], |
| 83 | + "type": "stdio" |
| 84 | + } |
| 85 | + } |
| 86 | +} |
| 87 | +``` |
| 88 | + |
| 89 | +### Installing from Source |
| 90 | + |
| 91 | +```bash |
| 92 | +git clone https://github.com/advanced-security/codeql-development-mcp-server.git |
| 93 | +cd codeql-development-mcp-server |
| 94 | +npm install && npm run build |
| 95 | +``` |
| 96 | + |
| 97 | +### Verification |
| 98 | + |
| 99 | +1. Restart VS Code |
| 100 | +2. Open Command Palette (`Ctrl+Shift+P` / `Cmd+Shift+P`) |
| 101 | +3. Run "GitHub Copilot: List MCP Servers" |
| 102 | +4. Confirm `codeql-dev-mcp-server` appears |
| 103 | + |
| 104 | +## Supported Languages |
| 105 | + |
| 106 | +| Language | CodeQL Identifier | |
| 107 | +| --------------------- | ----------------- | |
| 108 | +| GitHub Actions | `actions` | |
| 109 | +| C/C++ | `cpp` | |
| 110 | +| C# | `csharp` | |
| 111 | +| Go | `go` | |
| 112 | +| Java/Kotlin | `java` | |
| 113 | +| JavaScript/TypeScript | `javascript` | |
| 114 | +| Python | `python` | |
| 115 | +| Ruby | `ruby` | |
| 116 | +| Swift | `swift` | |
| 117 | + |
38 | 118 | ## Documentation |
39 | 119 |
|
40 | | -- [Getting Started Guide](docs/getting-started.md) - Installation and setup instructions |
41 | | -- [Tools Reference](docs/tools-reference.md) - Complete list of available MCP tools |
| 120 | +- [Getting Started Guide](docs/getting-started.md) - Detailed installation and setup instructions |
| 121 | +- [Tools Reference](docs/tools-reference.md) - Complete list of available MCP tools and usage examples |
42 | 122 |
|
43 | 123 | ## License |
44 | 124 |
|
45 | | -See [LICENSE.md](LICENSE.md) for license terms. |
| 125 | +This project is licensed under the terms of the GitHub CodeQL Terms and Conditions. Please refer to [LICENSE](LICENSE) for the full terms. |
46 | 126 |
|
47 | 127 | ## Maintainers |
48 | 128 |
|
49 | 129 | This repository is maintained by the team specified in [CODEOWNERS](CODEOWNERS). |
50 | 130 |
|
51 | 131 | ## Support |
52 | 132 |
|
| 133 | +This project uses GitHub issues to track bugs and feature requests. Please search existing issues before filing new ones to avoid duplicates. |
| 134 | + |
53 | 135 | This project comes with no expectation or guarantee of support, with more details in the [SUPPORT.md](SUPPORT.md) document. |
| 136 | + |
| 137 | +## Acknowledgement |
| 138 | + |
| 139 | +This project builds upon the [CodeQL CLI](https://github.com/github/codeql-cli-binaries) and the broader [CodeQL ecosystem](https://codeql.github.com/) developed by GitHub. Special thanks to the GitHub Advanced Security team and the open-source community for their contributions. |
0 commit comments