[MCP] Allow admin to define the default configuration#6686
Draft
[MCP] Allow admin to define the default configuration#6686
Conversation
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 the ability for administrators to designate an MCP configuration as the default. When no configuration is specified by an MCP client connection, the designated default configuration is used instead of the built-in system default.
Changes
Public API (MCPConfig.Codeunit.al)
SetAsDefaultConfiguration(ConfigId: Guid)— designates a configuration as default (must be active)ClearDefaultConfiguration()— clears the current default and restores the system default (Name = '')Implementation (MCPConfigImplementation.Codeunit.al)
SetAsDefaultConfiguration— clears all existing defaults viaModifyAll, sets the new one, emits telemetryClearDefaultConfiguration— clears non-system defaults, re-marks the system defaultIsDesignatedDefaultConfiguration— reads the nativeDefaultBoolean fieldMarkSystemDefaultAsDefault— local helper to restore system defaultCreateDefaultConfiguration— setsDefault := trueon initial system default creationCopyConfiguration— ensures copies are created withDefault := falseDeleteConfiguration— if deleting the designated default, restores system default firstActivateConfiguration— prevents deactivation of the designated defaultGetDimensions— includesIsDesignatedDefaultin telemetryPages
Defaultfield (read-only),Set as Default/Clear Defaultpromoted actions, deactivation guard onActivefieldOnValidateDefaultcolumn,Set as Default/Clear Defaultactions in Advanced groupUpgrade (MCPUpgrade.Codeunit.al)
UpgradeMCPSystemDefaultAsDefault— marks existing system default record (Name = '') asDefault := trueon upgrade (tag:MS-612454-MCPSystemDefaultAsDefault-20260216)Tests (MCPConfigTest.Codeunit.al)
TestSetAsDefaultConfiguration— setting default clears system defaultTestClearDefaultConfiguration— clearing restores system defaultTestOnlyOneDefaultConfiguration— only one configuration can be default at a timeTestCopyConfigurationDoesNotCopyDefault— copies don't inherit default flagTestCannotSetInactiveConfigurationAsDefault— inactive configs cannot be defaultTestCannotDeactivateDesignatedDefault— designated default cannot be deactivatedTestDeleteDesignatedDefaultRestoresSystemDefault— deleting default restores system defaultDesign decisions
Defaultfield is a native Boolean on the platformMCP Configurationtable — no table extension neededName = '') starts withDefault = true; any config can be designated as defaultDefault = trueat any timeFixes AB#612454