codeql-development-mcp-server 2.24.1-rc1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/LICENSE +178 -0
  2. package/README.md +113 -0
  3. package/dist/codeql-development-mcp-server.js +9474 -0
  4. package/dist/codeql-development-mcp-server.js.map +7 -0
  5. package/package.json +101 -0
  6. package/ql/README.md +57 -0
  7. package/ql/actions/tools/src/PrintAST/PrintAST.ql +40 -0
  8. package/ql/actions/tools/src/PrintCFG/PrintCFG.md +53 -0
  9. package/ql/actions/tools/src/PrintCFG/PrintCFG.ql +23 -0
  10. package/ql/actions/tools/src/codeql-pack.lock.yml +32 -0
  11. package/ql/actions/tools/src/codeql-pack.yml +6 -0
  12. package/ql/cpp/tools/src/CallGraphFrom/CallGraphFrom.ql +55 -0
  13. package/ql/cpp/tools/src/CallGraphTo/CallGraphTo.ql +55 -0
  14. package/ql/cpp/tools/src/PrintAST/PrintAST.ql +57 -0
  15. package/ql/cpp/tools/src/PrintCFG/PrintCFG.md +56 -0
  16. package/ql/cpp/tools/src/PrintCFG/PrintCFG.ql +22 -0
  17. package/ql/cpp/tools/src/codeql-pack.lock.yml +28 -0
  18. package/ql/cpp/tools/src/codeql-pack.yml +6 -0
  19. package/ql/csharp/tools/src/CallGraphFrom/CallGraphFrom.ql +50 -0
  20. package/ql/csharp/tools/src/CallGraphTo/CallGraphTo.ql +50 -0
  21. package/ql/csharp/tools/src/PrintAST/PrintAST.ql +57 -0
  22. package/ql/csharp/tools/src/PrintCFG/PrintCFG.md +55 -0
  23. package/ql/csharp/tools/src/PrintCFG/PrintCFG.ql +22 -0
  24. package/ql/csharp/tools/src/codeql-pack.lock.yml +24 -0
  25. package/ql/csharp/tools/src/codeql-pack.yml +6 -0
  26. package/ql/go/tools/src/CallGraphFrom/CallGraphFrom.ql +39 -0
  27. package/ql/go/tools/src/CallGraphTo/CallGraphTo.ql +47 -0
  28. package/ql/go/tools/src/PrintAST/PrintAST.ql +58 -0
  29. package/ql/go/tools/src/PrintCFG/PrintCFG.md +55 -0
  30. package/ql/go/tools/src/PrintCFG/PrintCFG.ql +22 -0
  31. package/ql/go/tools/src/codeql-pack.lock.yml +24 -0
  32. package/ql/go/tools/src/codeql-pack.yml +6 -0
  33. package/ql/java/tools/src/CallGraphFrom/CallGraphFrom.ql +50 -0
  34. package/ql/java/tools/src/CallGraphTo/CallGraphTo.ql +50 -0
  35. package/ql/java/tools/src/PrintAST/PrintAST.ql +57 -0
  36. package/ql/java/tools/src/PrintCFG/PrintCFG.md +55 -0
  37. package/ql/java/tools/src/PrintCFG/PrintCFG.ql +35 -0
  38. package/ql/java/tools/src/codeql-pack.lock.yml +32 -0
  39. package/ql/java/tools/src/codeql-pack.yml +6 -0
  40. package/ql/javascript/tools/src/CallGraphFrom/CallGraphFrom.ql +49 -0
  41. package/ql/javascript/tools/src/CallGraphTo/CallGraphTo.ql +47 -0
  42. package/ql/javascript/tools/src/PrintAST/PrintAST.ql +60 -0
  43. package/ql/javascript/tools/src/PrintCFG/PrintCFG.md +57 -0
  44. package/ql/javascript/tools/src/PrintCFG/PrintCFG.ql +21 -0
  45. package/ql/javascript/tools/src/codeql-pack.lock.yml +30 -0
  46. package/ql/javascript/tools/src/codeql-pack.yml +6 -0
  47. package/ql/python/tools/src/CallGraphFrom/CallGraphFrom.ql +49 -0
  48. package/ql/python/tools/src/CallGraphTo/CallGraphTo.ql +47 -0
  49. package/ql/python/tools/src/PrintAST/PrintAST.ql +62 -0
  50. package/ql/python/tools/src/PrintCFG/PrintCFG.md +52 -0
  51. package/ql/python/tools/src/PrintCFG/PrintCFG.ql +21 -0
  52. package/ql/python/tools/src/codeql-pack.lock.yml +30 -0
  53. package/ql/python/tools/src/codeql-pack.yml +6 -0
  54. package/ql/ruby/tools/src/CallGraphFrom/CallGraphFrom.ql +40 -0
  55. package/ql/ruby/tools/src/CallGraphTo/CallGraphTo.ql +48 -0
  56. package/ql/ruby/tools/src/PrintAST/PrintAST.ql +57 -0
  57. package/ql/ruby/tools/src/PrintCFG/PrintCFG.md +55 -0
  58. package/ql/ruby/tools/src/PrintCFG/PrintCFG.ql +22 -0
  59. package/ql/ruby/tools/src/codeql-pack.lock.yml +24 -0
  60. package/ql/ruby/tools/src/codeql-pack.yml +6 -0
  61. package/ql/swift/tools/src/CallGraphFrom/CallGraphFrom.ql +53 -0
  62. package/ql/swift/tools/src/CallGraphTo/CallGraphTo.ql +49 -0
  63. package/ql/swift/tools/src/PrintAST/PrintAST.ql +58 -0
  64. package/ql/swift/tools/src/PrintCFG/PrintCFG.ql +68 -0
  65. package/ql/swift/tools/src/codeql-pack.lock.yml +24 -0
  66. package/ql/swift/tools/src/codeql-pack.yml +6 -0
  67. package/scripts/setup-packs.sh +150 -0
package/LICENSE ADDED
@@ -0,0 +1,178 @@
1
+ # GitHub CodeQL Terms and Conditions
2
+
3
+ These GitHub CodeQL Terms and Conditions ("**Terms**") are a legal
4
+ agreement between you (either as an individual or on behalf of an
5
+ entity) and GitHub, Inc. regarding your use of the GitHub CodeQL
6
+ software and associated documentation (collectively, the
7
+ "**Software**"). By using the Software, you accept these Terms.
8
+ **Please read all of these Terms;** in many cases, provisions set
9
+ forth later in the Terms limit and qualify provisions set forth
10
+ earlier in the Terms. If you do not accept these Terms, do not
11
+ download, install, use, or copy the Software.
12
+
13
+ ## Definitions
14
+
15
+ In these Terms:
16
+
17
+ - "OSI-approved License" means an Open Source Initiative
18
+ (OSI)-approved open source software license.
19
+
20
+ - "Open Source Codebase" means a codebase that is released under an
21
+ OSI-approved License.
22
+
23
+ ## Use Rights; Scope of License
24
+
25
+ The Software is licensed on a per user basis. Here's what you may do
26
+ with the Software, but subject to License Restrictions provisions
27
+ below:
28
+
29
+ - Use the Software to perform academic research.
30
+
31
+ - Use the Software to demonstrate the Software.
32
+
33
+ - Test CodeQL queries that are released under an OSI-approved
34
+ License to confirm that new versions of those queries continue to
35
+ find the right vulnerabilities.
36
+
37
+ Here's what you may also do with the Software, but only with an Open
38
+ Source Codebase and subject to the License Restrictions provisions
39
+ below:
40
+
41
+ - Perform analysis on the Open Source Codebase.
42
+
43
+ - If the Open Source Codebase is hosted and maintained on
44
+ GitHub.com, generate CodeQL databases for or during automated
45
+ analysis, CI, or CD.
46
+
47
+ ## License Restrictions
48
+
49
+ These Terms do not authorize, and the Software may not be used for any
50
+ purpose not expressly set forth above, including:
51
+
52
+ - To otherwise or in any other context generate any CodeQL database
53
+ for or during automated analysis, CI or CD, whether as part of
54
+ normal engineering processes or another context.
55
+
56
+ - To otherwise or in any other context use the Software in
57
+ connection with any codebase that is not an Open Source Codebase
58
+ (e.g., code in a private repo in GitHub).
59
+
60
+ _**Please note:** if your use of the Software is under a paid customer
61
+ license for GitHub Advanced Security, the restrictions with respect to
62
+ automated analysis, CI, and CD and use in connection with non-Open
63
+ Source Codebases do not apply._
64
+
65
+ At all times, except (and only to the extent) permitted by applicable
66
+ law or applicable third-party license, you will not (and have no right
67
+ to):
68
+
69
+ - work around any technical limitations in the Software that only
70
+ allow you to use it in certain ways;
71
+
72
+ - reverse engineer, decompile or disassemble the Software;
73
+
74
+ - remove, minimize, block, or modify any notices of GitHub or its
75
+ suppliers in the Software;
76
+
77
+ - use the Software in any way that is against the law; or
78
+
79
+ - share, publish, distribute or lend the Software, provide or make
80
+ available the Software as a hosted solution (whether on a
81
+ standalone basis or combined, incorporated or integrated with
82
+ other software or services) for others to use, or transfer the
83
+ Software or these Terms to any third party.
84
+
85
+ The Software is licensed, not sold. GitHub reserves all rights not
86
+ expressly granted in these Terms.
87
+
88
+ ## Open Source Software
89
+
90
+ The Software may include components licensed under open source
91
+ software licenses. Any such licenses are included in the "Open Source
92
+ Notices" documentation that is included with the Software. Such
93
+ documentation also includes copies of all applicable open source
94
+ licenses.
95
+
96
+ To the extent the terms of the licenses applicable to open source
97
+ components require GitHub to make an offer to provide source code in
98
+ connection with the Software, such offer is hereby made, and you may
99
+ exercise it by contacting GitHub: https://github.com/contact.
100
+
101
+ Unless otherwise agreed to in writing with GitHub, your agreement with
102
+ GitHub will always include, at a minimum, these Terms. Open source
103
+ software licenses for the Software's source code constitute separate
104
+ written agreements. To the limited extent that any open source
105
+ software license expressly supersedes these Terms, such open source
106
+ license governs your use of the applicable component(s) of the
107
+ Software subject to such license.
108
+
109
+ ## GitHub Trademarks
110
+
111
+ These Terms do not grant any right or license to use any of GitHub's
112
+ trademarks or logos, including, without limitation, the names GitHub
113
+ and CodeQL and any Software logo designs in the "logos" folder of the
114
+ Software. You agree not to display or use any of these trademarks or
115
+ logos in any manner without GitHub's prior written permission, except
116
+ as allowed by GitHub's Logos and Usage Policy located at
117
+ https://github.com/logos. GitHub reserves all right, title and
118
+ interest in and to all GitHub trademarks and logos.
119
+
120
+ ## Additional Services
121
+
122
+ Auto-Updates: The Software may include an auto-update service. If the
123
+ Software automatically enables such service (or, if it is not
124
+ automatically enabled and you choose to use it), GitHub will
125
+ automatically update the Software when a new version is available.
126
+
127
+ ## Support
128
+
129
+ Because the Software is "as-is," GitHub may not provide support for it.
130
+
131
+ ## Export Control
132
+
133
+ Customer will comply with all applicable export and import laws and
134
+ regulations that apply to the Software.
135
+
136
+ ## Disclaimer; Limitations of Liability
137
+
138
+ THE SOFTWARE, INCLUDING ANY ADDITIONAL SERVICES, IS PROVIDED ON AN
139
+ "AS-IS" BASIS, AND GITHUB GIVES NO EXPRESS WARRANTIES, GUARANTEES OR
140
+ CONDITIONS. TO THE EXTENT PERMITTED BY APPLICABLE LAW, GITHUB
141
+ DISCLAIMS THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
142
+ PARTICULAR PURPOSE AND NON-INFRINGEMENT. YOUR USE OF THE SOFTWARE IS
143
+ AT YOUR SOLE RISK.
144
+
145
+ TO THE EXTENT PERMITTED BY APPLICABLE LAW, YOU EXPRESSLY UNDERSTAND
146
+ AND AGREE THAT (1) YOU CAN RECOVER DIRECT DAMAGES RELATING TO THE
147
+ SOFTWARE, INCLUDING ANY ADDITIONAL SERVICES, UP TO U.S. $5.00 FROM
148
+ GITHUB AND ITS SUPPLIERS, AND (2) GITHUB WILL NOT BE LIABLE FOR ANY
149
+ INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL OR EXEMPLARY DAMAGES,
150
+ INCLUDING, WITHOUT LIMITATION, ANY DAMAGES FOR LOSS OF PROFITS,
151
+ GOODWILL, USE, OR DATA OR OTHER INTANGIBLE LOSSES (EVEN IF GITHUB HAS
152
+ BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES) RELATING TO THE
153
+ SOFTWARE, INCLUDING ANY ADDITIONAL SERVICES.
154
+
155
+ ## Miscellaneous
156
+
157
+ _No Waiver._ The failure of GitHub to exercise or enforce any right or
158
+ provision of these Terms will not constitute a waiver of such right or
159
+ provision.
160
+
161
+ _Entire Agreement._ These Terms, together with any open source
162
+ software licenses referenced above, constitute the entire agreement
163
+ between you and GitHub regarding your use of the Software, superseding
164
+ any prior agreements between you and GitHub (including, but not
165
+ limited to, any prior versions of these Terms) regarding such use.
166
+
167
+ _Governing Law._ You agree that these Terms and your use of the
168
+ Software are governed by the laws of the State of California and any
169
+ dispute relating to the Software or your use thereof must be brought
170
+ in a tribunal of competent jurisdiction located in or near San
171
+ Francisco, California.
172
+
173
+ _Modifications._ These Terms may only be modified by a written
174
+ amendment signed by an authorized representative of GitHub, or by the
175
+ posting by GitHub of a revised version.
176
+
177
+ _Contact Us._ Questions about these Terms? Contact us at
178
+ https://support.github.com/contact.
package/README.md ADDED
@@ -0,0 +1,113 @@
1
+ # advanced-security/codeql-development-mcp-server:server/README.md
2
+
3
+ This README provides documentation for the `server` subproject of the `advanced-security/codeql-development-mcp-server` repository.
4
+ The `server` subproject implements the actual Model Context Protocol (MCP) server for CodeQL development and is the main component of the repository.
5
+
6
+ ## For End Users
7
+
8
+ If you're using the distributed release package (downloaded from GitHub Releases), the server is ready to use. See the [Getting Started Guide](../docs/getting-started.md) for setup instructions.
9
+
10
+ ### Running the Server
11
+
12
+ The server can run in two modes:
13
+
14
+ **STDIO Mode (recommended for VS Code):**
15
+
16
+ ```bash
17
+ node dist/codeql-development-mcp-server.js
18
+ ```
19
+
20
+ **HTTP Mode (for debugging):**
21
+
22
+ ```bash
23
+ TRANSPORT_MODE=http node dist/codeql-development-mcp-server.js
24
+ ```
25
+
26
+ ### Configuration
27
+
28
+ Configure the server using environment variables:
29
+
30
+ | Variable | Description | Default |
31
+ | ---------------- | -------------------------------------- | -------- |
32
+ | `CODEQL_PATH` | Absolute path to the CodeQL CLI binary | `codeql` |
33
+ | `TRANSPORT_MODE` | `stdio` or `http` | `stdio` |
34
+ | `HTTP_PORT` | HTTP port (when using HTTP mode) | `3000` |
35
+ | `DEBUG` | Enable debug logging | `false` |
36
+
37
+ ## Subproject Structure
38
+
39
+ The `server` subproject is structured as follows:
40
+
41
+ ```text
42
+ server/
43
+ ├── dist/ # Base directory for compiled output
44
+ │ ├── codeql-development-mcp-server.js # Compiled, bundled MCP server entry point
45
+ │ └── codeql-development-mcp-server.js.map # Source map for the bundled MCP server
46
+ ├── src/ # TypeScript source library code
47
+ │ ├── codeql-development-mcp-server.ts # MCP server entry point
48
+ │ ├── lib/ # Core library code
49
+ │ ├── tools/ # Implementation of MCP tools
50
+ ├── test/ # Base directory for tests
51
+ │ ├── src/ # Base directory for test source files
52
+ │ │ ├── lib/ # Test files for core library code
53
+ │ │ ├── tools/ # Test files for MCP tools
54
+ ├── eslint.config.mjs # ESLint configuration
55
+ ├── esbuild.config.js # esbuild configuration for bundling
56
+ ├── package.json # NPM package configuration
57
+ ├── tsconfig.json # TypeScript configuration
58
+ └── README.md # This README file
59
+ ```
60
+
61
+ ## Troubleshooting
62
+
63
+ ### Server Won't Start
64
+
65
+ 1. **Check Node.js version**: The server requires Node.js v24.13.0 or later
66
+
67
+ ```bash
68
+ node --version
69
+ ```
70
+
71
+ 2. **Verify the entry point exists**:
72
+
73
+ ```bash
74
+ ls dist/codeql-development-mcp-server.js
75
+ ```
76
+
77
+ 3. **Check for missing dependencies**: If using the distributed package, ensure `node_modules` is present
78
+
79
+ ### CodeQL Tools Return Errors
80
+
81
+ 1. **Verify CodeQL CLI is installed**:
82
+
83
+ ```bash
84
+ codeql --version
85
+ ```
86
+
87
+ 2. **Check CodeQL is in PATH**: The server expects `codeql` to be available in the system PATH, or set `CODEQL_PATH` to the absolute path of the CodeQL CLI binary
88
+
89
+ 3. **Ensure you have a valid database**: Most query tools require a CodeQL database
90
+
91
+ ### HTTP Mode Not Working
92
+
93
+ 1. **Check if port is in use**:
94
+
95
+ ```bash
96
+ lsof -i :3000
97
+ ```
98
+
99
+ 2. **Try a different port**:
100
+
101
+ ```bash
102
+ TRANSPORT_MODE=http HTTP_PORT=8080 node dist/codeql-development-mcp-server.js
103
+ ```
104
+
105
+ ### VS Code Integration Issues
106
+
107
+ See the [Getting Started Guide](../docs/getting-started.md#troubleshooting) for troubleshooting steps.
108
+
109
+ ## References
110
+
111
+ - [MCP Architecture](https://modelcontextprotocol.io/docs/learn/architecture)
112
+ - [Getting Started Guide](../docs/getting-started.md)
113
+ - [Tools Reference](../docs/tools-reference.md)