MCPClient Component

Properties   Methods   Events   Config Settings   Errors  

Provides an easy way to retrieve prompts, resources, and invoke tools from Model Context Protocol (MCP) servers.

Syntax

MCPSDK.MCPClient

Remarks

The MCPClient component provides a simple way to communicate with MCP Servers.

Connecting to a Server

When the Transport property is set to ttStdio, the LocalServerPath property must first be set to a file path pointing to a server executable. The Timeout property can be used to specify a timeout when connecting to the server. To initiate the connection, the Connect method should be used.

If successful, the component will then launch the server executable as a subprocess and will be able to send and receive MCP requests.

// Server executable. client.LocalServerPath = @"PATH\\TO\\SERVER\\EXE"; // Launches the server .exe as a subprocess and connects to it. client.Connect();

Key Features

The MCPClient component supports all major MCP functionality, including tools, prompts, resources, and sampling.

Tools

Tools provide an opportunity for LLM clients to execute custom code, interact with external systems, and access dynamic or external data. Anything for which a function can be written can also be exposed as a tool. Common examples include database queries, file operations, or computations.

Listing Tools

Before a client can begin invoking tools, it should first know which tools are available on the server. A client can retrieve a list of valid tools via the ListTools method. When called, the Tools collection will be automatically cleared and populated with the retrieved tools.

Each tool contains a Name, which acts as a unique identifier that can be used to reference the tool.

// Request a list of tools on the server. client.ListTools(); // Display the name of each tool. foreach (var tool in client.Tools) { // A unique identifier for the tool. string name = tool.Name; // A natural language description of the tool. This is often used to allow LLMs to reason over. string description = tool.Description; // Write to 'stderr' as 'stdio' is reserved for client/server communications. Console.Error.WriteLine($"Tool name: {name}"); Console.Error.WriteLine($"Tool description: {description}"); }

Invoking Tools

Once a tool has been identified, it can be invoked using the InvokeTool method. The server will then reply with a list of individual tool messages that can be retrieved via the ToolMessages collection.

Each tool message contains a ToolMessageType indicating the type of response and a Value, which is typically plain text (e.g., a string result or a base64-encoded image).

// Invoke a tool named 'get-weather'. client.InvokeTool("get-weather"); // Write to 'stderr' as 'stdio' is reserved for client/server communications. foreach (var message in client.ToolMessages) { Console.Error.WriteLine($"message.Value"); }

Tool Parameters

Some server implementations allow tools to receive runtime parameters, allowing clients to provide additional data or context at the time of invocation. These parameters can be specified by calling the AddToolParam method prior to calling the InvokeTool method. Each parameter consists of a Name and a Value, which are then passed along to the server with the tool request.

// Set up parameters for the 'get-weather' tool. client.AddToolParam("location", "New York"); client.AddToolParam("units", "metric"); // Invoke the tool with the specified parameters. client.InvokeTool("get-weather"); // The response will contain the weather information for New York in metric units. // Write to 'stderr' as 'stdio' is reserved for client/server communications. foreach (var message in client.ToolMessages) { Console.Error.WriteLine($"Tool response: {message.Value}"); }

Prompts

Prompts are predefined conversation starters or instructions that can be quickly inserted into the LLM's context to guide specific interactions or workflows. Prompts serve as standardized templates for common conversational patterns and allow for consistent responses for tasks like reviewing code, analyzing data, or answering specific types of questions.

Listing Prompts

Before a client can begin retrieving prompts, it should first know which prompts are available on the server. A client can retrieve a list of available prompts via the ListPrompts method. When called, the Prompts collection will be automatically cleared and populated with the retrieved prompts.

client.ListPrompts(); // Write to 'stderr' as 'stdio' is reserved for client/server communications. foreach (var prompt in client.Prompts) { Console.Error.WriteLine($"Prompt name: {prompt.Name}"); Console.Error.WriteLine($"Description: {prompt.Description}"); }

Retrieving Prompts

Once a prompt has been identified, it can be requested using the GetPrompt method. The server will then reply with a list of individual prompt messages that will be available via the PromptMessages collection.

Each prompt message consists of Text and a Role. A Role identifies the speaker or author of a given message, and its Text represents a natural language instruction that can be fed into a language model.

client.GetPrompt("review-code"); // Write to 'stderr' as 'stdio' is reserved for client/server communications. for (var message in client.PromptMessages) { // A role of '0' indicates a prompt message coming from a 'user'. // A value of '1' indicates that it comes from an 'assistant'. string direction = (message.Role == 0) ? "User" : "Assistant"; Console.Error.WriteLine($"Message from {direction}: {message.Text}"); }

Prompt Parameters

Some server implementations support runtime arguments. These parameters allow prompts to be customized with client-specific data before execution. Prompt parameters can be specified by calling the AddPromptParam method before calling the GetPrompt method.

Each parameter consists of a Name and a Value, which are then passed along to the server with the prompt request.

// Request a prompt named 'review-code', passing along the following parameters: // code-language: 'javascript' // code-to-review: 'var a = 5;' client.AddPromptParam("code-language", "javascript"); client.AddPromptParam("code-to-review", "var a = 5;"); client.GetPrompt("review-code"); // The server would then return a code review of the javascript code 'var a = 5;'. // Write to 'stderr' as 'stdio' is reserved for client/server communications. Console.Error.WriteLine($"{client.PromptMessages[0].Text}");

Resources

Resources provide persistent, read-only content that can be requested once by the user and reused throughout the session. These are typically static files such as documentation, source code, or other reference materials that help provide context for LLM interactions.

Listing Resources

Before a client can begin retrieving resources, it should first know which resources are available on the server. A client can retrieve a list of available resources via the ListResources method. When called, the Resources collection will be automatically cleared and populated with the retrieved resources.

Each resource contains a Uri, which acts as a unique identifier that can be used to fetch its contents. Resources may also have a Name and a natural language Description, which are typically used to provide language models context over what each resource represents.

client.ListResources(); // Write to 'stderr' as 'stdio' is reserved for client/server communications. foreach (var resource in client.Resources) { Console.Error.WriteLine($"Resource name: {resource.Name}"); Console.Error.WriteLine($"Description: {resource.Description}"); Console.Error.WriteLine($"URI: {resource.Uri}"); }

Retrieving Resources

Once a resource has been identified, its contents can be retrieved using the ReadResource method. The server will then reply with the resource contents that can be retrieved via the ResourceContents collection.

// Resources are identified by URIs. In this case, this resource can be identified with 'file:///docs/reference.txt'. client.ReadResource("file:///docs/reference.txt"); // Write to 'stderr' as 'stdio' is reserved for client/server communications. foreach (var content in client.ResourceContents) { Console.Error.WriteLine($"Resource content (text): {content.Data}"); }

Disconnecting from a Server

To disconnect from the server, the Disconnect method should be used. When the Transport property is set to ttStdio, the client will drop the underlying connection and the server subprocess will be automatically terminated. client.Disconnect();

Property List


The following is the full list of the properties of the component with short descriptions. Click on the links for further details.

LocalServerPathThe path to the local MCP server executable.
PromptMessagesA collection of prompt messages received after a prompt request.
PromptsA collection of prompts available on the server.
ResourceContentsA collection of resource contents received after a resource read request.
ResourcesA collection of resources available on the server.
SamplingMessagesA collection of messages received when the server requests language model generation.
TimeoutThe timeout for operations in seconds.
ToolMessagesA collection of tool messages received after a tool invocation.
ToolsA collection of tools available on the server.
TransportThe transport mechanism used for communication.

Method List


The following is the full list of the methods of the component with short descriptions. Click on the links for further details.

addPromptParamAdds a prompt parameter.
addToolParamAdds a tool parameter.
configSets or retrieves a configuration setting.
connectConnects to a MCP server.
disconnectDisconnects from a MCP server.
getPromptRetrieves a prompt from the server.
invokeToolInvokes a tool from the server.
listPromptsRetrieves the list of prompts available on the server.
listResourcesRetrieves the list of resources available on the server.
listToolsRetrieves the list of tools available on the server.
readResourceReads a resource from the server.

Event List


The following is the full list of the events fired by the component with short descriptions. Click on the links for further details.

ErrorFires when an error occurs during operation.
LogThis event is fired once for each log message.
SamplingRequestFires when the server requests language model generation.

Config Settings


The following is a list of config settings for the component with short descriptions. Click on the links for further details.

LogLevelSpecifies the level of detail that is logged.
BuildInfoInformation about the product's build.
GUIAvailableWhether or not a message loop is available for processing events.
LicenseInfoInformation about the current license.
MaskSensitiveDataWhether sensitive data is masked in log messages.
UseDaemonThreadsWhether threads created by the component are daemon threads.
UseInternalSecurityAPIWhether or not to use the system security libraries or an internal implementation.

LocalServerPath Property (MCPClient Component)

The path to the local MCP server executable.

Syntax

public String getLocalServerPath();
public void setLocalServerPath(String localServerPath);

Default Value

""

Remarks

When the Transport property is set to ttStdio, this property is used to specify the full path to the local MCP server executable that the component will launch and connect to. When set, the component will start the server process at the specified path and establish a connection for MCP operations.

The supplied path must point to a valid MCP server executable file. If the path is empty or invalid, the component will not attempt to start a local server process.

PromptMessages Property (MCPClient Component)

A collection of prompt messages received after a prompt request.

Syntax

public PromptMessageList getPromptMessages();

Remarks

This collection holds a list of PromptMessage items.

Calling the GetPrompt method will populate this collection with a list of prompt messages received from the server.

This property is not available at design time.

Please refer to the PromptMessage type for a complete list of fields.

Prompts Property (MCPClient Component)

A collection of prompts available on the server.

Syntax

public PromptList getPrompts();

Remarks

This collection holds a list of Prompt items.

Calling the ListPrompts method will populate this collection with a list of prompts received from the server.

This property is read-only and not available at design time.

Please refer to the Prompt type for a complete list of fields.

ResourceContents Property (MCPClient Component)

A collection of resource contents received after a resource read request.

Syntax

public ResourceContentList getResourceContents();

Remarks

This collection holds a list of ResourceContent items.

Calling the ReadResource method will populate this collection with a list of resource contents received from the server.

This property is not available at design time.

Please refer to the ResourceContent type for a complete list of fields.

Resources Property (MCPClient Component)

A collection of resources available on the server.

Syntax

public ResourceList getResources();

Remarks

This collection holds a list of Resource items.

Calling the ListResources method will populate this collection with a list of resources received from the server.

This property is read-only and not available at design time.

Please refer to the Resource type for a complete list of fields.

SamplingMessages Property (MCPClient Component)

A collection of messages received when the server requests language model generation.

Syntax

public SamplingMessageList getSamplingMessages();

Remarks

This collection holds a list of SamplingMessage items.

When the Transport property is set to ttStdio, this collection is populated when the server initiates a sampling request and represents a list of messages meant to be passed into the client's language model.

This property is not available at design time.

Please refer to the SamplingMessage type for a complete list of fields.

Timeout Property (MCPClient Component)

The timeout for operations in seconds.

Syntax

public int getTimeout();
public void setTimeout(int timeout);

Default Value

10

Remarks

This property specifies the timeout period in seconds for operations performed by the component.

If this is set to 0, all operations will run uninterrupted until successful completion or an error condition is encountered.

If this is set to a positive value, the component will wait for the operation to complete before returning control. If the timeout expires before the operation completes, the component throws an exception.

Note that all timeouts are inactivity timeouts, meaning the timeout period is extended by value specified in this property when any amount of data is successfully sent or received.

This property is not available at design time.

ToolMessages Property (MCPClient Component)

A collection of tool messages received after a tool invocation.

Syntax

public ToolMessageList getToolMessages();

Remarks

This collection holds a list of ToolMessage items.

Calling the InvokeTool method will populate this collection with a list of tool messages received from the server.

This property is not available at design time.

Please refer to the ToolMessage type for a complete list of fields.

Tools Property (MCPClient Component)

A collection of tools available on the server.

Syntax

public ToolList getTools();

Remarks

This collection holds a list of Tool items.

Calling the ListTools method will populate this collection with a list of tools received from the server.

This property is read-only and not available at design time.

Please refer to the Tool type for a complete list of fields.

Transport Property (MCPClient Component)

The transport mechanism used for communication.

Syntax

public int getTransport();
public void setTransport(int transport);
Enumerated values:
  public final static int ttStdio = 1;

  public final static int ttHTTP = 2;

Default Value

1

Remarks

This property indicates whether the component operates via the standard input/output or HTTP transport mechanism. Possible values are as follows:

  • ttStdio (1, default): Enables communication through standard input and output streams, but the component is limited to serving a single client at once due to the server acting as a subprocess of a client application.
  • ttHTTP (2): Enables communication via HTTP requests and responses, and allows the component to serve multiple clients at once.

This property is not available at design time.

AddPromptParam Method (MCPClient Component)

Adds a prompt parameter.

Syntax

public void addPromptParam(String name, String value);

Remarks

This method is used to add a parameter to be passed into the next prompt request. When called, the specified parameter value will be included in the next prompt requested via the GetPrompt method.

Name specifies the unique name identifier of the parameter.

Value specifies the value of the parameter that will be included in the prompt request.

Example: client.AddPromptParam("code-to-review", "var a = 5;"); client.GetPrompt("review-code"); // Write to 'stderr' as 'stdio' is reserved for client/server communications. Console.Error.WriteLine(client.PromptMessages[0].Text);

AddToolParam Method (MCPClient Component)

Adds a tool parameter.

Syntax

public void addToolParam(String name, String value);

Remarks

This method is used to add a parameter to be passed into the next tool invocation. When called, the specified parameter value will be included in the next tool invoked via the InvokeTool method.

Name specifies the unique name identifier of the parameter.

Value specifies the value of the parameter that will be included in the tool request.

Example: client.AddToolParam("location", "New York"); // The 'get-weather' tool will receive a 'location' parameter with a value of 'New York'. client.InvokeTool("get-weather"); // Write to 'stderr' as 'stdio' is reserved for client/server communications. Console.Error.WriteLine(client.ToolMessages[0].Value);

Config Method (MCPClient Component)

Sets or retrieves a configuration setting.

Syntax

public String config(String configurationString);

Remarks

Config is a generic method available in every component. It is used to set and retrieve configuration settings for the component.

These settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the component, access to these internal properties is provided through the Config method.

To set a configuration setting named PROPERTY, you must call Config("PROPERTY=VALUE"), where VALUE is the value of the setting expressed as a string. For boolean values, use the strings "True", "False", "0", "1", "Yes", or "No" (case does not matter).

To read (query) the value of a configuration setting, you must call Config("PROPERTY"). The value will be returned as a string.

Connect Method (MCPClient Component)

Connects to a MCP server.

Syntax

public void connect();

Remarks

This method is used to establish a connection to a MCP server and initializes the communication channel. After establishing the connection, the initialize request is automatically sent to the server.

If the Transport property is set to ttStdio, this method will start the server as a subprocess using the path specified in the LocalServerPath property and enable communication through standard input/output streams.

This method will throw an exception if the connection cannot be established or if the server initialization fails.

Disconnect Method (MCPClient Component)

Disconnects from a MCP server.

Syntax

public void disconnect();

Remarks

This method is used to close the connection to a MCP server and terminates the communication channel. All active operations will be canceled and any pending requests will be discarded.

If the Transport property is set to ttStdio, this method will also terminate the server subprocess that was started during connection.

GetPrompt Method (MCPClient Component)

Retrieves a prompt from the server.

Syntax

public void getPrompt(String name);

Remarks

This method is used to request a prompt from the server. When called, the PromptMessages collection will be cleared and populated with the individual messages that make up the requested prompt.

Name specifies the unique name identifier of the prompt that will be retrieved.

InvokeTool Method (MCPClient Component)

Invokes a tool from the server.

Syntax

public void invokeTool(String name);

Remarks

This method is used to invoke a tool from the server. When called, the server will execute the requested tool and the ToolMessages collection will be cleared and populated with a list of response messages associated with the tool.

Name specifies the unique name identifier of the tool that will be invoked.

ListPrompts Method (MCPClient Component)

Retrieves the list of prompts available on the server.

Syntax

public void listPrompts();

Remarks

This method is used to request a listing of all of the prompts available on the server. When called, the Prompts collection will be cleared and populated with the retrieved prompts.

This method is typically called during the client's initialization phase or when the client needs to retrieve the latest list of prompts it can request via the GetPrompt method.

ListResources Method (MCPClient Component)

Retrieves the list of resources available on the server.

Syntax

public void listResources();

Remarks

This method is used to request a listing of all of the resources available on the server. When called, the Resources collection will be cleared and populated with the retrieved resources.

This method is typically used during the client's initialization phase, or when the client needs to retrieve the latest list of resources it can request via the ReadResource method.

ListTools Method (MCPClient Component)

Retrieves the list of tools available on the server.

Syntax

public void listTools();

Remarks

This method is used to request a listing of all of the tools available on the server. When called, the Tools collection will be cleared and populated with the retrieved tools.

This method is typically used during the client's initialization phase, or when the client needs to retrieve the latest list of tools it can invoke via the InvokeTool method.

ReadResource Method (MCPClient Component)

Reads a resource from the server.

Syntax

public void readResource(String uri);

Remarks

This method is used to request a resource from the server. When called, the ResourceContents collection will be cleared and populated with the data of the requested resource.

Uri specifies the unique identifier for the resource, of which common formats include file:///filename.ext for files, standard HTTP/HTTPS URLs for web resources, or custom schemes like db://table_name.

Error Event (MCPClient Component)

Fires when an error occurs during operation.

Syntax

public class DefaultMCPClientEventListener implements MCPClientEventListener {
  ...
  public void error(MCPClientErrorEvent e) {}
  ...
}

public class MCPClientErrorEvent {
  public String connectionId;

  public int errorCode;

  public String description;

}

Remarks

This event is fired when an unhandled exception is caught by the component, providing information about the error.

ConnectionId identifies the connection associated with the error.

ErrorCode contains the numeric error code representing the specific error condition.

Description contains a textual description of the error that occurred.

Log Event (MCPClient Component)

This event is fired once for each log message.

Syntax

public class DefaultMCPClientEventListener implements MCPClientEventListener {
  ...
  public void log(MCPClientLogEvent e) {}
  ...
}

public class MCPClientLogEvent {
  public int logLevel;

  public String message;

  public String logType;

}

Remarks

This event fires once for each log message generated by the component. The verbosity is controlled by the LogLevel configuration.

LogLevel indicates the detail level of the message. Possible values are:

0 (None) No messages are logged.
1 (Info - Default) Informational events are logged.
2 (Verbose) Detailed data is logged.
3 (Debug) Debug data including all sent and received NFS operations are logged.

Message is the log message.

LogType identifies the type of log entry. Possible values are as follows:

  • NFS

SamplingRequest Event (MCPClient Component)

Fires when the server requests language model generation.

Syntax

public class DefaultMCPClientEventListener implements MCPClientEventListener {
  ...
  public void samplingRequest(MCPClientSamplingRequestEvent e) {}
  ...
}

public class MCPClientSamplingRequestEvent {
  public String responseText;

  public String systemPrompt;

  public int role;

  public String model;

  public String intelligencePriority;

  public String speedPriority;

}

Remarks

When the Transport property is set to ttStdio, this event is fired when the server requests to sample the client's language model. When fired, the messages that make up the server's prompt will be available via the SamplingMessages collection.

To successfully handle the event, a client should construct a prompt from the messages in SamplingMessages and generate a response using the client's language model.

ResponseText should be set to the text output generated by the model when fed the messages in SamplingMessages.

SystemPrompt contains a natural language instruction or directive used to guide the model's behavior during generation. It is typically used to establish context, define tone, or specify how the model should respond.

Role should be set to the role used by the language model when generating ResponseText. Valid roles include:

0 (rtUser) Message from the end user requesting assistance.
1 (rtAssistant) Message from the client providing responses.

Model should be set to the name of the model used to generate ResponseText.

IntelligencePriority specifies how much the client should prioritize advanced capabilities when generating ResponseText. Its value is a decimal number ranging from 0.0 to 1.0. Higher values prefer more capable models.

SpeedPriority specifies how much the client should prioritize low latency when generating ResponseText. Its value is a decimal number ranging from 0.0 to 1.0. Higher values prefer faster models.

Prompt Type

A registered prompt.

Remarks

This type represents a registered prompt that can be requested by the client.

The following fields are available:

Fields

Description
String

Default Value: ""

The brief, human-readable description of what the prompt does.

This field holds a brief, human-readable description of what the prompt does, which is critical in helping the client to understand the purpose and functionality of the prompt.

Name
String

Default Value: ""

The unique name associated with the prompt.

This field identifies the unique name associated with the prompt.

Constructors

public Prompt();

PromptMessage Type

A prompt message.

Remarks

This type represents an individual message within a prompt that can be requested by the client.

The following fields are available:

Fields

Role
int

Default Value: 0

The speaker or author of the message.

This field indicates who authored each message and helps provide conversational context to language models. Valid roles include:

0 (rtUser) Message from the end user requesting assistance.
1 (rtAssistant) Message from the client providing responses.

Text
String

Default Value: ""

The instruction that can be passed into the client's language model.

This field contains natural language describing an instruction that can be passed into the client's language model (e.g., Review python code, Summarize an article, or Provide an example of using the /n software MCP SDK).

Constructors

public PromptMessage();
public PromptMessage( role,  text);

Resource Type

A registered resource.

Remarks

This type represents a registered resource that can be requested by the client.

The following fields are available:

Fields

Description
String

Default Value: ""

The brief, human-readable description of the purpose of the resource as well as appropriate use cases.

This field holds a brief, human-readable description of the purpose of the resource as well as appropriate use cases.

Mimetype
String

Default Value: ""

The media type of the resource content.

This field holds the media type of resource content (e.g., text/plain, image/png, etc.) and helps clients interpret the resource correctly and determine how it should be processed or displayed.

Name
String

Default Value: ""

The display name associated with the resource.

This field indicates the display associated with the resource that is shown to end users by the client.

Size
int (read-only)

Default Value: 0

The size of the resource content, in bytes.

This field indicates the size of the resource content, in bytes.

Uri
String

Default Value: ""

The unique resource identifier associated with the resource.

This field identifies the unique resource identifier associated with the resource.

Constructors

public Resource();

ResourceContent Type

A resource's content.

Remarks

This type represents the content for an individual resource that can be requested by the client.

The following fields are available:

Fields

Data
String

Default Value: ""

The data included in the resource content.

This field contains the data included in the resource content. Its format depends on the value in the MimeType field.

DataB
byte []

Default Value: ""

The data included in the resource content.

This field contains the data included in the resource content. Its format depends on the value in the MimeType field.

MimeType
String

Default Value: ""

The MIME type of the resource content data.

This field identifies the MIME type of the resource content data and informs the client of how the data in the Data field should be interpreted and processed.

Uri
String

Default Value: ""

The unique resource identifier that corresponds to the content received from the server.

This field identifies the individual resource content's unique resource identifier and may differ from the one corresponding to the overall resource.

For example, a client may request a resource with a URI of file:///test, and the server may then return two individual resource contents with the following URIs: file:///file/test/desc.txt, and file:///file/test/data.json.

Constructors

public ResourceContent();

SamplingMessage Type

An individual message in a sampling request.

Remarks

This type represents an individual message within a sampling request received by the server.

The following fields are available:

Fields

Role
int (read-only)

Default Value: 0

The speaker or author of the message.

This field indicates who authored each message and helps provide conversational context to language models. Valid roles include:

0 (rtUser) Message from the end user requesting assistance.
1 (rtAssistant) Message from the client providing responses.

Text
String

Default Value: ""

The instruction that can be passed into the client's language model.

This field contains natural language describing an instruction that can be passed into the client's language model (e.g., Review python code, Summarize an article, or Provide an example of using the /n software MCP SDK).

Constructors

public SamplingMessage();

Tool Type

A registered tool.

Remarks

This type represents a registered tool that can be requested by the client.

The following fields are available:

Fields

Description
String

Default Value: ""

The brief, human-readable description of what the tool does.

This field holds a brief, human-readable description of what the tool does, which is critical in helping the client to understand when the tool should be invoked.

Name
String

Default Value: ""

The unique name associated with the tool.

This field identifies the unique name associated with the tool.

Constructors

public Tool();

ToolMessage Type

A tool message.

Remarks

This type represents an individual message within a tool response.

The following fields are available:

Fields

ToolMessageType
int (read-only)

Default Value: 0

The data type of the message.

This field indicates the data type of the message. Valid data types include:

0 (mtText) Natural language text data.
1 (mtAudio) A base64-encoded string representing audio data (e.g., MP3 or WAV).
2 (mtImage) A base64-encoded string representing image data (e.g., PNG or JPEG).
3 (mtResource) A string message representing the contents of a text-based resource (e.g., file://logs/output.txt).

Value
String

Default Value: ""

The raw data included in the message.

This field contains the raw data included in the message. Its format depends on the value in the MessageType field.

Constructors

public ToolMessage();

Config Settings (MCPClient Component)

The component accepts one or more of the following configuration settings. Configuration settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the component, access to these internal properties is provided through the Config method.

MCPClient Config Settings

LogLevel:   Specifies the level of detail that is logged.

This configuration controls the level of detail that is logged through the Log event. Possible values are:

0 (None)No messages are logged.
1 (Info - Default)Informational events are logged.
2 (Verbose)Detailed data is logged.
3 (Debug)Debug data including all relevant sent and received NFS operations are logged.

Base Config Settings

BuildInfo:   Information about the product's build.

When queried, this setting will return a string containing information about the product's build.

GUIAvailable:   Whether or not a message loop is available for processing events.

In a GUI-based application, long-running blocking operations may cause the application to stop responding to input until the operation returns. The component will attempt to discover whether or not the application has a message loop and, if one is discovered, it will process events in that message loop during any such blocking operation.

In some non-GUI applications, an invalid message loop may be discovered that will result in errant behavior. In these cases, setting GUIAvailable to false will ensure that the component does not attempt to process external events.

LicenseInfo:   Information about the current license.

When queried, this setting will return a string containing information about the license this instance of a component is using. It will return the following information:

  • Product: The product the license is for.
  • Product Key: The key the license was generated from.
  • License Source: Where the license was found (e.g., RuntimeLicense, License File).
  • License Type: The type of license installed (e.g., Royalty Free, Single Server).
  • Last Valid Build: The last valid build number for which the license will work.
MaskSensitiveData:   Whether sensitive data is masked in log messages.

In certain circumstances it may be beneficial to mask sensitive data, like passwords, in log messages. Set this to true to mask sensitive data. The default is true.

This setting only works on these components: AS3Receiver, AS3Sender, Atom, Client(3DS), FTP, FTPServer, IMAP, OFTPClient, SSHClient, SCP, Server(3DS), Sexec, SFTP, SFTPServer, SSHServer, TCPClient, TCPServer.

UseDaemonThreads:   Whether threads created by the component are daemon threads.

If set to True (default), when the component creates a thread, the thread's Daemon property will be explicitly set to True. When set to False, the component will not set the Daemon property on the created thread. The default value is True.

UseInternalSecurityAPI:   Whether or not to use the system security libraries or an internal implementation.

When set to false, the component will use the system security libraries by default to perform cryptographic functions where applicable.

Setting this configuration setting to true tells the component to use the internal implementation instead of using the system security libraries.

This setting is set to false by default on all platforms.

Trappable Errors (MCPClient Component)

MCPClient Errors

104   The component is already listening.