MCP Commands - Logging & Security

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Internet and Network > MCP. - MCP (Model-Context Protocol) server operations > Logging & Security - Logging and access control >

MCP Commands - Logging & Security

MCP.Permission - Request Permission

PreviousTopNext


MiniRobot Language (MRL) - MCP Logging & Security Commands

 

MCP.Permission / MCP.Perm

Request Permission for Sensitive Operations

 

Purpose

 

The MCP.Permission command requests user approval before executing potentially dangerous or sensitive operations. This provides an interactive security mechanism that ensures users are aware of and consent to actions that could affect system state, modify files, or access restricted resources.

 

Permission requests can be configured to require:

• User confirmation via dialog

• Automatic approval based on whitelist

• Denial of the operation

 

Syntax

 

MCP.Permission|$$ACTION|$$DESCRIPTION|$$RETURN_VAR

 

MCP.Perm|$$ACTION|$$DESCRIPTION|$$RETURN_VAR

 

Parameters

 

$$ACTION - The action being requested. This is typically a short identifier like "FileDelete", "RegistryWrite", "ExecuteCommand", etc.

 

$$DESCRIPTION - A human-readable description of what will happen if permission is granted. This is displayed to the user in the permission dialog.

 

$$RETURN_VAR - The variable that will receive the result (TRUE if permission granted, FALSE if denied).

 

Return Value

 

TRUE - Permission was granted (user approved or action is whitelisted)

FALSE - Permission was denied (user rejected or operation blocked)

 

Examples

 

' Example 1: Request permission to delete a file

MCP.Permission|FileDelete|Delete temporary file C:\temp\old.log?|$$Allowed

IVV.$$Allowed!TRUE

FIL.Delete|C:\temp\old.log

EIF.

 

' Example 2: Request permission to modify registry

MCP.Perm|RegistryWrite|Modify registry key HKCU\Software\MyApp?|$$OK

IVV.$$OK!FALSE

PRT.Operation cancelled by user

EXT.

EIF.

 

Remarks

 

If the whitelist is enabled and the requested action matches an entry in the whitelist, permission is automatically granted without showing a dialog. Use MCP.EnableWhitelist and MCP.SetWhitelist to configure whitelist behavior.

 

MCP.Permission and MCP.Perm are aliases for the same command. You can use either form.

 

Error Conditions

 

The command will fail with a parameter error if:

• The action parameter is missing

• The return variable parameter is missing

• Too many parameters are provided

 

See also:

 

MCP.EnableWhitelist - Enable Whitelist

MCP.GetWhitelist - Get Whitelist

MCP.SetWhitelist - Set Whitelist