[WIP][MCP] Server Features in MCP configuration: API Tools, Dynamic Tool Mode, AL Query Tools (Preview)#8085
Draft
onbuyuka wants to merge 10 commits into
Draft
[WIP][MCP] Server Features in MCP configuration: API Tools, Dynamic Tool Mode, AL Query Tools (Preview)#8085onbuyuka wants to merge 10 commits into
onbuyuka wants to merge 10 commits into
Conversation
…n card UX-only prototype for the upcoming AL Query MCP server. Replaces the prior AL Query Server fasttab with a generic Server Features list-part on the card (Activate / Deactivate / Configure actions per row, mirroring page 7775 "Copilot AI Capabilities") and a per-feature StandardDialog for settings. Tool Mode toggles (EnableDynamicToolMode + DiscoverReadOnlyObjects) stay on the General fasttab — they're contract modifiers, not features. System Tools sub-page now uses a push pattern (parent calls Reload(...)) instead of the prior pull/SubPageLink approach, fixing a render-collapsed bug that affected newly-visible parts. No real runtime, no platform fields, no public API, no Export/Import or telemetry round-trip, no automated tests. See al-query-mock.md "Next steps to production" for the full path to shipping. New objects: - enum 8351 "MCP Server Feature" - table 8355 "MCP Server Feature" (temp) - page 8368 "MCP Server Feature List" - page 8369 "MCP Server Feature Settings" Fixes AB#631012 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…12-al-query-mcp-config-ui
Three empty-body procedures on codeunit 8350 "MCP Config" mirror the existing EnableDynamicToolMode / EnableDiscoverReadOnlyObjects shapes for the prototype's AL Query Server feature: EnableALQueryServer, SetALQueryMaxRowsPerQuery, and SetALQueryTimeoutSeconds. Each has a // MOCK: comment in the implementation spelling out the GetBySystemId → assign → Modify → LogConfigurationModified flow to wire up once the platform adds the real fields. MCPServerFeatureSettings.SaveChanges() is restored as an empty stub with a commented-out routing-through-the-facade template, and OpenSettings re-gates the call on Action::OK so the OK/Cancel contract is preserved. Six minimal MCPConfigTest tests verify each facade procedure is callable; each is // MOCK commented and just calls the API. Replace with real state assertions once the platform-side fields exist. Fixes AB#631012 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
AL Documentation Audit
Documentation gaps were detected in the following apps:
- MCP-Test: 0% documentation coverage
- MCP: 67% documentation coverage
To generate documentation, run /al-docs init or /al-docs update using GitHub Copilot CLI or Claude Code.
This review is for awareness to help keep documentation in sync with code changes. It is okay to dismiss this request.
Removes docs/features/al-query-mcp-config-ui/design.md and src/System Application/App/MCP/docs/al-query-mock.md from the PR. The code + // MOCK: comments are the source of truth going forward. Fixes AB#631012 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…12-al-query-mcp-config-ui
…ature) - Renamed "AL Query Server" -> "AL Query Tools" everywhere (enum value identifier and caption `'AL Query Tools (Preview)'`, facade procedure EnableALQueryServer -> EnableALQueryTools, test names, comments). - Dynamic Tool Mode is back in the Server Features list as a feature row (enum ordinal 0, replacing the blank value introduced earlier). Removed EnableDynamicToolMode and DiscoverReadOnlyObjects fields from the card's General fasttab, along with the Tool Modes description block and its labels. Discover Additional Read-Only Objects is now exposed in the Configure dialog under Dynamic Tool Mode (loaded from / saved to Rec.DiscoverReadOnlyObjects on OK). The cascade "deactivating Dynamic Tool Mode clears DiscoverReadOnlyObjects" lives in the row's SetActive. LoadSystemTools tags the search/describe/invoke system tools with the Dynamic Tool Mode enum value so every System Tools row has a concrete feature label. - MCPConfigToolList caption: 'Available Tools' -> 'API Tools'. All three CUD actions (SelectTools, AddToolsByAPIGroup, AddStandardAPITools) guard on `Enabled = not IsConfigActive`. New internal SetConfigActive(IsActive) procedure accepts a push from MCPConfigCard.RefreshSubPages. The redraw is triggered by CurrPage.Update() at the end of Active.OnValidate on the card, which cascades through UpdatePropagation = Both. - System Tools list-part moved from area(Content) to area(FactBoxes). - Restored docs/features/al-query-mcp-config-ui/design.md with D21-D24, iteration entries 10-13, and lessons 10-11 covering the above changes. Fixes AB#631012 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…e APIs" - enum 8351: API Tools (0), Dynamic Tool Mode (1), AL Query Tools (2) - Server Features list seeds an API Tools row; activation is a page-local mock (APIToolsActiveLocal) exposed via IsAPIToolsActive() - Dynamic Tool Mode pre-flights API Tools (APIToolsRequiredForDynamicErr) - Card: "Available APIs" sub-part gated on `not IsDefault and APIToolsActive` - page 8352 caption 'API Tools' -> 'Available APIs'; description labels updated - design.md D25 / Appendix C #14 corrected to match the code (no AllowProdChanges relocation; API Tools Configure has no sub-settings yet) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Introduce interface "MCP Feature Handler" implemented by enum "MCP Server Feature"; each feature is a handler codeunit (MCP API Tools Feature 8369, MCP AL Query Tools Feature 8368, MCP Dyn. Tool Mode Feature 8370). The list page resolves a handler and dispatches instead of a per-feature case, and Reload walks the enum's Ordinals()/FromInteger() so adding a feature needs no page edit. - Description, activation, settings, and the Dynamic-Tool-Mode-requires- API-Tools pre-flight live in the handlers; the page holds no per-feature data - temp table gains Configurable (= Handler.HasSettings()); Configure gates on it - Dynamic Tool Mode handler is real; API Tools + AL Query are platform-pending stubs (IsActive returns false until the MCP Configuration booleans ship) - drop AL Query Tools mock sub-settings (Max Rows / Query Timeout) and the SetALQueryMaxRowsPerQuery / SetALQueryTimeoutSeconds facade + impl + 4 tests - extend MCP/app.json idRanges to 8365-8370 for the handler codeunits - design.md D26 + D27 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…tem tools - rename interface "MCP Feature Handler" -> "MCP Server Features" - handlers' SetActive delegate to MCP Config Implementation (EnableAPITools added to facade + impl, mock); the "API Tools required for Dynamic Tool Mode" gate moved into impl.EnableDynamicToolMode as a PLATFORM-PENDING commented check (inactive until the API Tools field is in symbols) - add LoadSystemTools to the interface; Dyn. Tool Mode emits the real GetSystemToolsInDynamicMode() catalog, AL Query the mock tools, API Tools none; remove impl.LoadSystemTools + InsertSystemTool + the Include* flags - MCP System Tool List.Reload(ConfigId) iterates the enum and dispatches to each active feature; card calls SystemToolList.Reload(Rec.SystemId) - rename interface vars Handler -> ServerFeature design.md D28-D29. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- API Tools facade smoke tests (EnableAPITools enable/disable) - Server Features TestPage tests on MCP Config Card: lists all three features, Configure gated to Dynamic Tool Mode, Activate flips status + sets EnableDynamicToolMode, part hidden on the default configuration - fix TestDefaultConfigurationPage: drop assertions on EnableDynamicToolMode / DiscoverReadOnlyObjects fields that D22 moved off the card (stale TestPage references that blocked the test codeunit from compiling) - design.md Appendix C #19 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a Server Features surface to the MCP configuration card so admins can opt configurations into the upcoming AL Query Tools (Preview) MCP runtime, alongside the existing Dynamic Tool Mode and API Tools controls. Each feature is a self-contained handler behind an interface, so the card is data-driven and extensible. The shape is intentional; storage and runtime hookups land once the platform-side pieces are in (see Pending platform dependencies below).
Feature handlers (interface-based)
interface "MCP Server Features"—SetActive/IsActive/HasSettings/OpenSettings/Description/LoadSystemTools.enum "MCP Server Feature"implements it, binding each value to a handler codeunit; resolvingServerFeature := Rec.Featurereplaces the old per-featurecaseblocks.MCP Server Feature ListandMCP System Tool Listpages are fully generic: each walksServerFeature.Ordinals()+FromInteger(...)(the same pattern asMCP Config Warning Type) and dispatches every action — activation, settings, descriptions, and system-tool loading — through the handler. Adding a feature is a new enum value + handler codeunit — no page edits.SetActivedelegates tocodeunit "MCP Config Implementation". Dynamic Tool Mode's handler is real (EnableDynamicToolMode/DiscoverReadOnlyObjects+ the real system-tool catalog); API Tools and AL Query Tools are platform-pending stubs whoseIsActivereturns false until the config fields ship.Card UX
Server Featureslist-part with per-row Activate / Deactivate / Configure, mirroringpage 7775 "Copilot AI Capabilities"→Copilot Capabilities GA. Configure appears only for features that have settings — gated on a per-rowConfigurableflag set from the handler'sHasSettings().Visible = not IsDefault and APIToolsActive), where the admin curates which API pages / queries the client can reach. No settings.Discover Additional Read-Only Objects; activation flows toEnableDynamicToolMode, deactivation cascade-clearsDiscoverReadOnlyObjects. (A "requires API Tools enabled first" gate lives inimpl.EnableDynamicToolModeas a commentedPLATFORM-PENDINGcheck — inactive until the API Tools field exists.)StandardDialog(page 8369 "MCP Server Feature Settings") is used only by Dynamic Tool Mode; its handler runs it viaOpenSettings, writing on OK.Server Featurecolumn) is rebuilt by iterating the active features and calling each handler'sLoadSystemTools. The curated-APIs list-part (page 8352) was renamed'Available Tools'→'API Tools'→'Available APIs'to disambiguate it from the API Tools feature row.Public API
codeunit 8350 "MCP Config"exposesEnableAPIToolsandEnableALQueryTools— empty// MOCK:no-ops until the platform adds the correspondingMCP Configurationfields — alongside the existingEnableDynamicToolMode. Feature handlers persist activation throughcodeunit "MCP Config Implementation". (The earlierSetALQueryMaxRowsPerQuery/SetALQueryTimeoutSecondsprocedures were removed with the mock sub-settings.)New objects
interface "MCP Server Features"enum 8351 "MCP Server Feature"(implements "MCP Server Features";API Tools,Dynamic Tool Mode,AL Query Tools)table 8355 "MCP Server Feature"(temporary, in-app; carries aConfigurableflag)page 8368 "MCP Server Feature List",page 8369 "MCP Server Feature Settings"8369 "MCP API Tools Feature",8368 "MCP AL Query Tools Feature",8370 "MCP Dyn. Tool Mode Feature"Pending platform dependencies
This PR is WIP pending platform-side work:
MCP Configurationfor API Tools and AL Query Tools — the handlers delegate toMCP Config Implementation(EnableAPITools/EnableALQueryTools), today empty no-ops, andIsActivereturns false. The "API Tools required for Dynamic Tool Mode" gate inimpl.EnableDynamicToolModeis commented out until the API Tools field lands.MCP Utilitiesexposing the real AL Query system tool catalog (replacing the hardcodedcompile_al_query/run_al_queryinserts in the AL Query handler'sLoadSystemTools).Once those land, each feature's wire-up is localized to its handler codeunit (and
impl.Enable*) —grep -rn "MOCK:\|PLATFORM-PENDING:" src/System\ Application/App/MCP/enumerates every site.Test plan
MCP Config Test(codeunit 130130): facade smoke tests forEnableAPIToolsandEnableALQueryTools(callable no-ops;// MOCK:placeholders to become real state assertions once the platform fields exist).Server FeaturesTestPage tests onpage 8351 "MCP Config Card": the list shows all three features in enum order,Configureis enabled only on Dynamic Tool Mode, activating Dynamic Tool Mode flips its row Status and setsEnableDynamicToolMode, and the part is hidden on the default configuration. (Also fixedTestDefaultConfigurationPage, which still referenced card fields D22 had moved into the Configure dialog.)Fixes AB#631012
🤖 Generated with Claude Code