MCP Server Prompts
June 23, 2026 · View on GitHub
This resource provides a complete reference of the prompts exposed by the CodeQL Development MCP Server. Prompts are reusable workflow templates that guide the LLM through common CodeQL development tasks. Invoke a prompt via the MCP prompts/get protocol.
Prompt Reference
| Prompt | Description |
|---|---|
compare_overlapping_alerts | Compare CodeQL SARIF alerts across rules, files, runs, databases, or CodeQL versions |
data_extension_development | End-to-end workflow for creating CodeQL data extensions (Models-as-Data) for third-party libraries |
diff_informed_analysis_workflow | Make a data-flow query diff-informed, validate it with test run --check-diff-informed, and build/evaluate overlay databases |
document_codeql_query | Create or update standardized markdown documentation for a CodeQL query |
explain_codeql_query | Generate a detailed explanation of a CodeQL query with Mermaid evaluation diagrams |
ql_lsp_iterative_development | Iterative CodeQL query development using LSP tools for completion, navigation, and validation |
ql_tdd_advanced | Advanced test-driven CodeQL development with AST visualization, control flow, and call graph analysis |
ql_tdd_basic | Test-driven CodeQL query development checklist — write tests first, implement query, iterate until tests pass |
run_query_and_summarize_false_positives | Run a CodeQL query and summarize its false positives by root cause |
sarif_rank_false_positives | Analyze SARIF results to identify and rank likely false positives |
sarif_rank_true_positives | Analyze SARIF results to identify and rank likely true positives |
test_driven_development | End-to-end test-driven development workflow for CodeQL queries using MCP tools |
tools_query_workflow | Guide for using PrintAST, PrintCFG, CallGraphFrom, and CallGraphTo tool queries to understand code structure |
workshop_creation_workflow | Guide for creating multi-exercise CodeQL query development workshops from production-grade queries |
Prompt Categories
Test-Driven Development
test_driven_development— The primary TDD prompt. Requires alanguageparameter and optionally acceptsqueryName. Loads theql-tdd-basic.prompt.mdtemplate and walks through the complete TDD cycle: scaffold → write tests → implement → compile → test → iterate.ql_tdd_basic— A standalone TDD checklist. All parameters are optional. Covers the core loop: write test cases, implement the query, run tests, iterate.ql_tdd_advanced— Extends basic TDD with AST visualization (PrintAST), control flow graph analysis (PrintCFG), and call graph exploration (CallGraphFrom,CallGraphTo). Optionally accepts adatabasepath for immediate analysis.
Code Understanding
tools_query_workflow— Orchestrates the four built-in tool queries (PrintAST, PrintCFG, CallGraphFrom, CallGraphTo) to explore how source code is represented in a CodeQL database. Requireslanguageanddatabaseparameters.explain_codeql_query— Produces a verbal explanation of a query's logic and generates Mermaid diagrams showing the evaluation flow. RequiresqueryPathandlanguage.
Iterative Development
ql_lsp_iterative_development— Combines LSP-based code completions (codeql_lsp_completion), go-to-definition (codeql_lsp_definition), find-references (codeql_lsp_references), and diagnostics (codeql_lsp_diagnostics) for an interactive development loop.
Documentation and Quality
document_codeql_query— Generates standardized markdown documentation as a sibling.mdfile to a query. RequiresqueryPathandlanguage.run_query_and_summarize_false_positives— Runs a CodeQL query on a database and groups results into false-positive categories by root cause. Usesquery_results_cache_lookup,sarif_list_rules,sarif_extract_rule,sarif_rule_to_markdown, andread_database_sourcefor structured analysis.sarif_rank_false_positives/sarif_rank_true_positives— Analyze SARIF output to assess query precision by ranking results as likely true or false positives. Usessarif_list_rules,sarif_extract_rule,sarif_rule_to_markdown,read_database_source,sarif_compare_alerts, andsarif_diff_runsfor context gathering.
Alert Analysis and Comparison
compare_overlapping_alerts— Compares CodeQL SARIF alerts across any combination of SARIF files, analysis runs, CodeQL databases, or query packs. Classifies findings as redundant, complementary, false overlap, behavioral regression, or new coverage. Usessarif_list_rules,sarif_extract_rule,sarif_rule_to_markdown,sarif_compare_alerts,sarif_diff_runs, andread_database_sourcetools. RequiressarifPathA; optionally acceptssarifPathBfor cross-file comparison,ruleIdA/ruleIdBto narrow to specific rules, anddatabasePathfor source code context.
Workshop Creation
workshop_creation_workflow— Guides the creation of multi-exercise workshops that teach CodeQL query development. RequiresqueryPathandlanguage, optionally acceptsworkshopNameandnumStages.
Data Extension Development
data_extension_development— End-to-end procedural workflow for creating CodeQL data extensions (Models-as-Data) for third-party libraries. Covers: identify target library → classify API surface → choose deployment scope → author.model.yml→ configure pack → test withcodeql_query_runandcodeql_test_run→ decide next steps. Requireslanguage; optionally acceptslibraryNameanddatabase. Referencescodeql://learning/data-extensionsandcodeql://languages/{language}/library-modelingfor format-specific guidance.
Diff-Informed and Incremental Analysis
diff_informed_analysis_workflow— End-to-end workflow for diff-informed (incremental) analysis. Walks through making a data-flow configuration diff-informed (observeDiffInformedIncrementalMode,getASelectedSourceLocation,getASelectedSinkLocation), validating it withcodeql_test_runusingcheck-diff-informed, and building/evaluating overlay databases viacodeql_database_create(overlay-base,overlay-changes,cache-cleanup) andcodeql_database_analyze/codeql_query_run(evaluate-as-overlay). Requireslanguage; optionally acceptsqueryPathanddatabase. Referencescodeql://learning/diff-informed-analysisandcodeql://guides/overlay-databases.
Related Resources
codeql://server/overview— MCP server orientation guidecodeql://server/tools— Complete tool referencecodeql://learning/test-driven-development— TDD theory and workflow overview