Skip to content

Commit 51a0325

Browse files
committed
Merge branch 'copilot/rewrite-mcp-resources-guides' of github.com:advanced-security/codeql-development-mcp-server into copilot/rewrite-mcp-resources-guides
2 parents e7b5b6b + 852cb3a commit 51a0325

16 files changed

+358
-242
lines changed

docs/ql-mcp/prompts.md

Lines changed: 2 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -6,45 +6,6 @@
66

77
The server provides **11 prompts** that guide AI assistants through common CodeQL development workflows. Each prompt is backed by a `*.prompt.md` file containing structured instructions.
88

9-
## Prompt Reference
9+
> **Authoritative reference**: The MCP-served resource at `codeql://server/prompts` ([`server/src/resources/server-prompts.md`](../../server/src/resources/server-prompts.md)) is the canonical documentation for prompts. Update that file when adding, removing, or changing any prompt.
1010
11-
| Prompt | Description |
12-
| ----------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
13-
| `document_codeql_query` | Create or update documentation for a CodeQL query |
14-
| `explain_codeql_query` | Generate a detailed explanation of a CodeQL query for workshop learning content |
15-
| `ql_lsp_iterative_development` | Iterative CodeQL query development using LSP tools for completion, navigation, and validation |
16-
| `ql_tdd_advanced` | Advanced test-driven CodeQL development with AST visualization, control flow, and call graph analysis |
17-
| `ql_tdd_basic` | Test-driven CodeQL query development checklist — write tests first, implement query, iterate until tests pass |
18-
| `run_query_and_summarize_false_positives` | Run a CodeQL query and summarize its false positives |
19-
| `sarif_rank_false_positives` | Analyze SARIF results to identify likely false positives in CodeQL query results |
20-
| `sarif_rank_true_positives` | Analyze SARIF results to identify likely true positives in CodeQL query results |
21-
| `test_driven_development` | Test-driven development workflow for CodeQL queries using MCP tools |
22-
| `tools_query_workflow` | Guide for using built-in tools queries (PrintAST, PrintCFG, CallGraphFrom, CallGraphTo) to understand code structure |
23-
| `workshop_creation_workflow` | Guide for creating CodeQL query development workshops from production-grade queries |
24-
25-
## Prompt Categories
26-
27-
### Test-Driven Development
28-
29-
- **`ql_tdd_basic`** — Covers the core TDD loop: write test cases, implement the query, run tests, iterate.
30-
- **`ql_tdd_advanced`** — Extends basic TDD with AST visualization, control flow graph analysis, and call graph exploration.
31-
- **`test_driven_development`** — End-to-end TDD workflow using MCP tools for each step.
32-
33-
### Code Understanding
34-
35-
- **`tools_query_workflow`** — Uses PrintAST, PrintCFG, CallGraphFrom, and CallGraphTo tool queries to explore how source code is represented in a CodeQL database.
36-
- **`explain_codeql_query`** — Produces verbal explanations and Mermaid evaluation diagrams for a given query.
37-
38-
### Iterative Development
39-
40-
- **`ql_lsp_iterative_development`** — Combines LSP completions, go-to-definition, and diagnostics for an interactive development loop.
41-
42-
### Documentation and Quality
43-
44-
- **`document_codeql_query`** — Generates standardized markdown documentation as a sibling file to a query.
45-
- **`run_query_and_summarize_false_positives`** — Runs a CodeQL query on a database and groups results into false-positive categories by root cause.
46-
- **`sarif_rank_false_positives`** / **`sarif_rank_true_positives`** — Help assess query precision by ranking SARIF results.
47-
48-
### Workshop Creation
49-
50-
- **`workshop_creation_workflow`** — Guides the creation of multi-exercise workshops that teach CodeQL query development.
11+
For the complete prompt reference (all 11 prompts with descriptions and categories), see [`server/src/resources/server-prompts.md`](../../server/src/resources/server-prompts.md).

docs/ql-mcp/resources.md

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

7-
The server exposes **7 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 **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.
88

99
## Static Resources
1010

11-
| Resource | URI | Description |
12-
| ------------------------------ | ------------------------------------------- | ------------------------------------------------------------------------- |
13-
| CodeQL Server Overview | `codeql://server/overview` | MCP server orientation guide: tools, prompts, resources, and workflows |
14-
| CodeQL Server Prompts | `codeql://server/prompts` | Complete reference of MCP prompts for CodeQL development workflows |
15-
| CodeQL Query Writing Guide | `codeql://server/queries` | Practical reference for writing and validating CodeQL queries |
16-
| CodeQL Server Tools | `codeql://server/tools` | Complete reference of default MCP tools for CodeQL development |
17-
| CodeQL Test-Driven Development | `codeql://learning/test-driven-development` | TDD theory and workflow for developing CodeQL queries |
18-
| CodeQL Security Templates | `codeql://templates/security` | Security query templates for multiple languages and vulnerability classes |
19-
| CodeQL Performance Patterns | `codeql://patterns/performance` | Performance profiling and optimization for CodeQL queries |
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 |
2021

2122
## Language-Specific Resources
2223

docs/ql-mcp/tools.md

Lines changed: 3 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -6,60 +6,11 @@
66

77
The server exposes **38 default tools** and **11 opt-in monitoring tools**. Default tools are registered on startup; monitoring tools require explicit opt-in (see [Monitoring and Reporting](../mcp-server-monitoring-and-reporting.md)). Users control which tools are enabled in their MCP client configuration.
88

9-
## Default Tools
10-
11-
### CodeQL CLI Tools
12-
13-
| Tool | Description |
14-
| ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
15-
| `codeql_bqrs_decode` | Decode BQRS result files to human-readable formats (text, csv, json). Supports `--result-set`, `--rows` for pagination |
16-
| `codeql_bqrs_info` | Get metadata about BQRS result files: result sets, column types, row counts. Supports `--format=json` and pagination offsets |
17-
| `codeql_bqrs_interpret` | Interpret BQRS result files according to query metadata and generate output in specified formats (CSV, SARIF, graph formats) |
18-
| `codeql_database_analyze` | Run queries or query suites against CodeQL databases. Produces evaluator logs, BQRS, and SARIF output |
19-
| `codeql_database_create` | Create a CodeQL database from source code |
20-
| `codeql_generate_log-summary` | Create a summary of a structured JSON evaluator event log file |
21-
| `codeql_generate_query-help` | Generate query help documentation from QLDoc comments |
22-
| `codeql_pack_install` | Install CodeQL pack dependencies |
23-
| `codeql_pack_ls` | List CodeQL packs under some local directory path |
24-
| `codeql_query_compile` | Compile and validate CodeQL queries |
25-
| `codeql_query_format` | Automatically format CodeQL source code files |
26-
| `codeql_query_run` | Execute a CodeQL query against a database |
27-
| `codeql_resolve_database` | Resolve database path and validate database structure |
28-
| `codeql_resolve_languages` | List installed CodeQL extractor packs |
29-
| `codeql_resolve_library-path` | Resolve library path for CodeQL queries and libraries |
30-
| `codeql_resolve_metadata` | Resolve and return the key-value metadata pairs from a CodeQL query source file |
31-
| `codeql_resolve_qlref` | Resolve qlref files to their corresponding query files |
32-
| `codeql_resolve_queries` | List available CodeQL queries found on the local filesystem |
33-
| `codeql_resolve_tests` | Resolve the local filesystem paths of unit tests and/or queries under some base directory |
34-
| `codeql_test_accept` | Accept new test results as the expected baseline |
35-
| `codeql_test_extract` | Extract test databases for CodeQL query tests |
36-
| `codeql_test_run` | Run CodeQL query tests |
9+
> **Authoritative reference**: The MCP-served resource at `codeql://server/tools` ([`server/src/resources/server-tools.md`](../../server/src/resources/server-tools.md)) is the canonical documentation for default tools. Update that file when adding, removing, or changing any default tool.
3710
38-
### Language Server Protocol (LSP) Tools
39-
40-
| Tool | Description |
41-
| ------------------------ | ----------------------------------------------------------------------------------------------- |
42-
| `codeql_lsp_completion` | Get code completions at a cursor position in a CodeQL file |
43-
| `codeql_lsp_definition` | Go to the definition of a CodeQL symbol at a given position |
44-
| `codeql_lsp_diagnostics` | Authoritative syntax and semantic validation of CodeQL (QL) code via the CodeQL Language Server |
45-
| `codeql_lsp_references` | Find all references to a CodeQL symbol at a given position |
46-
47-
### Query Development Tools
11+
## Default Tools
4812

49-
| Tool | Description |
50-
| -------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
51-
| `create_codeql_query` | Create directory structure and files for a new CodeQL query with tests |
52-
| `find_class_position` | Find the start/end line and column of a class for quick evaluation |
53-
| `find_codeql_query_files` | Find and track all files and directories related to a CodeQL query, including resolved metadata |
54-
| `find_predicate_position` | Find the start/end line and column of a predicate for quick evaluation |
55-
| `list_codeql_databases` | List CodeQL databases discovered in configured base directories (`CODEQL_DATABASES_BASE_DIRS`). Filter by language |
56-
| `list_mrva_run_results` | List MRVA (Multi-Repository Variant Analysis) run results with per-repo details (`CODEQL_MRVA_RUN_RESULTS_DIRS`) |
57-
| `list_query_run_results` | List query run result directories with artifact inventory. Filter by `queryName`, `language`, or `queryPath` |
58-
| `profile_codeql_query` | Profile the performance of a CodeQL query run against a specific database by analyzing the evaluator log JSON file |
59-
| `profile_codeql_query_from_logs` | Parse existing CodeQL evaluator logs into a performance profile without re-running the query |
60-
| `quick_evaluate` | Quick evaluate either a class or a predicate in a CodeQL query for debugging |
61-
| `register_database` | Register a CodeQL database given a local path to the database directory |
62-
| `validate_codeql_query` | Quick heuristic validation for CodeQL query structure (does not compile the query) |
13+
For the complete default tools reference (CodeQL CLI tools, LSP tools, query development tools, common workflows, and input conventions), see [`server/src/resources/server-tools.md`](../../server/src/resources/server-tools.md).
6314

6415
## Optional Monitoring Tools
6516

server/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ Full reference: [Prompts](https://github.com/advanced-security/codeql-developmen
8787

8888
Static reference materials and per-language references served to AI assistants:
8989

90-
- **Server Overview** / **Query Writing Guide** — MCP server orientation and query development reference
90+
- **Server Overview** / **Server Queries** — MCP server orientation and bundled tools queries reference
9191
- **Server Tools** / **Server Prompts** — Complete tool and prompt references
92-
- **Test-Driven Development**TDD theory and workflow for CodeQL queries
92+
- **Query Basics** / **Test-Driven Development**QL query writing guide and TDD workflow
9393
- **Security Templates** / **Performance Patterns** — Multi-language security templates and profiling guidance
9494
- **Language AST References** — For actions, cpp, csharp, go, java, javascript, python, ql, ruby
9595
- **Language Security Patterns** — For cpp, csharp, go, javascript, python

0 commit comments

Comments
 (0)