Summary
In a multi-root VS Code workspace, the bundled MCP workflow prompts (slash commands served by the CodeQL Development MCP Server) cannot operate on CodeQL queries that live in a workspace folder other than the first one (index 0). When the queries the user wants to analyze are located in the second/third/etc. root folder, the workflow cannot resolve or act on them.
Environment
- CodeQL Development MCP Server VS Code extension (which wraps and launches the MCP server).
- A multi-root workspace with two or more folders, where the CodeQL query pack is not the first folder (a common layout: the query-development repo and the target-application repo are opened as separate root folders).
Steps to reproduce
- Open a multi-root workspace with ≥2 folders. Place the CodeQL queries you want to drive the workflow against in a folder that is not at index 0.
- From Copilot Chat, invoke an MCP workflow prompt that operates on a query (for example, a workflow that takes a query path / database path).
- Point the workflow at a query located in the non-first root folder.
Expected
The workflow can resolve and operate on CodeQL queries (and related paths) in any workspace folder, not only the first.
Actual
The workflow only succeeds when the target queries are in the first workspace folder. Queries that live in other root folders are not found/usable, so the workflow cannot proceed.
Likely area
The extension's environment/path resolution appears to assume the first workspace folder (e.g. a single "primary workspace" value derived from folder index 0) rather than considering all workspace roots. The relevant logic is the environment builder that computes the workspace/database/additional-pack paths passed to the MCP server.
Impact
Multi-root setups — including the recommended pattern of keeping the query repository and the analysis-target repository as separate workspace roots — cannot use the prompt-driven workflows against queries unless the query repo happens to be opened first.
Requirements
- Resolve query/database/pack paths against all workspace folders (or against the folder that actually contains the referenced path), rather than defaulting to index 0.
- Add at least one extension-level configuration setting that lets users explicitly specify the directories to include and/or exclude when resolving CodeQL query and pack paths. For example,
include and exclude directory-list settings (workspace-relative and/or absolute paths) under the extension's configuration namespace. This gives users deterministic, explicit control over query/pack resolution that is independent of workspace-folder ordering, and provides a way to scope resolution (e.g. exclude large node_modules/vendor trees, or include a query repo that is not the first root).
- Document the new setting(s) and how they interact with multi-root folder resolution.
Acceptance criteria
- A query/pack located in a non-first workspace folder can be resolved and used by the MCP workflow prompts.
- Users can configure explicit include/exclude directories for query and pack resolution via extension settings, and those settings are honored.
Summary
In a multi-root VS Code workspace, the bundled MCP workflow prompts (slash commands served by the CodeQL Development MCP Server) cannot operate on CodeQL queries that live in a workspace folder other than the first one (index 0). When the queries the user wants to analyze are located in the second/third/etc. root folder, the workflow cannot resolve or act on them.
Environment
Steps to reproduce
Expected
The workflow can resolve and operate on CodeQL queries (and related paths) in any workspace folder, not only the first.
Actual
The workflow only succeeds when the target queries are in the first workspace folder. Queries that live in other root folders are not found/usable, so the workflow cannot proceed.
Likely area
The extension's environment/path resolution appears to assume the first workspace folder (e.g. a single "primary workspace" value derived from folder index 0) rather than considering all workspace roots. The relevant logic is the environment builder that computes the workspace/database/additional-pack paths passed to the MCP server.
Impact
Multi-root setups — including the recommended pattern of keeping the query repository and the analysis-target repository as separate workspace roots — cannot use the prompt-driven workflows against queries unless the query repo happens to be opened first.
Requirements
includeandexcludedirectory-list settings (workspace-relative and/or absolute paths) under the extension's configuration namespace. This gives users deterministic, explicit control over query/pack resolution that is independent of workspace-folder ordering, and provides a way to scope resolution (e.g. exclude largenode_modules/vendor trees, or include a query repo that is not the first root).Acceptance criteria