TsgcWSAPIServer_MCP › Events
Events you can handle, grouped by purpose, followed by the full alphabetical list.
| Name | Description |
|---|---|
| OnMCPInitialize | Fired during the MCP handshake so server capabilities and ServerInfo can be customised per session. |
| OnMCPSessionNew | Raised every time a new MCP session is created. |
| OnMCPSessionEnd | Triggered when a session is closed or expires through SessionTimeout. |
| OnMCPException | Invoked when an unhandled exception reaches the server; allows overriding the HTTP response code. |
| Name | Description |
|---|---|
| OnMCPRequestTool | Raised when a client issues tools/call; populate the response with the tool’s result. |
| OnMCPRequestPrompt | Raised when a client issues prompts/get; fill the messages returned for that prompt template. |
| OnMCPRequestResource | Raised when a client issues resources/read; stream the resource content back to the caller. |
| Name | Description |
|---|---|
| OnMCPResponseRootsList | Receives the client’s reply to RequestRootsList, exposing the shared roots. |
| OnMCPResponseSamplingCreateMessage | Receives the client’s reply to RequestSamplingCreateMessage with the generated message. |
| OnMCPResponseElicitationCreate | Receives the client’s reply to RequestElicitationCreate with the elicited values. |
| Name | Description |
|---|---|
| OnMCPHTTPRequest | Fires when an HTTP request reaches the MCP endpoint; set Handled := True to supply a custom response. |
| OnMCPHTTPResponse | Fires after the HTTP response has been serialized; use it to add headers or log the exchange. |
| Name | Description |
|---|---|
| OnMCPException | Invoked when an unhandled exception reaches the server; allows overriding the HTTP response code. |
| OnMCPHTTPRequest | Fires when an HTTP request reaches the MCP endpoint; set Handled := True to supply a custom response. |
| OnMCPHTTPResponse | Fires after the HTTP response has been serialized; use it to add headers or log the exchange. |
| OnMCPInitialize | Fired during the MCP handshake so server capabilities and ServerInfo can be customised per session. |
| OnMCPRequestPrompt | Raised when a client issues prompts/get; fill the messages returned for that prompt template. |
| OnMCPRequestResource | Raised when a client issues resources/read; stream the resource content back to the caller. |
| OnMCPRequestTool | Raised when a client issues tools/call; populate the response with the tool’s result. |
| OnMCPResponseElicitationCreate | Receives the client’s reply to RequestElicitationCreate with the elicited values. |
| OnMCPResponseRootsList | Receives the client’s reply to RequestRootsList, exposing the shared roots. |
| OnMCPResponseSamplingCreateMessage | Receives the client’s reply to RequestSamplingCreateMessage with the generated message. |
| OnMCPSessionEnd | Triggered when a session is closed or expires through SessionTimeout. |
| OnMCPSessionNew | Raised every time a new MCP session is created. |