MCP. - MCP Server Operations

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Internet and Network > MCP. - MCP (Model-Context Protocol) server operations > !Server-Operations - Commands for interacting with a running MCP server (signals, actions) >

MCP. - MCP Server Operations

HTP.MCPShowWindow

Previous Top Next


SPR Script Language

 

HTP.MCPShowWindow

Sets the visibility of the MCP server's status and log window.

 

Intention

 

When the MCP server is running, its log window is hidden by default. The HTP.MCPShowWindow command sends a signal to the server thread to safely change the visibility of its window. This is primarily a debugging tool, allowing you to monitor the server's real-time activity. A parameter determines whether to show or hide the window.

 

Syntax

 

HTP.MCPShowWindow|$$state

 

Parameter Explanation

 

P1 - $$state - (Numeric)

A numeric value that determines the window's visibility. Any non-zero value will show the window.

1 = Show the window.

0 = Hide the window.

 

Examples

 

'***********************************

' HTP.MCPShowWindow - Sample Usage

'***********************************

' Start the server

MCP.Start|||$$thr

JIZ.$$thr|Fail

 

' Show the log window to the user

HTP.MCPShowWindow|1

MBX.The server log window is now visible. It will be hidden in 5 seconds.

PAU.5000|ms

 

' Hide the window again (server continues running)

HTP.MCPShowWindow|0

MBX.Window is hidden again.

 

' Stop the server

MCP.Stop

MBX.Server stopped.

 

 

Remarks

 

- This command works by sending a "SHOW_WINDOW" or "HIDE_WINDOW" signal to the server thread, which is a thread-safe operation.

- The command has no effect if the MCP server is not running.

- If the user manually closes the log window using the [X] button, the window will only be hidden. The server thread continues to run. To stop it, you must use MCP.Stop.

 

See also:

 

MCP.Start

MCP.Stop

HTP.MCPSignal