Skip to content

Comments

[MCP] Allow admin to define the default configuration#6686

Open
onbuyuka wants to merge 2 commits intomainfrom
features/612454-MCPDefaultConfiguration
Open

[MCP] Allow admin to define the default configuration#6686
onbuyuka wants to merge 2 commits intomainfrom
features/612454-MCPDefaultConfiguration

Conversation

@onbuyuka
Copy link
Contributor

@onbuyuka onbuyuka commented Feb 16, 2026

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 via ModifyAll, sets the new one, emits telemetry
  • ClearDefaultConfiguration — clears non-system defaults, re-marks the system default
  • IsDesignatedDefaultConfiguration — reads the native Default Boolean field
  • MarkSystemDefaultAsDefault — local helper to restore system default
  • CreateDefaultConfiguration — sets Default := true on initial system default creation
  • CopyConfiguration — ensures copies are created with Default := false
  • DeleteConfiguration — if deleting the designated default, restores system default first
  • ActivateConfiguration — prevents deactivation of the designated default
  • GetDimensions — includes IsDesignatedDefault in telemetry

Pages

  • MCPConfigCard.Page.al — Default field (read-only), Set as Default / Clear Default promoted actions, deactivation guard on Active field OnValidate
  • MCPConfigList.Page.al — Default column, Set as Default / Clear Default actions in Advanced group

Upgrade (MCPUpgrade.Codeunit.al)

  • UpgradeMCPSystemDefaultAsDefault — marks existing system default record (Name = '') as Default := true on upgrade (tag: MS-612454-MCPSystemDefaultAsDefault-20260216)

Tests (MCPConfigTest.Codeunit.al)

  • TestSetAsDefaultConfiguration — setting default clears system default
  • TestClearDefaultConfiguration — clearing restores system default
  • TestOnlyOneDefaultConfiguration — only one configuration can be default at a time
  • TestCopyConfigurationDoesNotCopyDefault — copies don't inherit default flag
  • TestCannotSetInactiveConfigurationAsDefault — inactive configs cannot be default
  • TestCannotDeactivateDesignatedDefault — designated default cannot be deactivated
  • TestDeleteDesignatedDefaultRestoresSystemDefault — deleting default restores system default

Design decisions

  • The Default field is a native Boolean on the platform MCP Configuration table — no table extension needed
  • System default (Name = '') starts with Default = true; any config can be designated as default
  • At most one configuration has Default = true at any time
  • Clearing the default is generic (parameterless) — always reverts to the system default
  • Deactivation of the designated default is blocked on both the codeunit and card page levels

Fixes AB#612454

@github-actions github-actions bot modified the milestones: Version 28.0, Version 29.0 Feb 24, 2026
@onbuyuka onbuyuka marked this pull request as ready for review February 24, 2026 16:03
@onbuyuka onbuyuka requested a review from a team as a code owner February 24, 2026 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant