Skip to content

Commit 32166dc

Browse files
Copilotdata-douser
andcommitted
Remove qlt refs, broken cli links, fix deprecated API names, fix import order, fix java_ast and README
- Remove qlt and broken ../resources/cli/ links from javascript, csharp, python security guides - Replace CLI References sections with MCP tool name references - Fix isAdditionalTaintStep → isAdditionalFlowStep in csharp guide (v2 API) - Fix alphabetical import order in resources.ts - Fix incomplete Example AST Hierarchy in java_ast.md with actual hierarchy - Remove ql from README language AST references list Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com>
1 parent 3efcd64 commit 32166dc

8 files changed

Lines changed: 50 additions & 28 deletions

server/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ Static reference materials and per-language references served to AI assistants:
9191
- **Server Tools** / **Server Prompts** — Complete tool and prompt references
9292
- **Query Basics** / **Test-Driven Development** — QL query writing guide and TDD workflow
9393
- **Security Templates** / **Performance Patterns** — Multi-language security templates and profiling guidance
94-
- **Language AST References** — For actions, cpp, csharp, go, java, javascript, python, ql, ruby
94+
- **Language AST References** — For actions, cpp, csharp, go, java, javascript, python, ruby
9595
- **Language Security Patterns** — For cpp, csharp, go, javascript, python
9696

9797
Full reference: [Resources](https://github.com/advanced-security/codeql-development-mcp-server/blob/main/docs/ql-mcp/resources.md)

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

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

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

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/src/lib/resources.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
// Static imports — esbuild inlines the file contents as string literals.
1111
import learningQueryBasicsContent from '../resources/learning-query-basics.md';
1212
import performancePatternsContent from '../resources/performance-patterns.md';
13+
import qlTestDrivenDevelopmentContent from '../resources/ql-test-driven-development.md';
1314
import securityTemplatesContent from '../resources/security-templates.md';
1415
import serverOverviewContent from '../resources/server-overview.md';
1516
import serverPromptsContent from '../resources/server-prompts.md';
1617
import serverQueriesContent from '../resources/server-queries.md';
1718
import serverToolsContent from '../resources/server-tools.md';
18-
import testDrivenDevelopmentContent from '../resources/ql-test-driven-development.md';
1919

2020
/**
2121
* Get the query basics learning guide content
@@ -70,5 +70,5 @@ export function getServerTools(): string {
7070
* Get the test-driven development guide content
7171
*/
7272
export function getTestDrivenDevelopment(): string {
73-
return testDrivenDevelopmentContent;
73+
return qlTestDrivenDevelopmentContent;
7474
}

server/src/resources/languages/csharp_security_query_guide.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ class EntityFrameworkSink extends DataFlow::Node {
400400

401401
- Use specific type restrictions to limit analysis scope
402402
- Leverage existing security libraries rather than reimplementing
403-
- Use `isAdditionalTaintStep` for custom propagation rules
403+
- In your `DataFlow::ConfigSig` module, use `isAdditionalFlowStep` for custom propagation rules
404404
- Consider using `isBarrier` to stop false positive flows
405405

406406
### Memory and Runtime Optimization
@@ -420,13 +420,13 @@ predicate isSecurityRelevantFile(File f) {
420420
}
421421
```
422422

423-
## CLI References
423+
## MCP Tools for Query Development
424424

425425
For C# security query development and testing:
426426

427-
- [codeql query format](../../../../resources/cli/codeql/codeql_query_format.prompt.md)
428-
- [codeql query compile](../../../../resources/cli/codeql/codeql_query_compile.prompt.md)
429-
- [codeql query run](../../../../resources/cli/codeql/codeql_query_run.prompt.md)
430-
- [codeql database analyze](../../../../resources/cli/codeql/codeql_database_analyze.prompt.md)
431-
- [codeql test run](../../../../resources/cli/codeql/codeql_test_run.prompt.md)
432-
- [codeql test extract](../../../../resources/cli/codeql/codeql_test_extract.prompt.md)
427+
- `codeql_query_format` — automatically format CodeQL source code files
428+
- `codeql_query_compile` compile and validate CodeQL queries
429+
- `codeql_query_run` — execute a CodeQL query against a database
430+
- `codeql_database_analyze` — run queries or query suites against CodeQL databases
431+
- `codeql_test_run` run CodeQL query tests
432+
- `codeql_test_extract` extract test databases for CodeQL query tests

server/src/resources/languages/java_ast.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,30 @@ Based on comprehensive analysis of CodeQL's Java test results from GitHub, here
214214

215215
### Example AST Hierarchy
216216

217-
Based on CodeQL's comprehensive Java analysis capabilities:
217+
A typical Java method declaration produces the following AST node hierarchy:
218+
219+
```text
220+
CompilationUnit
221+
└── ClassDecl
222+
├── FieldDecl
223+
│ ├── TypeAccess
224+
│ └── VarDeclExpr
225+
├── MethodDecl
226+
│ ├── TypeAccess (return type)
227+
│ ├── Parameter
228+
│ │ └── TypeAccess
229+
│ └── Block
230+
│ ├── ExprStmt
231+
│ │ └── MethodCall
232+
│ │ ├── VarAccess
233+
│ │ └── StringLiteral
234+
│ └── ReturnStmt
235+
│ └── VarAccess
236+
└── ConstructorDecl
237+
└── Block
238+
```
239+
240+
Use `PrintAST` on your test code to see the exact hierarchy for your specific source patterns.
218241

219242
## Expected test results for local `PrintAst.ql` query
220243

server/src/resources/languages/javascript_security_query_guide.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -350,10 +350,9 @@ app.get('/safe', (req, res) => {
350350
- **Handle dynamic property access**: Account for bracket notation and computed properties
351351
- **Framework method chaining**: Track fluent API calls through multiple steps
352352

353-
## CLI References
353+
## MCP Tools for Query Development
354354

355-
- [qlt query generate new-query](../../../resources/cli/qlt/qlt_query_generate_new-query.prompt.md)
356-
- [codeql query format](../../../resources/cli/codeql/codeql_query_format.prompt.md)
357-
- [codeql query compile](../../../resources/cli/codeql/codeql_query_compile.prompt.md)
358-
- [codeql query run](../../../resources/cli/codeql/codeql_query_run.prompt.md)
359-
- [codeql test run](../../../resources/cli/codeql/codeql_test_run.prompt.md)
355+
- `codeql_query_format` — automatically format CodeQL source code files
356+
- `codeql_query_compile` — compile and validate CodeQL queries
357+
- `codeql_query_run` — execute a CodeQL query against a database
358+
- `codeql_test_run` — run CodeQL query tests

server/src/resources/languages/python_security_query_guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ Once run check the output of the command to ensure that all tests have passed.
446446
If the test has failed, check the test file and the implementation of the class to ensure that the test is correct.
447447
Iterate on the implementation of the class and the test until the test passes.
448448

449-
Reference [resources/cli/codeql/codeql_test_run.prompt.md](../../../../resources/cli/codeql/codeql_test_run.prompt.md) for more details on how to use the `codeql test run` command.
449+
Reference the `codeql_test_run` tool for more details on how to use the `codeql test run` command.
450450

451451
### Inline Tests
452452

0 commit comments

Comments
 (0)