Table of Contents

Codeunit "MCP Config"

ID 8350
Namespace: System.MCP

Provides public API for managing MCP configurations and tools, including creation, activation, deletion, and permissions.

Properties

Name Value
Access Public
InherentEntitlements X
InherentPermissions X

Methods

GetConfigurationIdByName

Retrieves the SystemId (GUID) of a configuration by its name.

procedure GetConfigurationIdByName(Name: Text[100]): Guid

Parameters

Name Type Description
Name Text[100]

The name of the configuration.

Returns

Type Description
Guid

The SystemId (GUID) of the configuration if found; otherwise, an empty GUID.

CreateConfiguration

Creates a new MCP configuration with the specified name and description.

procedure CreateConfiguration(Name: Text[100], Description: Text[250]): Guid

Parameters

Name Type Description
Name Text[100]

The name of the configuration.

Description Text[250]

The description of the configuration.

Returns

Type Description
Guid

The SystemId (GUID) of the created configuration.

ActivateConfiguration

Activates the specified MCP configuration.

procedure ActivateConfiguration(ConfigId: Guid, Active: Boolean)

Parameters

Name Type Description
ConfigId Guid

The SystemId (GUID) of the configuration to activate.

Active Boolean

True to activate, false to deactivate.

AllowCreateUpdateDeleteTools

Allows create, update and delete tools for the specified MCP configuration. Disallowing this will make the tools read-only.

procedure AllowCreateUpdateDeleteTools(ConfigId: Guid, Allow: Boolean)

Parameters

Name Type Description
ConfigId Guid

The SystemId (GUID) of the configuration.

Allow Boolean

True to allow create, update and delete tools, false to disallow.

DeleteConfiguration

Deletes the specified MCP configuration.

procedure DeleteConfiguration(ConfigId: Guid)

Parameters

Name Type Description
ConfigId Guid

The SystemId (GUID) of the configuration to delete.

CopyConfiguration

Copies an existing configuration to a new configuration, including its tools and permissions.

procedure CopyConfiguration(SourceConfigId: Guid, NewName: Text[100], NewDescription: Text[250]): Guid

Parameters

Name Type Description
SourceConfigId Guid

The SystemId (GUID) of the configuration to copy.

NewName Text[100]

The name of the new configuration.

NewDescription Text[250]

The SystemId (GUID) of the configuration to copy.

Returns

Type Description
Guid

The SystemId (GUID) of the newly created configuration.

EnableDynamicToolMode

Enables dynamic tool mode for the specified configuration.

procedure EnableDynamicToolMode(ConfigId: Guid, Enable: Boolean)

Parameters

Name Type Description
ConfigId Guid

The SystemId (GUID) of the configuration.

Enable Boolean

True to enable, false to disable.

EnableDiscoverReadOnlyObjects

Enables discovery of accessible read-only objects for the specified configuration.

procedure EnableDiscoverReadOnlyObjects(ConfigId: Guid, Enable: Boolean)

Parameters

Name Type Description
ConfigId Guid

The SystemId (GUID) of the configuration.

Enable Boolean

True to enable, false to disable.

FindWarningsForConfiguration

Finds warnings for the specified MCP configuration, such as missing objects or missing parent objects.

procedure FindWarningsForConfiguration(ConfigId: Guid, var MCPConfigWarning: Record "MCP Config Warning" temporary): Boolean

Parameters

Name Type Description
ConfigId Guid

The SystemId (GUID) of the configuration to find warnings for.

MCPConfigWarning Table System.MCP."MCP Config Warning"

A temporary record variable to hold the found warnings.

Returns

Type Description
Boolean

True if any warnings were found; otherwise, false.

ApplyRecommendedAction

Applies the recommended action for the specified warning.

procedure ApplyRecommendedAction(var MCPConfigWarning: Record "MCP Config Warning" temporary)

Parameters

Name Type Description
MCPConfigWarning Table System.MCP."MCP Config Warning"

The warning record to apply the recommended action for.

CreateAPITool

Creates a new API tool for the specified configuration and API page.

procedure CreateAPITool(ConfigId: Guid, APIPageId: Integer): Guid

Parameters

Name Type Description
ConfigId Guid

The SystemId (GUID) of the configuration.

APIPageId Integer

The ID of the API page.

Returns

Type Description
Guid

The SystemId (GUID) of the created tool.

CreateAPITool

Creates a new API tool for the specified configuration and API page.

procedure CreateAPITool(ConfigId: Guid, APIPageId: Integer, ValidateAPIPublisher: Boolean): Guid

Parameters

Name Type Description
ConfigId Guid

The SystemId (GUID) of the configuration.

APIPageId Integer

The ID of the API page.

ValidateAPIPublisher Boolean

True to validate the API publisher, false to skip validation.

Returns

Type Description
Guid

The SystemId (GUID) of the created tool.

GetAPIToolId

Retrieves the SystemId (GUID) of a tool by its configuration ID and API page

procedure GetAPIToolId(ConfigId: Guid, APIPageId: Integer): Guid

Parameters

Name Type Description
ConfigId Guid

The SystemId (GUID) of the configuration.

APIPageId Integer

The ID of the API page.

Returns

Type Description
Guid

The SystemId (GUID) of the tool if found; otherwise, an empty GUID.

DeleteTool

Deletes the specified tool from the configuration.

procedure DeleteTool(ToolSystemId: Guid)

Parameters

Name Type Description
ToolSystemId Guid

The SystemId (GUID) of the tool to delete.

AllowRead

Sets the read permission for the specified tool.

procedure AllowRead(ToolSystemId: Guid, Allow: Boolean)

Parameters

Name Type Description
ToolSystemId Guid

The SystemId (GUID) of the tool.

Allow Boolean

True to allow read, false to disallow.

AllowCreate

Sets the create permission for the specified tool.

procedure AllowCreate(ToolSystemId: Guid, Allow: Boolean)

Parameters

Name Type Description
ToolSystemId Guid

The SystemId (GUID) of the tool.

Allow Boolean

True to allow create, false to disallow.

AllowModify

Sets the modify permission for the specified tool.

procedure AllowModify(ToolSystemId: Guid, Allow: Boolean)

Parameters

Name Type Description
ToolSystemId Guid

The SystemId (GUID) of the tool.

Allow Boolean

True to allow modify, false to disallow.

AllowDelete

Sets the delete permission for the specified tool.

procedure AllowDelete(ToolSystemId: Guid, Allow: Boolean)

Parameters

Name Type Description
ToolSystemId Guid

The SystemId (GUID) of the tool.

Allow Boolean

True to allow delete, false to disallow.

AllowBoundActions

Sets the bound actions permission for the specified tool.

procedure AllowBoundActions(ToolSystemId: Guid, Allow: Boolean)

Parameters

Name Type Description
ToolSystemId Guid

The SystemId (GUID) of the tool.

Allow Boolean

True to allow bound actions, false to disallow.

CreateEntraApplication

Creates a new MCP Entra Application with the specified name, description, and client ID.

procedure CreateEntraApplication(Name: Text[100], Description: Text[250], ClientId: Guid)

Parameters

Name Type Description
Name Text[100]

The name for the Entra application registration.

Description Text[250]

The description for the Entra application registration.

ClientId Guid

The Entra application (client) ID.

DeleteEntraApplication

Deletes the specified MCP Entra Application.

procedure DeleteEntraApplication(Name: Text[100])

Parameters

Name Type Description
Name Text[100]

The name of the Entra application to delete.

See also