About Codeql Development MCP Server
Codeql Development MCP Server is an MCP server published by advanced-security in the Security category: lLM <-- MCP --> CodeQL( AST | CFG | CLI | LSP ). Conduid read 76 tools from its source: annotation_create, annotation_delete, annotation_get, annotation_list, annotation_search, annotation_update and 70 more. No package is published for it, so it installs from a source checkout.
The repository has 39 stars and 5 forks, and its last commit was on 1 Dec 2026. The latest release is v2.27.2 (8 Oct 2026). It follows v2.27.1 (24 Sep 2026), and the 5 most recent releases go back to v2.26.3 (18 Aug 2026). It passes 4 of the 5 static checks Conduid ran on the repository; it does not pass No dynamic code execution. Its topics include ast, cfg, code-quality, code-security, codeql and copilot-enabled.
Install
git clone https://github.com/advanced-security/codeql-development-mcp-serverTools (76)
annotation_createCreate a new annotation (note, bookmark, finding) on any entity.| Parameter | Type | Description |
|---|---|---|
| category * | string | Annotation category (e.g. "bookmark", "note", "finding", "audit-source"). |
| content | string | Free-text content of the annotation. |
| entityKey * | string | Entity key — a stable identifier for the annotated object (e.g. "repo:owner/name", "file:/path:L10", "query-result:id"). |
| label | string | Short human-readable label. |
| metadata | string | JSON-encoded structured metadata. |
annotation_deleteDelete annotations by ID, category, or entity key prefix.| Parameter | Type | Description |
|---|---|---|
| category | string | Delete all annotations in a category. |
| entityKeyPrefix | string | Delete annotations matching an entity key prefix. |
| id | number | Delete a specific annotation by ID. |
annotation_getRetrieve a single annotation by its numeric ID.| Parameter | Type | Description |
|---|---|---|
| id * | number | The annotation ID (positive integer primary key). |
annotation_listList annotations with optional filtering by category, entity key, or entity key prefix.| Parameter | Type | Description |
|---|---|---|
| category | string | Filter by annotation category. |
| entityKey | string | Filter by exact entity key. |
| entityKeyPrefix | string | Filter by entity key prefix (e.g. "repo:owner/name"). |
| limit | number | Maximum number of results (default: 100). |
| offset | number | Number of results to skip. |
annotation_searchFull-text search across annotation content, metadata, and labels using SQLite FTS (token-based MATCH; use * suffix for prefix matching, e.g. "vulnerab*").| Parameter | Type | Description |
|---|---|---|
| category | string | Restrict search to a specific category. |
| limit | number | Maximum number of results (default: 50). |
| search * | string | Full-text search query matched against annotation content, metadata, and label (SQLite FTS MATCH syntax; use * for prefix matching). |
annotation_updateUpdate the content, label, or metadata of an existing annotation.| Parameter | Type | Description |
|---|---|---|
| content | string | New content (replaces existing). |
| id * | number | The annotation ID to update (positive integer primary key). |
| label | string | New label (replaces existing). |
| metadata | string | New JSON-encoded metadata (replaces existing). |
audit_add_notesAppend notes to an existing audit finding. Identify the finding by findingId (preferred) or by owner+repo+sourceLocation+line.| Parameter | Type | Description |
|---|---|---|
| findingId | number | Annotation ID of the finding (returned by audit_store_findings and audit_list_findings). Preferred lookup method. |
| line | number | Line number of the finding (required when findingId is not provided). |
| notes * | string | Notes to append. |
| owner | string | Repository owner (required when findingId is not provided). |
| repo | string | Repository name (required when findingId is not provided). |
| sourceLocation | string | File path of the finding (required when findingId is not provided). |
audit_clear_repoDelete all audit findings for a repository.| Parameter | Type | Description |
|---|---|---|
| owner * | string | Repository owner. |
| repo * | string | Repository name. |
audit_list_findingsList all audit findings for a repository, including any analyst notes.| Parameter | Type | Description |
|---|---|---|
| limit | number | Maximum number of results (1–1000). |
| owner * | string | Repository owner. |
| repo * | string | Repository name. |
audit_store_findingsStore CodeQL analysis findings for a repository. Each finding is persisted as an annotation with category "audit-finding".| Parameter | Type | Description |
|---|---|---|
| findings | array | File path of the finding. |
| owner * | string | Repository owner. |
| repo * | string | Repository name. |
codeql_bqrs_decodeDecode BQRS result files to human-readable formats (text, csv, json). Typical workflow: (1) use list_query_run_results to find BQRS paths from previous codeql_query_run or codeql_database_analyze runs, (2) use codeql_bqrs_info to discover result sets and column schemas, (3) decode specific result sets with this tool. For large result sets, use --rows to paginate.| Parameter | Type | Description |
|---|---|---|
| entities | string | Control entity column display: comma-separated list of url, string, id, all |
| files * | array | Array of BQRS file paths to decode. Pass an array even for a single file, e.g. ["/path/to/results.bqrs"] |
| format | string | Output format: text (human-readable table, default), csv, json (streaming JSON), or bqrs (binary, requires --output) |
| no-titles | boolean | Omit column titles for text and csv formats |
| result-set | string | Decode a specific result set by name (use codeql_bqrs_info to list available sets). If omitted, all result sets are decoded. |
| rows | number | Maximum number of rows to output (for pagination). Use with --start-at for paging. |
| sort-direction | string | Sort direction(s): comma-separated "asc" or "desc" per column |
| sort-key | string | Sort by column(s): comma-separated column indices (0-based) |
| start-at | number | Byte offset to start decoding from (get from codeql_bqrs_info or previous JSON output "next" pointer). Must be used with --rows. |
codeql_bqrs_infoGet metadata about BQRS result files: lists result sets, column names/types, and row counts. Use before codeql_bqrs_decode to discover available result sets (e.g., "#select", "edges", "nodes"). BQRS files are found at <runDir>/results.bqrs — use list_query_run_results to discover them. Use --format=json with --paginate-rows to get byte offsets for paginated decoding with codeql_bqrs_decode --start-at.| Parameter | Type | Description |
|---|---|---|
| file * | string | BQRS file to examine |
| format | string | Output format: text (default) or json. Use json for machine-readable output and pagination offset computation. |
| paginate-result-set | string | Compute pagination offsets only for this result set name |
| paginate-rows | number | Compute byte offsets for pagination at intervals of this many rows. Use with --format=json. Offsets can be passed to codeql_bqrs_decode --start-at. |
codeql_bqrs_interpretInterpret BQRS result files according to query metadata and generate output in specified formats (CSV, SARIF, graph formats)| Parameter | Type | Description |
|---|---|---|
| column-kind | string | [SARIF only] Column kind for interpreting location columns |
| csv-location-format | string | [CSV only] Format for locations in CSV output (default: line-column) |
| database | string | Path to the CodeQL database. When provided, auto-resolves --source-archive (for file contents/snippets) and --source-location-prefix (from codeql-database.yml metadata) so SARIF results include full source context |
| dot-location-url-format | string | [DOT only] Format string for file location URLs (placeholders: {path}, {start:line}, {start:column}, {end:line}, {end:column}, {offset}, {length}) |
| file * | string | The BQRS file to interpret |
| format * | string | Output format: csv (comma-separated), sarif-latest/sarifv2.1.0 (SARIF), graphtext/dgml/dot (graph formats, only for @kind graph queries) |
| max-paths | number | Maximum number of paths to produce for each alert with paths (default: 4) |
| sarif-add-file-contents | boolean | [SARIF only] Include full file contents for all files referenced in results |
| sarif-add-snippets | boolean | [SARIF only] Include code snippets for each location with context |
| sarif-category | string | [SARIF only] Category for this analysis (distinguishes multiple analyses on same code) |
| sarif-group-rules-by-pack | boolean | [SARIF only] Place rule objects under their QL pack in tool.extensions property |
| sarif-multicause-markdown | boolean | [SARIF only] Include multi-cause alerts as Markdown-formatted lists |
| t * | array | Query metadata key=value pairs in KEY=VALUE format. At least "kind" and "id" must be specified. Example: ["kind=problem", "id=js/sql-injection"]. Common keys: kind (problem|path-problem|graph|metric|diagnostic), id (query identifier like js/xss) |
| threads | number | Number of threads for computing paths (0 = one per core, -N = leave N cores unused) |
| unicode-new-lines | boolean | [SARIF only] Whether unicode newlines (U+2028, U+2029) are considered as newlines |
codeql_database_analyzeRun queries or query suites against CodeQL databases. Produces evaluator logs, BQRS results, and optionally SARIF output. Use list_codeql_databases to discover available databases, and register_database to register new ones. After analysis completes, use list_query_run_results to find result artifacts, then codeql_bqrs_info and codeql_bqrs_decode to inspect results.| Parameter | Type | Description |
|---|---|---|
| additionalArgs | array | Additional command-line arguments |
| cache-at-frontier | boolean | [Advanced/experimental] Force evaluation and caching of intermediate results useful for future overlay evaluation. Enabled by default when evaluating against an overlay-prepared base that has no overlay yet, so it rarely needs to be set explicitly. |
| database * | string | Path to the CodeQL database |
| download-location | string | Location to download missing dependencies |
| evaluate-as-overlay | boolean | [Advanced/experimental] Override automatic detection and force queries to be evaluated in overlay mode against an overlay database (one built with --overlay-changes on top of an --overlay-base). Used for diff-informed (incremental) analysis of changed files. |
| evaluator-log | string | Path to save evaluator log. If not provided and logDir is set, defaults to <logDir>/evaluator-log.jsonl |
| evaluator-log-level | number | Evaluator log verbosity level (1-5, default 5) |
| format | string | Output format for results |
| logDir | string | Custom directory for analysis execution logs (overrides CODEQL_QUERY_LOG_DIR environment variable). If not provided, uses CODEQL_QUERY_LOG_DIR or defaults to .tmp/query-logs/<unique-id> |
| output | string | Output file path |
| queries * | string | Queries or query suite to run |
| ram | number | Amount of RAM to use (MB) |
| rerun | boolean | Force re-evaluation of queries even if BQRS results already exist in the database. Without this, cached results are reused. |
| threads | number | Number of threads to use |
| timeout | number | Timeout in seconds |
| tuple-counting | boolean | Display tuple counts for each evaluation step in evaluator logs |
| verbose | boolean | Enable verbose output |
codeql_database_createCreate a CodeQL database from source code| Parameter | Type | Description |
|---|---|---|
| additionalArgs | array | Additional command-line arguments |
| build-mode | string | Build mode: none (interpreted langs), autobuild, or manual |
| cache-cleanup | string | How aggressively to trim the evaluation cache: clear, trim (default), fit, or overlay. Use "overlay" when building an overlay base so only data useful for overlay evaluation is retained. |
| command | string | Build command for compiled languages |
| database * | string | Database path/name to create |
| extractorEnv | array | Extractor environment variables as "KEY=VALUE" strings injected into the extraction process. Only keys beginning with LGTM_ or CODEQL_EXTRACTOR_ are permitted. Required for some framework databases — e.g. SAP UI5 needs "LGTM_INDEX_XML_MODE=ALL" (and often "LGTM_INDEX_FILTERS=include:**/*.json") to extract XML views. Example: ["LGTM_INDEX_XML_MODE=ALL"]. |
| language | string | Programming language(s) to extract |
| no-cleanup | boolean | Skip database cleanup after finalization |
| overlay-base | boolean | [Advanced/experimental] Create the database so that it is usable as an overlay base for diff-informed (incremental) analysis. Combine with --cache-cleanup=overlay to retain only the data useful for later overlay evaluation. Pairs with overlay-changes on a subsequent overlay build. |
| overlay-changes | string | [Advanced/experimental] Create the database as an overlay on top of an existing overlay base. Path to a JSON file whose top-level object has a "changes" entry: a list of relative paths of files changed since the overlay base was created (e.g. {"changes":["src/app.js"]}). Only those files are extracted into the overlay. |
| overwrite | boolean | Overwrite existing database if it exists |
| ram | number | Amount of RAM to use (MB) |
| source-root | string | Root directory of source code |
| threads | number | Number of threads to use |
| verbose | boolean | Enable verbose output |
codeql_generate_log-summaryCreate a summary of a structured JSON evaluator event log file| Parameter | Type | Description |
|---|---|---|
| deduplicate-stage-summaries | boolean | Deduplicate stage summaries |
| format | string | Output format: text (human-readable), predicates (JSON), or overall (stats) |
| inputLog * | string | Path to the evaluator log file to summarize |
| minify-output | boolean | Minify JSON output |
| outputFile | string | Path to write the summary (optional, defaults to stdout) |
| utc | boolean | Force UTC timestamps |
codeql_generate_query-helpGenerate query help documentation from QLDoc comments| Parameter | Type | Description |
|---|---|---|
| format | string | Output format for the help documentation |
| outputFile | string | Path to write the help documentation |
| query * | string | Path to the query file to generate help for |
codeql_lsp_completionGet code completions at a cursor position in a CodeQL file. Returns completion items with labels, documentation, and insert text. The file must be a .ql or .qll file. IMPORTANT: Set workspace_uri to the pack or workspace root directory for dependency resolution; without it, completions for imported libraries will be empty.codeql_lsp_definitionGo to the definition of a CodeQL symbol at a given position. Returns one or more file locations where the symbol is defined. Set workspace_uri to the pack root for dependency resolution.codeql_lsp_diagnosticsAuthoritative syntax and semantic validation of CodeQL (QL) code via the CodeQL Language Server. Compiles the query and provides real-time diagnostics with precise error locations. Use this for accurate validation; for quick heuristic checks without compilation, use validate_codeql_query instead. Note: inline ql_code is evaluated as a virtual document and cannot resolve pack imports (e.g. `import javascript`). For validating queries with imports, use codeql_query_compile on the actual file instead.| Parameter | Type | Description |
|---|---|---|
| log_level | string | Language server log level |
| ql_code * | string | The CodeQL (QL) code to evaluate for syntax and semantic errors |
| search_path | string | Optional search path for CodeQL libraries |
| workspace_uri | string | Optional workspace URI for context (defaults to ./ql directory) |
codeql_lsp_document_symbolsList all top-level definitions (classes, predicates, modules) in a CodeQL file. Response contains location and type information unless names_only is set to true.| Parameter | Type | Description |
|---|---|---|
| names_only | boolean | If true, returns only symbol names as a compact string array instead of full symbol objects. Use this when you only need to know what names a file defines. |
codeql_lsp_referencesFind all references to a CodeQL symbol at a given position. Returns file locations of all usages, including the declaration. Set workspace_uri to the pack root for dependency resolution.codeql_pack_installInstall CodeQL pack dependencies| Parameter | Type | Description |
|---|---|---|
| force | boolean | Force reinstall of dependencies |
| no-strict-mode | boolean | Allow non-strict dependency resolution |
| packDir | string | Directory containing qlpack.yml (default: current) |
codeql_pack_lsList CodeQL packs under some local directory path| Parameter | Type | Description |
|---|---|---|
| dir | string | The root directory of the package or workspace, defaults to the current working directory |
| format | string | Output format: text (default) or json |
| groups | string | List of CodeQL pack groups to include or exclude |
codeql_query_compileCompile and validate CodeQL queries. By default, produces a .dil file containing the optimized DIL intermediate representation alongside the compilation output.| Parameter | Type | Description |
|---|---|---|
| additionalArgs | array | Additional command-line arguments |
| database | string | Path to the CodeQL database |
| dump-dil | boolean | Print the optimized DIL intermediate representation to standard output while compiling. Enabled by default; pass false or --no-dump-dil to disable. |
| library | string | Path to query library |
| logDir | string | Custom directory for compilation DIL output (overrides CODEQL_QUERY_LOG_DIR environment variable). If not provided, uses CODEQL_QUERY_LOG_DIR or defaults to .tmp/query-logs/<unique-id> |
| output | string | Output file path |
| query * | string | Path to the CodeQL query file (.ql) |
| verbose | boolean | Enable verbose output |
| warnings | string | How to handle compilation warnings |
codeql_query_formatAutomatically format CodeQL source code files| Parameter | Type | Description |
|---|---|---|
| backup | string | Backup extension when overwriting existing files |
| check-only | boolean | Check formatting without writing output |
| files * | array | One or more .ql or .qll source files to format |
| in-place | boolean | Overwrite each input file with formatted version |
| no-syntax-errors | boolean | Ignore syntax errors and pretend file is formatted |
| output | string | Write formatted code to this file instead of stdout |
codeql_query_runExecute a CodeQL query against a database. Use either "query" parameter for direct file path OR "queryName" + "queryLanguage" for pre-defined tool queries. Produces evaluator logs and BQRS results in a log directory. Use list_codeql_databases to discover databases, list_query_run_results to find previous results, and codeql_bqrs_decode to inspect BQRS output.| Parameter | Type | Description |
|---|---|---|
| cache-at-frontier | boolean | [Advanced/experimental] Force evaluation and caching of intermediate results useful for future overlay evaluation against an overlay-prepared base database. |
| evaluate-as-overlay | boolean | [Advanced/experimental] Override automatic detection and force the query to be evaluated in overlay mode against an overlay database (one built with --overlay-changes on top of an --overlay-base). Used for diff-informed (incremental) analysis of changed files. |
| evaluationFunction | string | [DEPRECATED - use format parameter instead] Built-in function for query results evaluation (e.g., "mermaid-graph", "json-decode", "csv-decode") or path to custom evaluation script |
| evaluationOutput | string | [DEPRECATED - use interpretedOutput parameter instead] Output file for evaluation results |
| evaluator-log | string | Path to save evaluator log (deprecated: use logDir instead) |
| evaluator-log-level | number | Evaluator log verbosity level (1-5, default 5) |
| evaluator-log-minify | boolean | Minimize evaluator log for smaller size |
| external | array | External predicate data: predicate=file.csv |
| format | string | Output format for query results via codeql bqrs interpret. Defaults to sarif-latest for @kind problem/path-problem queries, graphtext for @kind graph queries. Graph formats (graphtext, dgml, dot) only work with @kind graph queries. |
| interpretedOutput | string | Output file for interpreted results (e.g., results.sarif, results.txt). If not provided, defaults based on format: .sarif for SARIF, .txt for graphtext/csv, .dgml for dgml, .dot for dot |
| logDir | string | Custom directory for query execution logs (overrides CODEQL_QUERY_LOG_DIR environment variable). If not provided, uses CODEQL_QUERY_LOG_DIR or defaults to .tmp/query-logs/<unique-id> |
| query | string | Path to the CodeQL query file (.ql) - cannot be used with queryName |
| queryLanguage | string | Programming language for tools queries (e.g., "javascript", "java", "python") - required when using queryName |
| queryName | string | Name of pre-defined query to run (e.g., "PrintAST", "CallGraphFrom", "CallGraphTo") - requires queryLanguage |
| queryPack | string | Query pack path (defaults to server/ql/<language>/tools/src/ for tool queries) |
| sourceFiles | string | Comma-separated list of source file paths for PrintAST queries (e.g., "src/main.js,src/utils.js" or just "main.js") |
| sourceFunction | string | Comma-separated list of source function names for CallGraphFrom queries (e.g., "main,processData") |
| targetFunction | string | Comma-separated list of target function names for CallGraphTo queries (e.g., "helper,validateInput") |
| tuple-counting | boolean | Display tuple counts for each evaluation step in evaluator logs |
codeql_resolve_databaseResolve database path and validate database structure| Parameter | Type | Description |
|---|---|---|
| database * | string | Database path to resolve |
| format | string | Output format for database information |
codeql_resolve_filesFind files in a directory tree, filtered by extension and glob patterns. Useful for discovering QL library files, query files, and other CodeQL-related files within packs or workspaces.| Parameter | Type | Description |
|---|---|---|
| also-match | array | Additional glob filter all results must match |
| dir * | string | The directory to search for files |
| exclude | array | Glob patterns to exclude |
| follow-symlinks | boolean | Follow symlinks when searching |
| format | string | Output format (default: text) |
| include | array | Glob patterns to include (e.g., ['**/RemoteFlowSource*']) |
| include-extension | array | Include files with given extensions (e.g., ['.qll', '.ql']) |
| prune | array | Glob patterns for directories to prune from search |
codeql_resolve_languagesList installed CodeQL extractor packs| Parameter | Type | Description |
|---|---|---|
| additionalArgs | array | Additional command-line arguments |
| format | string | Output format for language information |
| verbose | boolean | Enable verbose output |
codeql_resolve_library-pathResolve paths to source code for all libraries used by, or available to, the given CodeQL query or qll file.| Parameter | Type | Description |
|---|---|---|
| additionalArgs | array | Additional command-line arguments |
| format | string | Output format for library path information |
| query * | string | Path to a .ql or .qll file for the context to perform resolution for. |
| verbose | boolean | Enable verbose output |
codeql_resolve_metadataResolve and return the key-value metadata pairs from a CodeQL query source file.| Parameter | Type | Description |
|---|---|---|
| additionalArgs | array | Additional command-line arguments |
| format | string | Output format for metadata information (always JSON, optional for future compatibility) |
| query * | string | Query file to resolve metadata for |
| verbose | boolean | Enable verbose output |
codeql_resolve_packsResolve packs available within a project directory, provided as a search path, and the source roots of those available packs.| Parameter | Type | Description |
|---|---|---|
| format | string | Output format for qlref resolution |
| search-path * | string | The project root, to search packs available in the project. Typically the ".", or the current working directory. |
codeql_resolve_qlrefResolve qlref files to their corresponding query files| Parameter | Type | Description |
|---|---|---|
| format | string | Output format for qlref resolution |
| qlref * | string | Path to the .qlref file to resolve |
codeql_resolve_queriesList available CodeQL queries found on the local filesystem| Parameter | Type | Description |
|---|---|---|
| additional-packs | any | Additional pack directories to search for CodeQL packs |
| directory | string | Directory to search for queries |
| format | string | Output format for query list |
| language | string | Filter queries by programming language |
codeql_resolve_testsResolve the local filesystem paths of unit tests and/or queries under some base directory| Parameter | Type | Description |
|---|---|---|
| format | string | Output format for test list |
| tests | array | One or more tests (.ql, .qlref files, or test directories) |
codeql_test_acceptAccept new test results as the expected baseline| Parameter | Type | Description |
|---|---|---|
| tests * | array | One or more tests (.ql, .qlref files, or test directories) |
codeql_test_extractExtract test databases for CodeQL query tests| Parameter | Type | Description |
|---|---|---|
| language | string | Programming language for extraction |
| tests * | array | One or more test directories or files |
codeql_test_runRun CodeQL query tests| Parameter | Type | Description |
|---|---|---|
| check-diff-informed | boolean | [Advanced/experimental] Check the correct filtering of diff-informed queries. Validates that a query opting into diff-informed analysis (via observeDiffInformedIncrementalMode() in its dataflow configuration) reports the locations it claims through getASelectedSourceLocation/getASelectedSinkLocation. Use this to develop and verify diff-informed queries locally. |
| evaluate-as-overlay | boolean | [Advanced/experimental] Override automatic detection and force test queries to be evaluated in overlay mode against an overlay-prepared test database. Used when developing overlay/diff-informed analysis. |
| keep-databases | boolean | Keep test databases after running tests |
| learn | boolean | Accept current output as expected for failing tests |
| logDir | string | Custom directory for test execution logs (overrides CODEQL_QUERY_LOG_DIR environment variable). If not provided, uses CODEQL_QUERY_LOG_DIR or defaults to .tmp/query-logs/<unique-id> |
| show-extractor-output | boolean | Show output from extractors during test execution |
| tests * | array | One or more tests (.ql, .qlref files, or test directories) |
create_codeql_queryCreate directory structure and files for a new CodeQL query with tests| Parameter | Type | Description |
|---|---|---|
| basePath * | string | Base path where src/ and test/ directories will be created |
| description | string | Description of what the query does |
| language * | string | Target programming language (e.g., javascript, python, java) |
| queryId | string | Custom query ID (defaults to language/example/queryname) |
| queryName * | string | Name of the query (e.g., MySecurityQuery) |
find_class_positionFinds startline, startcol, endline endcol of a class for quickeval| Parameter | Type | Description |
|---|---|---|
| file * | string | Path to the .ql file to search |
| name * | string | Name of the class to find |
find_codeql_query_filesFind and track all files and directories related to a CodeQL query, including resolved metadata| Parameter | Type | Description |
|---|---|---|
| language | string | Programming language (optional, will be inferred if not provided) |
| queryPath * | string | Path to the CodeQL query file (.ql) |
| resolveMetadata | boolean | Whether to resolve query metadata (default: true) |
find_predicate_positionFinds startline, startcol, endline endcol of a predicate for quickeval| Parameter | Type | Description |
|---|---|---|
| file * | string | Path to the .ql file to search |
| name * | string | Name of the predicate to find |
list_codeql_databasesList CodeQL databases discovered in configured base directories (set via CODEQL_DATABASES_BASE_DIRS env var). Returns path, language, CLI version, and creation time for each database. Use the returned database paths with codeql_query_run or codeql_database_analyze to run queries against them.| Parameter | Type | Description |
|---|---|---|
| language | string | Filter databases by language (e.g., "javascript", "python") |
list_mrva_run_resultsList discovered MRVA (Multi-Repository Variant Analysis) run results (set via CODEQL_MRVA_RUN_RESULTS_DIRS env var). Returns run ID, timestamp, repositories scanned, analysis status, and available artifacts for each run.| Parameter | Type | Description |
|---|---|---|
| runId | string | Filter results by run ID (e.g., "20442") |
list_query_run_resultsList discovered query run result directories (set via CODEQL_QUERY_RUN_RESULTS_DIRS env var). Returns path, query name, timestamp, language, query file path, and available artifacts (evaluator-log, bqrs, sarif, query.log, summary) for each run. Filter by queryName, language, or queryPath to narrow results. Use the returned BQRS paths with codeql_bqrs_decode or codeql_bqrs_info to inspect query results.| Parameter | Type | Description |
|---|---|---|
| language | string | Filter by CodeQL language (e.g., "javascript", "python", "java"). Extracted from the database path in query.log. Runs without a query.log are excluded when this filter is set. |
| queryName | string | Filter results by query name (e.g., "UI5Xss.ql") |
| queryPath | string | Filter by query file path. Absolute paths match exactly; relative paths/substrings match case-insensitively. Requires query.log to be present. |
profile_codeql_queryProfile the performance of a CodeQL query run against a specific database by analyzing the evaluator log JSON file| Parameter | Type | Description |
|---|---|---|
| database * | string | Path to the CodeQL database directory |
| evaluatorLog | string | Path to an existing structured JSON log (e.g., evaluator-log.jsonl) file. If not provided, the tool will run the query to generate one. |
| outputDir | string | Directory to write profiling data files (defaults to same directory as evaluator log) |
| query * | string | Path to the .ql query file |
profile_codeql_query_from_logsParse CodeQL evaluator logs into a structured performance profile. Returns compact JSON with per-query summaries and top-N slowest predicates (name, duration, result size, eval order, dependency count). Full RA operations, pipeline-stage tuple progressions, and dependency lists are written to a line-indexed detail file — each predicate includes detailLines: {start, end} for targeted read_file access to its full analysis. Works with logs from codeql query run, codeql database analyze, or vscode-codeql.| Parameter | Type | Description |
|---|---|---|
| evaluatorLog * | string | Path to evaluator-log.jsonl or evaluator-log.summary.jsonl |
| outputDir | string | Directory to write profile output files (defaults to same directory as log) |
| topN | number | Number of slowest predicates to include per query (default: 20) |
query_results_cache_clearClear cached query results by cache key, query name, database path, or clear all.| Parameter | Type | Description |
|---|---|---|
| all | boolean | Clear the entire query results cache. |
| cacheKey | string | Clear a specific cache entry. |
| databasePath | string | Clear all entries for this database. |
| queryName | string | Clear all entries for this query name. |
| ruleId | string | Clear all entries for this CodeQL query @id. |
query_results_cache_compareCompare cached query results across multiple databases for the same query. Useful for MRVA-style cross-repository analysis.| Parameter | Type | Description |
|---|---|---|
| language | string | Filter by language. |
| queryName | string | The query name to compare across databases. |
| ruleId | string | The CodeQL query @id to compare across databases (preferred over queryName). |
query_results_cache_lookupCheck whether cached query results exist for given parameters. Returns metadata about the cached entry without the full content.| Parameter | Type | Description |
|---|---|---|
| cacheKey | string | Look up by exact cache key (if known). |
| databasePath | string | Database path to search for. |
| language | string | Filter by language (e.g. "cpp", "javascript"). |
| limit | number | Maximum number of cache entries to return when listing by filter (default: 50, max: 500). |
| queryName | string | Query name to search for (e.g. "PrintAST", "CallGraphFrom"). |
| ruleId | string | Filter by CodeQL query @id (e.g. "js/sql-injection"). The @id is the most reliable identifier. |
query_results_cache_retrieveRetrieve cached query results with optional subset selection. Supports line ranges (for graphtext/CSV) and SARIF result indices and file filtering to return only the relevant portion.| Parameter | Type | Description |
|---|---|---|
| cacheKey * | string | The cache key of the result to retrieve. |
| fileFilter | string | For SARIF: only include results whose file path contains this string. |
| lineRange | object | First line to include (1-indexed, inclusive). |
| maxLines | number | Maximum number of lines to return for line-based formats (default: 500). |
| maxResults | number | Maximum number of SARIF results to return (default: 100). |
| resultIndices | object | First SARIF result index to include (0-indexed, inclusive). |
quick_evaluateResolve a class or predicate symbol in a CodeQL query file for quick evaluation. Locates the symbol position and returns an output path for results. Note: this tool validates the symbol exists but does not yet execute the evaluation — use codeql_query_run for full evaluation.| Parameter | Type | Description |
|---|---|---|
| db * | string | Path to the CodeQL database |
| file * | string | Path to the .ql file containing the symbol |
| output_path | string | Output path for results (defaults to project-local .tmp/quickeval/) |
| symbol * | string | Name of the class or predicate to evaluate |
read_database_sourceRead source file contents from a CodeQL database source archive (src.zip) or source directory (src/). Use this to explore code at alert locations discovered via codeql_bqrs_interpret SARIF output. Omit filePath to list all files in the archive. Accepts raw file paths, file:// URIs (as found in SARIF physicalLocation.artifactLocation.uri), or paths relative to the archive root. Use startLine/endLine to return only the relevant portion of large files.| Parameter | Type | Description |
|---|---|---|
| databasePath * | string | Path to the CodeQL database directory |
| endLine | number | Last line to return (1-based, inclusive). Defaults to end of file. |
| filePath | string | Path of the source file to read. Accepts a raw path, a file:// URI from SARIF, or a path relative to the archive root. Omit to list all files in the archive. |
| maxEntries | number | Maximum number of entries to return in listing mode (when filePath is omitted). Defaults to 1000. When the total exceeds this limit the response includes truncated: true. Use prefix to narrow results for large databases. |
| prefix | string | Filter listing results to entries starting with this prefix (listing mode only). |
| startLine | number | First line to return (1-based, inclusive). Defaults to 1. |
register_databaseRegister a CodeQL database for use by other MCP tools. Validates that the database directory exists, contains codeql-database.yml, and has source files (src.zip or src/). Does not persist any session state — acts as a preflight check before using other database tools.| Parameter | Type | Description |
|---|---|---|
| db_path * | string | Path to the CodeQL database directory |
sarif_compare_alertsCompare code locations of two SARIF alerts to detect overlap. Supports sink, source, any-location, full-path, and fingerprint comparison modes.| Parameter | Type | Description |
|---|---|---|
| overlapMode | string | Comparison mode: "sink" (primary locations), "source" (first dataflow step), "any-location" (all locations), "full-path" (structural path similarity), "fingerprint" (partialFingerprints match, falls back to full-path). |
sarif_deduplicate_rulesIdentify duplicate alerts across two SARIF files by comparing rules pairwise. Uses fingerprint matching first, then full-path location overlap as fallback. Useful for cleanup after query changes or pack upgrades.| Parameter | Type | Description |
|---|---|---|
| cacheKeyA | string | Cache key for the first SARIF. |
| cacheKeyB | string | Cache key for the second SARIF. |
| overlapThreshold | number | Minimum overlap score (0-1) to consider a rule pair as duplicates. Default: 0.8. |
| sarifPathA | string | Path to the first SARIF file. |
| sarifPathB | string | Path to the second SARIF file. |
sarif_diff_by_commitsCorrelate SARIF results with a git diff to classify findings as "new" (introduced in the diff) or "pre-existing". Accepts a SARIF file and a git ref range (e.g. "main..HEAD"). Supports file-level or line-level granularity.| Parameter | Type | Description |
|---|---|---|
| cacheKey | string | Cache key to read SARIF from (alternative to sarifPath). |
| granularity | string | Matching granularity: "file" classifies any result in a changed file as new; "line" additionally checks that the result line falls within a changed hunk. Default: "file". |
| refRange * | string | Git ref range for the diff (e.g. "main..HEAD", "abc123..def456"). Passed directly to `git diff`. |
| repoPath | string | Path to the git repository. Defaults to the current working directory. |
| sarifPath | string | Path to the SARIF file. |
sarif_diff_runsDiff two SARIF files or cached results to find added, removed, and changed rules/results. Useful for comparing analysis across CodeQL versions, database updates, or query pack releases.| Parameter | Type | Description |
|---|---|---|
| cacheKeyA | string | Cache key for the first (baseline) SARIF. |
| cacheKeyB | string | Cache key for the second (comparison) SARIF. |
| labelA | string | Label for the first run (e.g. "v2.20.3", "main-branch", "database-A"). |
| labelB | string | Label for the second run (e.g. "v2.20.4", "feature-branch", "database-B"). |
| sarifPathA | string | Path to the first (baseline) SARIF file. |
| sarifPathB | string | Path to the second (comparison) SARIF file. |
sarif_extract_ruleExtract all data for a specific rule/query from multi-rule SARIF. Returns a valid SARIF JSON subset with only the matching rule definition and results.| Parameter | Type | Description |
|---|---|---|
| cacheKey | string | Cache key to read SARIF from (alternative to sarifPath). |
| ruleId * | string | The SARIF rule ID to extract (e.g. "js/sql-injection"). Corresponds to the CodeQL query @id. |
| sarifPath | string | Path to the SARIF file. |
sarif_list_rulesList all rules in a SARIF file with result counts, severity, precision, and tags. Essential for discovering available rules before extraction or comparison.| Parameter | Type | Description |
|---|---|---|
| cacheKey | string | Cache key to read SARIF from (alternative to sarifPath). |
| sarifPath | string | Path to the SARIF file. |
sarif_rule_to_markdownConvert per-rule SARIF data to a structured markdown report with Mermaid dataflow diagrams. Renders dataflow paths as visual flowcharts.| Parameter | Type | Description |
|---|---|---|
| cacheKey | string | Cache key to read SARIF from (alternative to sarifPath). |
| ruleId * | string | The rule ID to render (e.g. "js/sql-injection"). |
| sarifPath | string | Path to the SARIF file. |
sarif_storeStore SARIF content in the session cache for use by other sarif_* tools. Returns a cache key that can be passed to sarifPath/cacheKey parameters of other tools.| Parameter | Type | Description |
|---|---|---|
| label | string | Human-readable label for this SARIF (e.g. "dubbo-java-2025-03"). |
| sarifContent | string | SARIF JSON content as a string (alternative to sarifPath). |
| sarifPath | string | Path to a SARIF file on disk. |
search_ql_codeSearch QL source files (.ql/.qll) for text or regex patterns. Returns structured results with file paths, line numbers, and optional context lines. Use this instead of grep for searching CodeQL source code.| Parameter | Type | Description |
|---|---|---|
| caseSensitive | boolean | Whether search is case sensitive (default: true) |
| contextLines | number | Lines of context before and after each match (default: 0, max: 50) |
| includeExtensions | array | File extensions to search (default: ['.ql', '.qll']) |
| maxResults | number | Maximum number of matching lines to return (default: 100, max: 10000) |
| paths * | array | Directories or files to search in |
| pattern * | string | Text or regex pattern to search for (JavaScript regex syntax) |
session_calculate_current_scoreCalculate current quality score for a session based on its state| Parameter | Type | Description |
|---|---|---|
| sessionId * | string | ID of the session |
session_endEnd a query development session with final status| Parameter | Type | Description |
|---|---|---|
| sessionId * | string | ID of the session to end |
| status * | string | Final status of the session |
session_getGet complete details of a specific query development session| Parameter | Type | Description |
|---|---|---|
| sessionId * | string | ID of the session to retrieve |
session_get_call_historyGet MCP call history for a specific session| Parameter | Type | Description |
|---|---|---|
| limit | number | Maximum number of calls to return (most recent first) |
| sessionId * | string | ID of the session |
session_get_score_historyGet quality score history for a specific session| Parameter | Type | Description |
|---|---|---|
| limit | number | Maximum number of scores to return (most recent first) |
| sessionId * | string | ID of the session |
session_get_test_historyGet test execution history for a specific session| Parameter | Type | Description |
|---|---|---|
| limit | number | Maximum number of test executions to return (most recent first) |
| sessionId * | string | ID of the session |
session_listList query development sessions with optional filtering| Parameter | Type | Description |
|---|---|---|
| dateRange | array | Filter by date range [start, end] (ISO timestamps) |
| language | string | Filter by programming language |
| queryPath | string | Filter by query path (partial match) |
| queryType | string | Filter by query type |
| status | string | Filter by session status |
session_update_stateUpdate the current state of a query development session| Parameter | Type | Description |
|---|---|---|
| compilationStatus | string | Current compilation status |
| documentationStatus | string | Documentation status |
| filesPresent | array | List of files present in the query development |
| sessionId * | string | ID of the session to update |
| testStatus | string | Current test status |
sessions_aggregateGenerate aggregate insights from multiple sessions based on filters| Parameter | Type | Description |
|---|---|---|
| dateRange | array | Filter by date range [start, end] (ISO timestamps) |
| language | string | Filter by programming language |
| queryPath | string | Filter by query path (partial match) |
| queryType | string | Filter by query type |
| status | string | Filter by session status |
sessions_compareCompare multiple query development sessions across specified dimensions| Parameter | Type | Description |
|---|---|---|
| dimensions | array | Specific dimensions to compare (default: all) |
| sessionIds * | array | Array of session IDs to compare |
sessions_exportExport session data in specified format for external analysis| Parameter | Type | Description |
|---|---|---|
| format | string | Export format |
| sessionIds * | array | Array of session IDs to export |
validate_codeql_queryQuick heuristic validation for CodeQL query structure - checks for common patterns like from/where/select clauses and metadata presence. Does NOT compile the query. For authoritative validation with actual compilation, use codeql_lsp_diagnostics instead.| Parameter | Type | Description |
|---|---|---|
| language | string | Target programming language |
| query * | string | The CodeQL query to validate |
Security checks
- ✓README presentThe repository's README runs to about 870 words.
- ✓License declaredUsable under a stated license.
- ✓Tests presentA test suite exists in the repository.
- ✓Dependencies pinnedA lockfile pins dependency versions.
- !No dynamic code executionScanned 131 source files and found 3 calls to eval or shell execution, in extensions/vscode/src/server/pack-installer.ts and server/src/lib/cli-executor.ts among others. Review how tool inputs reach them before granting credentials.
1 check has not been run yet.
Releases
README
The repository's README runs to about 870 words, fetched a month ago. The original in the repository is authoritative.
Read full README