Skip to content

Commit df4ce5e

Browse files
committed
Address latest PR review comments
1 parent f9bee7f commit df4ce5e

14 files changed

Lines changed: 56 additions & 52 deletions

docs/ql-mcp/resources.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,22 @@
44
55
## Overview
66

7-
The server exposes **8 static resources** and a set of **dynamic per-language resources** that supply AI assistants with CodeQL reference material. Resources are read-only and backed by `.md` files bundled with the server.
7+
The server exposes **10 static resources** and a set of **dynamic per-language resources** that supply AI assistants with CodeQL reference material. Resources are read-only and backed by `.md` files bundled with the server.
88

99
## Static Resources
1010

11-
| Resource | URI | Description |
12-
| ------------------------------ | ------------------------------------------- | --------------------------------------------------------------------------------- |
13-
| CodeQL Query Basics | `codeql://learning/query-basics` | QL query writing reference: syntax, metadata, patterns, testing |
14-
| CodeQL Test-Driven Development | `codeql://learning/test-driven-development` | TDD theory and workflow for developing CodeQL queries |
15-
| CodeQL Performance Patterns | `codeql://patterns/performance` | Performance profiling and optimization for CodeQL queries |
16-
| CodeQL Server Overview | `codeql://server/overview` | MCP server orientation guide: tools, prompts, resources, and workflows |
17-
| CodeQL Server Prompts | `codeql://server/prompts` | Complete reference of MCP prompts for CodeQL development workflows |
18-
| CodeQL Server Queries | `codeql://server/queries` | Overview of bundled tools queries: PrintAST, PrintCFG, CallGraphFrom, CallGraphTo |
19-
| CodeQL Server Tools | `codeql://server/tools` | Complete reference of default MCP tools for CodeQL development |
20-
| CodeQL Security Templates | `codeql://templates/security` | Security query templates for multiple languages and vulnerability classes |
11+
| Resource | URI | Description |
12+
| ------------------------------ | --------------------------------------------- | --------------------------------------------------------------------------------- |
13+
| CodeQL Query Basics | `codeql://learning/query-basics` | QL query writing reference: syntax, metadata, patterns, testing |
14+
| CodeQL Test-Driven Development | `codeql://learning/test-driven-development` | TDD theory and workflow for developing CodeQL queries |
15+
| CodeQL Performance Patterns | `codeql://patterns/performance` | Performance profiling and optimization for CodeQL queries |
16+
| CodeQL Server Overview | `codeql://server/overview` | MCP server orientation guide: tools, prompts, resources, and workflows |
17+
| CodeQL Server Prompts | `codeql://server/prompts` | Complete reference of MCP prompts for CodeQL development workflows |
18+
| CodeQL Server Queries | `codeql://server/queries` | Overview of bundled tools queries: PrintAST, PrintCFG, CallGraphFrom, CallGraphTo |
19+
| CodeQL Server Tools | `codeql://server/tools` | Complete reference of default MCP tools for CodeQL development |
20+
| CodeQL Security Templates | `codeql://templates/security` | Security query templates for multiple languages and vulnerability classes |
21+
| CodeQL Query Unit Testing | `codeql://guides/query-unit-testing` | Guide for creating and running unit tests for CodeQL queries |
22+
| CodeQL Dataflow Migration | `codeql://guides/dataflow-migration-v1-to-v2` | Guide for migrating from legacy v1 dataflow API to modern v2 module-based API |
2123

2224
## Language-Specific Resources
2325

extensions/vscode/test/suite/mcp-resource-e2e.integration.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ suite('MCP Resource Integration Tests', () => {
108108
const response = await client.listResources();
109109
const staticUris = response.resources
110110
.map(r => r.uri)
111-
.filter(uri => uri.startsWith('codeql://server/') || uri.startsWith('codeql://templates/') || uri.startsWith('codeql://patterns/') || uri.startsWith('codeql://learning/'));
111+
.filter(uri => uri.startsWith('codeql://server/') || uri.startsWith('codeql://templates/') || uri.startsWith('codeql://patterns/') || uri.startsWith('codeql://learning/') || uri.startsWith('codeql://guides/'));
112112

113113
assert.ok(staticUris.length > 0, 'Should have at least one static resource');
114114

server/dist/codeql-development-mcp-server.js

Lines changed: 10 additions & 10 deletions
Large diffs are not rendered by default.

server/dist/codeql-development-mcp-server.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/src/resources/codeql-query-unit-testing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Guide for creating and running unit tests for CodeQL queries. For the broader TD
66

77
There is no one single way to arrange CodeQL unit tests, though there are some commonalities.
88

9-
For a recommended setup that uses separate "qlpacks" for CodeQL queries versus tests, a given CodeQL query and associated unit test may be layed out on the filesystem like:
9+
For a recommended setup that uses separate "qlpacks" for CodeQL queries versus tests, a given CodeQL query and associated unit test may be laid out on the filesystem like:
1010

1111
```text
1212
<query-pack-root>/<optional-queries-subdir>/{QueryName}/

server/src/resources/languages/actions_ast.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,5 +191,5 @@ ExpressionImpl (expressions like ${{ inputs.name }})
191191

192192
This repo contains a variant of the open-source `PrintAst.ql` query for `actions` language, with modifications for local testing:
193193

194-
- [local actions PrintAst.ql query](../src/PrintAST/PrintAST.ql)
195-
- [local actions PrintAst.expected results](../test/PrintAST/PrintAST.expected)
194+
- Use the `codeql_query_run` tool with `queryName="PrintAST"` and `language="actions"` to run the bundled PrintAST query
195+
- Use the `codeql_test_run` tool to run the PrintAST test and compare against expected results

server/src/resources/languages/cpp_ast.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,8 @@ Expression hierarchy with full type and conversion tracking
251251

252252
This repo contains a variant of the open-source `PrintAst.ql` query for `cpp` language, with modifications for local testing:
253253

254-
- [local cpp PrintAst.ql query](../src/PrintAST/PrintAST.ql)
255-
- [local cpp PrintAst.expected results](../test/PrintAST/PrintAST.expected)
254+
- Use the `codeql_query_run` tool with `queryName="PrintAST"` and `language="cpp"` to run the bundled PrintAST query
255+
- Use the `codeql_test_run` tool to run the PrintAST test and compare against expected results
256256

257257
## Expected test results for open-source `PrintAst.ql` query
258258

server/src/resources/languages/csharp_ast.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ Based on the C# PrintAst.expected test results, here are the core CodeQL AST cla
113113

114114
This repo contains a variant of the open-source `PrintAst.ql` query for `csharp` language, with modifications for local testing:
115115

116-
- [local csharp PrintAst.ql query](../src/PrintAST/PrintAST.ql)
117-
- [local csharp PrintAst.expected results](../test/PrintAST/PrintAST.expected)
116+
- Use the `codeql_query_run` tool with `queryName="PrintAST"` and `language="csharp"` to run the bundled PrintAST query
117+
- Use the `codeql_test_run` tool to run the PrintAST test and compare against expected results
118118

119119
## Expected test results for open-source `PrintAst.ql` query
120120

server/src/resources/languages/go_ast.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,8 @@ select call
285285

286286
This repo contains a variant of the open-source `PrintAst.ql` query for `go` language, with modifications for local testing:
287287

288-
- [local go PrintAst.ql query](../src/PrintAST/PrintAST.ql)
289-
- [local go PrintAst.expected results](../test/PrintAST/PrintAST.expected)
288+
- Use the `codeql_query_run` tool with `queryName="PrintAST"` and `language="go"` to run the bundled PrintAST query
289+
- Use the `codeql_test_run` tool to run the PrintAST test and compare against expected results
290290

291291
## Expected test results for open-source `PrintAst.ql` query
292292

server/src/resources/languages/java_ast.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,8 @@ Use `PrintAST` on your test code to see the exact hierarchy for your specific so
243243

244244
This repo contains a variant of the open-source `PrintAst.ql` query for `java` language, with modifications for local testing:
245245

246-
- [local java PrintAst.ql query](../src/PrintAST/PrintAST.ql)
247-
- [local java PrintAst.expected results](../test/PrintAST/PrintAST.expected)
246+
- Use the `codeql_query_run` tool with `queryName="PrintAST"` and `language="java"` to run the bundled PrintAST query
247+
- Use the `codeql_test_run` tool to run the PrintAST test and compare against expected results
248248

249249
## Expected test results for open-source `PrintAst.ql` query
250250

0 commit comments

Comments
 (0)