SonarQube MCP Server
OFFICIAL SERVERSonarQube Cloud or Server findings, quality gates and code analysis inside your coding assistant
Write, test, run and profile CodeQL queries from an AI assistant through the local CodeQL CLI
Official · GitHub Advanced Security TypeScript Local · stdio Developer toolsSecurity
51 popularity score ★ 39 ↓ 838/wk
Opens the app, which asks before it adds the server.
claude mcp add codeql-development -- npx -y codeql-development-mcp-server{
"mcpServers": {
"codeql-development": {
"command": "npx",
"args": [
"-y",
"codeql-development-mcp-server"
]
}
}
}{
"mcpServers": {
"codeql-development": {
"command": "npx",
"args": [
"-y",
"codeql-development-mcp-server"
]
}
}
}{
"servers": {
"codeql-development": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"codeql-development-mcp-server"
]
}
}
}[mcp_servers.codeql-development]
command = "npx"
args = ["-y", "codeql-development-mcp-server"]gemini mcp add --scope user codeql-development npx -- -y codeql-development-mcp-serverCODEQL_PATH |
Optional: Absolute path to the CodeQL CLI binary; defaults to codeql on PATH. |
|---|---|
TRANSPORT_MODE |
Optional: stdio (default) or http. |
HTTP_PORT |
Optional: Port for HTTP mode, default 3000. |
HTTP_HOST |
Optional: Address HTTP mode binds to, default localhost. |
DEBUG |
Optional: Turn on debug logging, default false. |
CodeQL Development MCP Server (registered in clients as ql-mcp) helps an assistant author CodeQL queries. It wraps the CodeQL CLI you install yourself: it creates and analyses CodeQL databases, compiles, formats and runs queries, scaffolds a new query with its test folder, runs and accepts query tests, decodes BQRS output and works through SARIF files (listing rules, diffing two runs, splitting out one rule, sorting findings into new and pre-existing against a git diff). Through the CodeQL language server it also gives completions, go-to-definition, references and diagnostics for .ql files.
Beyond tools it serves 10 prompts for guided workflows (test-driven query writing, ranking likely false or true positives in SARIF, documenting a query, building a training workshop) and reference resources such as per-language AST and security-pattern guides. It covers the CodeQL languages actions, cpp, csharp, go, java, javascript, python, ruby and swift.
The npm page advertises 34 tools, but the source at v2.27.2 registers far more by default: 49 CodeQL, language-server, query-development and SARIF tools listed in its server-tools reference, plus 6 annotation tools, 4 audit-finding tools and 4 query-results-cache tools that the reference does not list, 63 in all. A further 11 session-tracking tools are off unless enabled. It is maintained by GitHub's CodeQL Expert Services team in the advanced-security organisation.
| Runtime | Node.js 25+ |
|---|
Node.js v25.6.0 or later (npx). The CodeQL CLI installed separately and on PATH, or its binary given in CODEQL_PATH. Some tools that run bundled queries (such as PrintAST) need their pack dependencies installed first with the package's second program, codeql-development-mcp-server-setup-packs. CodeQL databases or source code to work on. Building from source with plain npm run build also needs a Go toolchain for the client CLI.
It does nothing without a working CodeQL CLI, and some CLI features are not exposed as tools. Speed depends on the size of the databases analysed. validate_codeql_query is a heuristic check that does not compile, and codeql_lsp_diagnostics on inline code cannot resolve pack imports. Use is governed by the GitHub CodeQL Terms and Conditions rather than an open-source licence, and its support page promises no support. In HTTP mode it binds to localhost on port 3000 unless HTTP_HOST or HTTP_PORT is set (source, not in the README).
Suits security engineers and CodeQL authors who already use the CodeQL CLI and want an assistant to write queries test-first, run them on local databases and triage SARIF output. It runs entirely on your machine and needs no account. Inside VS Code or Cursor the makers recommend their VSIX extension, which bundles the server and finds the CLI for you. It is not a code-scanning service: if you want GitHub's code scanning alerts for a repository rather than query development, look elsewhere.
codeql_bqrs_decodecodeql_bqrs_infocodeql_bqrs_interpretcodeql_database_analyzecodeql_database_createcodeql_generate_log-summarycodeql_generate_query-helpcodeql_pack_installcodeql_pack_lscodeql_query_compilecodeql_query_formatcodeql_query_runcodeql_resolve_databasecodeql_resolve_languagescodeql_resolve_metadatacodeql_resolve_queriescodeql_resolve_testscodeql_test_acceptcodeql_test_extractcodeql_test_runcodeql_lsp_completioncodeql_lsp_definitioncodeql_lsp_diagnosticscodeql_lsp_referencescreate_codeql_queryfind_class_positionfind_codeql_query_filesfind_predicate_positionlist_codeql_databaseslist_mrva_run_resultslist_query_run_resultsprofile_codeql_queryprofile_codeql_query_from_logsquick_evaluateread_database_sourceregister_databasesearch_ql_codevalidate_codeql_querysarif_compare_alertssarif_deduplicate_rulessarif_diff_by_commitssarif_diff_runssarif_extract_rulesarif_list_rulessarif_rule_to_markdownsarif_storequery_results_cache_lookupquery_results_cache_comparequery_results_cache_retrievequery_results_cache_clearannotation_createannotation_getannotation_listannotation_updateannotation_deleteannotation_searchaudit_store_findingsaudit_list_findingsaudit_add_notesaudit_clear_repo