AL MCP: al_downloadsymbols ignores projectPath — always operates on the first workspace project
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 72/100
Research direction
Start in DownloadSymbolsService.DownloadSymbolsAsync and trace how the current solution selects a project. Compare that resolution with al_build's solution.FindProject(projectPath) behavior and reproduce the multi-project MCP call from the issue. Done means the requested project's references and .alpackages cache are used, with an error for an unknown supplied path and first-project behavior only when the path is empty.
Written by the indexing model from the issue text.
Description
Describe the issue
In a multi-project workspace, the al_downloadsymbols MCP tool ignores its projectPath parameter for project selection. Regardless of which project path is passed, it reads the manifest, checks references, and downloads into the package cache of the first project loaded at server start. This makes it impossible to provision symbols for the other projects of a multi-project workspace from a single MCP server instance.
Environment: microsoft.dynamics.businesscentral.development.tools 18.0.37.11445-beta (dotnet tool), al launchmcpserver, stdio transport, Windows 11, net10.0.
Steps to reproduce
- Workspace with multiple projects, e.g. a main app and a test app with different dependencies (test app references Test Runner, Library Assert, etc.):
al launchmcpserver app test-app --transport stdio - Call the tool for the second project:
{"name":"al_downloadsymbols","arguments":{"projectPath":"C:/work/repo/test-app","globalSourcesOnly":true,"force":true}}
Expected
Symbols for test-app's references downloaded into test-app/.alpackages.
Actual
The response reports the first project's reference count and cache path (app/.alpackages); the test app's references (Test Runner, Library Assert, …) are never examined. Relative paths and absolute paths behave identically. There is no error or warning that projectPath was not honored.
{"succeeded":true,"message":"All symbols are already in cache. No download needed.",
"data":{"downloadedCount":0,"totalReferences":3,"requestedCount":0,
"cachePath":"C:\\work\\repo\\app\\.alpackages"}}
Root cause
Microsoft.Dynamics.Nav.LanguageModelTools.DownloadSymbols.DownloadSymbolsService.DownloadSymbolsAsync selects the project as:
Project project = currentSolution.Projects.FirstOrDefault();
parameters.ProjectPath is only consumed by ConnectionOptionsBuilder.MergeFromLaunchJson to locate a launch.json for server-connection defaults ΓÇö it never participates in project selection. (Compare with the al_build handler, which resolves the target correctly via solution.FindProject(projectPath), and al_getdiagnostics, which filters on project.ProjectFolder.)
Impact / workaround
A multi-project workspace (e.g. app + test apps, the standard AL test setup) cannot be symbol-provisioned through one MCP server. Current workaround is launching a separate ephemeral al launchmcpserver <project> per project so each becomes the "first" project ΓÇö confirmed working, but it defeats the per-call projectPath parameter and the documented multi-project workspace support.
Suggested fix
Resolve the target project the same way al_build does (solution.FindProject(parameters.ProjectPath), falling back to the first project when the parameter is empty), and return an error when a supplied projectPath matches no loaded project instead of silently using a different one.
Internal work item: AB#648589
- Dominant language
- PowerShell
- Stars
- 881
- Forks
- 285
- Avg merge
- 3d 36m
- Merged PRs (30d)
- 1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/AL
-
accepted al-tools bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
AL 18.0.2732683 regression: System.Drawing types cannot be resolved from assembly probing paths Open
Difficulty 4/5 3-5 days Newbie friendliness 48/100
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
-
accepted packaging
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
from:qa priority:P2 reliability tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
spec-kitty/spec-kitty#4874 ·
-
0. Needs triage bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
nextcloud/fulltextsearch#1011 ·
-
automation code-quality cookie deep-report documentation improvement quick-win task-mining
Difficulty 1/5 Under an hour Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100