Skip to content

feat!: cross-platform almcp launcher and tool-store-only resolution - #26

Open
Arthurvdv wants to merge 7 commits into
mainfrom
feat/almcp-cross-platform-launcher
Open

Arthurvdv wants to merge 7 commits into
mainfrom
feat/almcp-cross-platform-launcher

Conversation

@Arthurvdv

@Arthurvdv Arthurvdv commented Sep 13, 2026

Copy link
Copy Markdown
Member

Base / CI: retargeted to main on 2026-09-13 so CI runs; until PR #25 merges the GitHub diff also shows PR #25's three commits. CI run 34774977712 is green: on the Ubuntu Test (v18.0.41.39415) job all nine almcp-backed tests executed (ALCOPS_TESTS_REQUIRE_ALMCP=1, almcp.dll launched through the dotnet host), 111 tests total.

Summary

  • Launch almcp through dotnet almcp.dll on Linux and macOS where the nupkg ships no native launcher, making the proxy functional on every OS.
  • Drop the AL VS Code extension probe from BcToolsLocator — the dotnet tool store is now the only automatic probe (after --devtools-path and BCDEVELOPMENTTOOLSPATH).
  • Enable the almcp-backed integration tests on the Ubuntu CI matrix and add ALCOPS_TESTS_REQUIRE_ALMCP to fail loudly instead of silently skipping.
  • Document the platform support matrix and the updated resolution order.

What changed

BcToolsLocator

  • New AlMcpLaunch record (FileName, LeadingArgs, Description) replaces the raw AlMcpPath-based availability check. Constructor resolution: native almcp.exe/almcpdotnet almcp.dll via DotnetHostnull.
  • TryAlExtension removed; error message now enumerates every probe with its outcome and gives the exact install command.

DotnetHost (new)

  • Pure, testable resolution: DOTNET_HOST_PATH → process path → DOTNET_ROOT/DOTNET_ROOT_X64PATH scan → bare "dotnet".

AlMcpProxy

  • Stores AlMcpLaunch instead of a path string; LaunchChild prepends LeadingArgs to the argument list.

AlMcpFixture (tests)

  • Falls back to BcToolsLocator.ResolveToolsDirectory() when the baked BcToolsPath is absent, so CI's BCDEVELOPMENTTOOLSPATH is honoured.
  • ALCOPS_TESTS_REQUIRE_ALMCP=1 turns skips into hard failures.

CI workflow

  • Extracts the full tools/net10.0/any/ payload (with runtimeconfig, deps.json) alongside the flat DLL extraction.
  • Sets BCDEVELOPMENTTOOLSPATH and ALCOPS_TESTS_REQUIRE_ALMCP=1 on the test step when the full payload exists.

Docs

  • README: requirements updated, "Platform support" table added, resolution list updated, extension references removed.
  • src/ALCops.Mcp/README.md: extension reference removed.
  • AGENTS.md: BcToolsLocator bullet updated with launch shapes and no-auto-install note.
  • .github/ISSUE_TEMPLATE/bug_report.yml: "AL Language extension version" field replaced with "BC Development Tools version".

Corrects PR #20's known-issue note

PR #20 noted that the nupkg ships only almcp.exe/almcp.dll with no extension-less launcher, making the proxy unavailable from the tool store on Linux/macOS. This PR resolves that by falling back to dotnet almcp.dll when no native launcher exists.

Breaking changes

The AL VS Code extension is no longer probed for BC DevTools. Users who relied on the extension as their sole DevTools source must either:

  • Install the dotnet tool: dotnet tool install -g Microsoft.Dynamics.BusinessCentral.Development.Tools
  • Or point --devtools-path / BCDEVELOPMENTTOOLSPATH at the extension's bin/<platform> folder.

Test plan

  • dotnet build --configuration Release — 0 warnings, 0 errors
  • dotnet test --configuration Release — 111 tests pass (including 4 almcp-backed tests on Windows)
  • New DotnetHostTests (6 tests): precedence order, bare fallback
  • New BcToolsLocatorTests: AlMcp_PrefersNativeLauncher, AlMcp_FallsBackToDotnetWhenOnlyDllShips, AlMcp_AbsentWhenNeitherShips, Resolve_NothingInstalled_ErrorNamesEveryProbeAndTheInstallCommand
  • almcp-backed tests run for real on the Windows dev machine (native almcp.exe)
  • CI: Ubuntu matrix ran the almcp-backed tests via dotnet almcp.dll (run 34774977712: all nine AlMcpProxyTests/AlMcpProxyStartupTests executed and passed, no platform load error)

Note: Built on top of feat/alcops-analyzer-provisioning (PR #25); merge #25 first, after which this PR shows only its own four commits.

🤖 Generated with Claude Code

Arthurvdv and others added 7 commits September 13, 2026 17:31
…target framework

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The DevTools nupkg ships almcp.dll + almcp.exe but no extension-less
launcher, so Linux and macOS from the tool store had no way to start the
child process. BcToolsLocator now resolves the launch shape at
construction: native almcp.exe/almcp when present, else
`dotnet almcp.dll` via DotnetHost, else null.

AlMcpProxy consumes the new AlMcpLaunch record (FileName + LeadingArgs)
instead of a raw path, prepending the DLL argument when running through
the dotnet host.

DotnetHost.Resolve is pure and testable: DOTNET_HOST_PATH > process path
> DOTNET_ROOT/DOTNET_ROOT_X64 > PATH scan > bare "dotnet".

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…AL VS Code extension probe

BREAKING CHANGE: The AL VS Code extension is no longer probed for BC
DevTools. Users who relied on the extension as their only DevTools
source must install the dotnet tool or point --devtools-path /
BCDEVELOPMENTTOOLSPATH at the extension's bin/<platform> folder.

The dotnet tool store is the primary and recommended delivery channel on
every OS. With the ALCops analyzer provisioner (PR #25) handling ALCops'
own analyzer DLLs, the extension probe served only as a fallback for the
DevTools themselves — one that broke on AL 17's nested bin layout and
added three OS-specific probing roots.

The error message now lists every probe and its outcome, the exact
install command, and the manual --devtools-path / BCDEVELOPMENTTOOLSPATH
alternative.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
AlMcpFixture now falls back to BcToolsLocator.ResolveToolsDirectory()
when the baked BcToolsPath (from compile-time assembly metadata) is
absent, so CI can point BCDEVELOPMENTTOOLSPATH at the extracted nupkg
payload and have almcp discovered there.

ALCOPS_TESTS_REQUIRE_ALMCP=1 turns the AlMcpFactAttribute skip into a
hard fixture-init failure, so the tests never silently disappear when
the tools are supposed to be available.

The workflow extracts the full tools/net10.0/any/ payload (with
runtimeconfig, deps.json and almcp.dll) alongside the existing flat DLL
extraction, sets BCDEVELOPMENTTOOLSPATH when the directory exists, and
enables the require flag. Versions without a net10.0 payload gracefully
skip the almcp tests as before.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
README: requirements name the dotnet tool as the primary channel with
--devtools-path / BCDEVELOPMENTTOOLSPATH as the manual alternative.
New "Platform support" table: Windows (native almcp.exe), Linux/macOS
(dotnet almcp.dll). Resolution list now three steps, noting the AL VS
Code extension is no longer probed.

AGENTS.md: BcToolsLocator bullet describes the AlMcpLaunch shapes and
the no-auto-install design.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@Arthurvdv
Arthurvdv changed the base branch from feat/alcops-analyzer-provisioning to main September 13, 2026 18:33
@Arthurvdv Arthurvdv closed this Sep 13, 2026
@Arthurvdv Arthurvdv reopened this Sep 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant