MCPClient Class
Properties Methods Events Config Settings Errors
Provides an easy way to retrieve prompts, resources, and invoke tools from Model Context Protocol (MCP) servers.
Syntax
MCPClient
Remarks
The MCPClient class 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 class 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 class 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 properties 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 properties.
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 properties 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 properties.
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 properties 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 properties.
// 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 class with short descriptions. Click on the links for further details.
LocalServerPath | The path to the local MCP server executable. |
PromptMessages | A collection of prompt messages received after a prompt request. |
Prompts | A collection of prompts available on the server. |
ResourceContents | A collection of resource contents received after a resource read request. |
Resources | A collection of resources available on the server. |
SamplingMessages | A collection of messages received when the server requests language model generation. |
Timeout | The timeout for operations in seconds. |
ToolMessages | A collection of tool messages received after a tool invocation. |
Tools | A collection of tools available on the server. |
Transport | The transport mechanism used for communication. |
Method List
The following is the full list of the methods of the class with short descriptions. Click on the links for further details.
AddPromptParam | Adds a prompt parameter. |
AddToolParam | Adds a tool parameter. |
Config | Sets or retrieves a configuration setting. |
Connect | Connects to a MCP server. |
Disconnect | Disconnects from a MCP server. |
GetPrompt | Retrieves a prompt from the server. |
InvokeTool | Invokes a tool from the server. |
ListPrompts | Retrieves the list of prompts available on the server. |
ListResources | Retrieves the list of resources available on the server. |
ListTools | Retrieves the list of tools available on the server. |
ReadResource | Reads a resource from the server. |
Event List
The following is the full list of the events fired by the class with short descriptions. Click on the links for further details.
Error | Fires when an error occurs during operation. |
Log | This event is fired once for each log message. |
SamplingRequest | Fires when the server requests language model generation. |
Config Settings
The following is a list of config settings for the class with short descriptions. Click on the links for further details.
LogLevel | Specifies the level of detail that is logged. |
BuildInfo | Information about the product's build. |
CodePage | The system code page used for Unicode to Multibyte translations. |
LicenseInfo | Information about the current license. |
MaskSensitiveData | Whether sensitive data is masked in log messages. |
ProcessIdleEvents | Whether the class uses its internal event loop to process events when the main thread is idle. |
SelectWaitMillis | The length of time in milliseconds the class will wait when DoEvents is called if there are no events to process. |
UseInternalSecurityAPI | Whether or not to use the system security libraries or an internal implementation. |
LocalServerPath Property (MCPClient Class)
The path to the local MCP server executable.
Syntax
ANSI (Cross Platform) char* GetLocalServerPath();
int SetLocalServerPath(const char* lpszLocalServerPath); Unicode (Windows) LPWSTR GetLocalServerPath();
INT SetLocalServerPath(LPCWSTR lpszLocalServerPath);
char* mcpsdk_mcpclient_getlocalserverpath(void* lpObj);
int mcpsdk_mcpclient_setlocalserverpath(void* lpObj, const char* lpszLocalServerPath);
QString getLocalServerPath();
int setLocalServerPath(QString qsLocalServerPath);
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 class will launch and connect to. When set, the class 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 class will not attempt to start a local server process.
Data Type
String
PromptMessages Property (MCPClient Class)
A collection of prompt messages received after a prompt request.
Syntax
MCPSDKList<MCPSDKPromptMessage>* GetPromptMessages(); int SetPromptMessages(MCPSDKList<MCPSDKPromptMessage>* val);
int mcpsdk_mcpclient_getpromptmessagecount(void* lpObj);
int mcpsdk_mcpclient_setpromptmessagecount(void* lpObj, int iPromptMessageCount);
int mcpsdk_mcpclient_getpromptmessagerole(void* lpObj, int promptmessageindex);
int mcpsdk_mcpclient_setpromptmessagerole(void* lpObj, int promptmessageindex, int iPromptMessageRole);
char* mcpsdk_mcpclient_getpromptmessagetext(void* lpObj, int promptmessageindex);
int mcpsdk_mcpclient_setpromptmessagetext(void* lpObj, int promptmessageindex, const char* lpszPromptMessageText);
int getPromptMessageCount();
int setPromptMessageCount(int iPromptMessageCount); int getPromptMessageRole(int iPromptMessageIndex);
int setPromptMessageRole(int iPromptMessageIndex, int iPromptMessageRole); QString getPromptMessageText(int iPromptMessageIndex);
int setPromptMessageText(int iPromptMessageIndex, QString qsPromptMessageText);
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.
Data Type
Prompts Property (MCPClient Class)
A collection of prompts available on the server.
Syntax
MCPSDKList<MCPSDKPrompt>* GetPrompts();
int mcpsdk_mcpclient_getpromptcount(void* lpObj);
char* mcpsdk_mcpclient_getpromptdescription(void* lpObj, int promptindex);
char* mcpsdk_mcpclient_getpromptname(void* lpObj, int promptindex);
int getPromptCount(); QString getPromptDescription(int iPromptIndex); QString getPromptName(int iPromptIndex);
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.
Data Type
ResourceContents Property (MCPClient Class)
A collection of resource contents received after a resource read request.
Syntax
MCPSDKList<MCPSDKResourceContent>* GetResourceContents(); int SetResourceContents(MCPSDKList<MCPSDKResourceContent>* val);
int mcpsdk_mcpclient_getresourcecontentcount(void* lpObj);
int mcpsdk_mcpclient_setresourcecontentcount(void* lpObj, int iResourceContentCount);
int mcpsdk_mcpclient_getresourcecontentdata(void* lpObj, int resourcecontentindex, char** lpResourceContentData, int* lenResourceContentData);
int mcpsdk_mcpclient_setresourcecontentdata(void* lpObj, int resourcecontentindex, const char* lpResourceContentData, int lenResourceContentData);
char* mcpsdk_mcpclient_getresourcecontentmimetype(void* lpObj, int resourcecontentindex);
int mcpsdk_mcpclient_setresourcecontentmimetype(void* lpObj, int resourcecontentindex, const char* lpszResourceContentMimeType);
char* mcpsdk_mcpclient_getresourcecontenturi(void* lpObj, int resourcecontentindex);
int mcpsdk_mcpclient_setresourcecontenturi(void* lpObj, int resourcecontentindex, const char* lpszResourceContentUri);
int getResourceContentCount();
int setResourceContentCount(int iResourceContentCount); QByteArray getResourceContentData(int iResourceContentIndex);
int setResourceContentData(int iResourceContentIndex, QByteArray qbaResourceContentData); QString getResourceContentMimeType(int iResourceContentIndex);
int setResourceContentMimeType(int iResourceContentIndex, QString qsResourceContentMimeType); QString getResourceContentUri(int iResourceContentIndex);
int setResourceContentUri(int iResourceContentIndex, QString qsResourceContentUri);
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.
Data Type
Resources Property (MCPClient Class)
A collection of resources available on the server.
Syntax
MCPSDKList<MCPSDKResource>* GetResources();
int mcpsdk_mcpclient_getresourcecount(void* lpObj);
char* mcpsdk_mcpclient_getresourcedescription(void* lpObj, int resourceindex);
char* mcpsdk_mcpclient_getresourcemimetype(void* lpObj, int resourceindex);
char* mcpsdk_mcpclient_getresourcename(void* lpObj, int resourceindex);
int mcpsdk_mcpclient_getresourcesize(void* lpObj, int resourceindex);
char* mcpsdk_mcpclient_getresourceuri(void* lpObj, int resourceindex);
int getResourceCount(); QString getResourceDescription(int iResourceIndex); QString getResourceMimetype(int iResourceIndex); QString getResourceName(int iResourceIndex); int getResourceSize(int iResourceIndex); QString getResourceUri(int iResourceIndex);
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.
Data Type
SamplingMessages Property (MCPClient Class)
A collection of messages received when the server requests language model generation.
Syntax
MCPSDKList<MCPSDKSamplingMessage>* GetSamplingMessages(); int SetSamplingMessages(MCPSDKList<MCPSDKSamplingMessage>* val);
int mcpsdk_mcpclient_getsamplingmessagecount(void* lpObj);
int mcpsdk_mcpclient_setsamplingmessagecount(void* lpObj, int iSamplingMessageCount);
int mcpsdk_mcpclient_getsamplingmessagerole(void* lpObj, int samplingmessageindex);
char* mcpsdk_mcpclient_getsamplingmessagetext(void* lpObj, int samplingmessageindex);
int mcpsdk_mcpclient_setsamplingmessagetext(void* lpObj, int samplingmessageindex, const char* lpszSamplingMessageText);
int getSamplingMessageCount();
int setSamplingMessageCount(int iSamplingMessageCount); int getSamplingMessageRole(int iSamplingMessageIndex); QString getSamplingMessageText(int iSamplingMessageIndex);
int setSamplingMessageText(int iSamplingMessageIndex, QString qsSamplingMessageText);
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.
Data Type
Timeout Property (MCPClient Class)
The timeout for operations in seconds.
Syntax
ANSI (Cross Platform) int GetTimeout();
int SetTimeout(int iTimeout); Unicode (Windows) INT GetTimeout();
INT SetTimeout(INT iTimeout);
int mcpsdk_mcpclient_gettimeout(void* lpObj);
int mcpsdk_mcpclient_settimeout(void* lpObj, int iTimeout);
int getTimeout();
int setTimeout(int iTimeout);
Default Value
10
Remarks
This property specifies the timeout period in seconds for operations performed by the class.
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 class will wait for the operation to complete before returning control. If the timeout expires before the operation completes, the class 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.
Data Type
Integer
ToolMessages Property (MCPClient Class)
A collection of tool messages received after a tool invocation.
Syntax
MCPSDKList<MCPSDKToolMessage>* GetToolMessages(); int SetToolMessages(MCPSDKList<MCPSDKToolMessage>* val);
int mcpsdk_mcpclient_gettoolmessagecount(void* lpObj);
int mcpsdk_mcpclient_settoolmessagecount(void* lpObj, int iToolMessageCount);
int mcpsdk_mcpclient_gettoolmessagemessagetype(void* lpObj, int toolmessageindex);
char* mcpsdk_mcpclient_gettoolmessagevalue(void* lpObj, int toolmessageindex);
int mcpsdk_mcpclient_settoolmessagevalue(void* lpObj, int toolmessageindex, const char* lpszToolMessageValue);
int getToolMessageCount();
int setToolMessageCount(int iToolMessageCount); int getToolMessageMessageType(int iToolMessageIndex); QString getToolMessageValue(int iToolMessageIndex);
int setToolMessageValue(int iToolMessageIndex, QString qsToolMessageValue);
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.
Data Type
Tools Property (MCPClient Class)
A collection of tools available on the server.
Syntax
MCPSDKList<MCPSDKTool>* GetTools();
int mcpsdk_mcpclient_gettoolcount(void* lpObj);
char* mcpsdk_mcpclient_gettooldescription(void* lpObj, int toolindex);
char* mcpsdk_mcpclient_gettoolname(void* lpObj, int toolindex);
int getToolCount(); QString getToolDescription(int iToolIndex); QString getToolName(int iToolIndex);
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.
Data Type
Transport Property (MCPClient Class)
The transport mechanism used for communication.
Syntax
ANSI (Cross Platform) int GetTransport();
int SetTransport(int iTransport); Unicode (Windows) INT GetTransport();
INT SetTransport(INT iTransport);
Possible Values
TT_STDIO(1),
TT_HTTP(2)
int mcpsdk_mcpclient_gettransport(void* lpObj);
int mcpsdk_mcpclient_settransport(void* lpObj, int iTransport);
int getTransport();
int setTransport(int iTransport);
Default Value
1
Remarks
This property indicates whether the class 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 class 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 class to serve multiple clients at once.
This property is not available at design time.
Data Type
Integer
AddPromptParam Method (MCPClient Class)
Adds a prompt parameter.
Syntax
ANSI (Cross Platform) int AddPromptParam(const char* lpszName, const char* lpszValue); Unicode (Windows) INT AddPromptParam(LPCWSTR lpszName, LPCWSTR lpszValue);
int mcpsdk_mcpclient_addpromptparam(void* lpObj, const char* lpszName, const char* lpszValue);
int addPromptParam(const QString& qsName, const QString& qsValue);
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);
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
AddToolParam Method (MCPClient Class)
Adds a tool parameter.
Syntax
ANSI (Cross Platform) int AddToolParam(const char* lpszName, const char* lpszValue); Unicode (Windows) INT AddToolParam(LPCWSTR lpszName, LPCWSTR lpszValue);
int mcpsdk_mcpclient_addtoolparam(void* lpObj, const char* lpszName, const char* lpszValue);
int addToolParam(const QString& qsName, const QString& qsValue);
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);
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
Config Method (MCPClient Class)
Sets or retrieves a configuration setting.
Syntax
ANSI (Cross Platform) char* Config(const char* lpszConfigurationString); Unicode (Windows) LPWSTR Config(LPCWSTR lpszConfigurationString);
char* mcpsdk_mcpclient_config(void* lpObj, const char* lpszConfigurationString);
QString config(const QString& qsConfigurationString);
Remarks
Config is a generic method available in every class. It is used to set and retrieve configuration settings for the class.
These settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the class, 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.
Error Handling (C++)
This method returns a String value; after it returns, call the GetLastErrorCode() method to obtain its result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message.
Connect Method (MCPClient Class)
Connects to a MCP server.
Syntax
ANSI (Cross Platform) int Connect(); Unicode (Windows) INT Connect();
int mcpsdk_mcpclient_connect(void* lpObj);
int 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.
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
Disconnect Method (MCPClient Class)
Disconnects from a MCP server.
Syntax
ANSI (Cross Platform) int Disconnect(); Unicode (Windows) INT Disconnect();
int mcpsdk_mcpclient_disconnect(void* lpObj);
int 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.
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
GetPrompt Method (MCPClient Class)
Retrieves a prompt from the server.
Syntax
ANSI (Cross Platform) int GetPrompt(const char* lpszName); Unicode (Windows) INT GetPrompt(LPCWSTR lpszName);
int mcpsdk_mcpclient_getprompt(void* lpObj, const char* lpszName);
int getPrompt(const QString& qsName);
Remarks
This method is used to request a prompt from the server. When called, the PromptMessages properties 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.
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
InvokeTool Method (MCPClient Class)
Invokes a tool from the server.
Syntax
ANSI (Cross Platform) int InvokeTool(const char* lpszName); Unicode (Windows) INT InvokeTool(LPCWSTR lpszName);
int mcpsdk_mcpclient_invoketool(void* lpObj, const char* lpszName);
int invokeTool(const QString& qsName);
Remarks
This method is used to invoke a tool from the server. When called, the server will execute the requested tool and the ToolMessages properties 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.
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
ListPrompts Method (MCPClient Class)
Retrieves the list of prompts available on the server.
Syntax
ANSI (Cross Platform) int ListPrompts(); Unicode (Windows) INT ListPrompts();
int mcpsdk_mcpclient_listprompts(void* lpObj);
int listPrompts();
Remarks
This method is used to request a listing of all of the prompts available on the server. When called, the Prompts properties 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.
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
ListResources Method (MCPClient Class)
Retrieves the list of resources available on the server.
Syntax
ANSI (Cross Platform) int ListResources(); Unicode (Windows) INT ListResources();
int mcpsdk_mcpclient_listresources(void* lpObj);
int listResources();
Remarks
This method is used to request a listing of all of the resources available on the server. When called, the Resources properties 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.
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
ListTools Method (MCPClient Class)
Retrieves the list of tools available on the server.
Syntax
ANSI (Cross Platform) int ListTools(); Unicode (Windows) INT ListTools();
int mcpsdk_mcpclient_listtools(void* lpObj);
int listTools();
Remarks
This method is used to request a listing of all of the tools available on the server. When called, the Tools properties 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.
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
ReadResource Method (MCPClient Class)
Reads a resource from the server.
Syntax
ANSI (Cross Platform) int ReadResource(const char* lpszUri); Unicode (Windows) INT ReadResource(LPCWSTR lpszUri);
int mcpsdk_mcpclient_readresource(void* lpObj, const char* lpszUri);
int readResource(const QString& qsUri);
Remarks
This method is used to request a resource from the server. When called, the ResourceContents properties 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 Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
Error Event (MCPClient Class)
Fires when an error occurs during operation.
Syntax
ANSI (Cross Platform) virtual int FireError(MCPClientErrorEventParams *e);
typedef struct {
int ConnectionId;
int ErrorCode;
const char *Description; int reserved; } MCPClientErrorEventParams;
Unicode (Windows) virtual INT FireError(MCPClientErrorEventParams *e);
typedef struct {
INT ConnectionId;
INT ErrorCode;
LPCWSTR Description; INT reserved; } MCPClientErrorEventParams;
#define EID_MCPCLIENT_ERROR 1 virtual INT MCPSDK_CALL FireError(INT &iConnectionId, INT &iErrorCode, LPSTR &lpszDescription);
class MCPClientErrorEventParams { public: int connectionId(); int errorCode(); const QString &description(); int eventRetVal(); void setEventRetVal(int iRetVal); };
// To handle, subclass MCPClient and override this emitter function. virtual int fireError(MCPClientErrorEventParams *e) {...} // Or, connect one or more slots to this signal. void error(MCPClientErrorEventParams *e);
Remarks
This event is fired when an unhandled exception is caught by the class, 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 Class)
This event is fired once for each log message.
Syntax
ANSI (Cross Platform) virtual int FireLog(MCPClientLogEventParams *e);
typedef struct {
int LogLevel;
const char *Message;
const char *LogType; int reserved; } MCPClientLogEventParams;
Unicode (Windows) virtual INT FireLog(MCPClientLogEventParams *e);
typedef struct {
INT LogLevel;
LPCWSTR Message;
LPCWSTR LogType; INT reserved; } MCPClientLogEventParams;
#define EID_MCPCLIENT_LOG 2 virtual INT MCPSDK_CALL FireLog(INT &iLogLevel, LPSTR &lpszMessage, LPSTR &lpszLogType);
class MCPClientLogEventParams { public: int logLevel(); const QString &message(); const QString &logType(); int eventRetVal(); void setEventRetVal(int iRetVal); };
// To handle, subclass MCPClient and override this emitter function. virtual int fireLog(MCPClientLogEventParams *e) {...} // Or, connect one or more slots to this signal. void log(MCPClientLogEventParams *e);
Remarks
This event fires once for each log message generated by the class. 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 Class)
Fires when the server requests language model generation.
Syntax
ANSI (Cross Platform) virtual int FireSamplingRequest(MCPClientSamplingRequestEventParams *e);
typedef struct {
char *ResponseText;
const char *SystemPrompt;
int Role;
char *Model;
const char *IntelligencePriority;
const char *SpeedPriority; int reserved; } MCPClientSamplingRequestEventParams;
Unicode (Windows) virtual INT FireSamplingRequest(MCPClientSamplingRequestEventParams *e);
typedef struct {
LPWSTR ResponseText;
LPCWSTR SystemPrompt;
INT Role;
LPWSTR Model;
LPCWSTR IntelligencePriority;
LPCWSTR SpeedPriority; INT reserved; } MCPClientSamplingRequestEventParams;
#define EID_MCPCLIENT_SAMPLINGREQUEST 3 virtual INT MCPSDK_CALL FireSamplingRequest(LPSTR &lpszResponseText, LPSTR &lpszSystemPrompt, INT &iRole, LPSTR &lpszModel, LPSTR &lpszIntelligencePriority, LPSTR &lpszSpeedPriority);
class MCPClientSamplingRequestEventParams { public: const QString &responseText(); void setResponseText(const QString &qsResponseText); const QString &systemPrompt(); int role(); void setRole(int iRole); const QString &model(); void setModel(const QString &qsModel); const QString &intelligencePriority(); const QString &speedPriority(); int eventRetVal(); void setEventRetVal(int iRetVal); };
// To handle, subclass MCPClient and override this emitter function. virtual int fireSamplingRequest(MCPClientSamplingRequestEventParams *e) {...} // Or, connect one or more slots to this signal. void samplingRequest(MCPClientSamplingRequestEventParams *e);
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 properties.
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.
Syntax
MCPSDKPrompt (declared in mcpsdk.h)
Remarks
This type represents a registered prompt that can be requested by the client.
Fields
Description
char*
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
char*
Default Value: ""
The unique name associated with the prompt.
This field identifies the unique name associated with the prompt.
Constructors
Prompt()
PromptMessage Type
A prompt message.
Syntax
MCPSDKPromptMessage (declared in mcpsdk.h)
Remarks
This type represents an individual message within a prompt that can be requested by the client.
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
char*
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
PromptMessage()
PromptMessage(int iRole, const char* lpszText)
Resource Type
A registered resource.
Syntax
MCPSDKResource (declared in mcpsdk.h)
Remarks
This type represents a registered resource that can be requested by the client.
Fields
Description
char*
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
char*
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
char*
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
char*
Default Value: ""
The unique resource identifier associated with the resource.
This field identifies the unique resource identifier associated with the resource.
Constructors
Resource()
ResourceContent Type
A resource's content.
Syntax
MCPSDKResourceContent (declared in mcpsdk.h)
Remarks
This type represents the content for an individual resource that can be requested by the client.
Fields
Data
char*
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
char*
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
char*
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
ResourceContent()
SamplingMessage Type
An individual message in a sampling request.
Syntax
MCPSDKSamplingMessage (declared in mcpsdk.h)
Remarks
This type represents an individual message within a sampling request received by the server.
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
char*
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
SamplingMessage()
Tool Type
A registered tool.
Syntax
MCPSDKTool (declared in mcpsdk.h)
Remarks
This type represents a registered tool that can be requested by the client.
Fields
Description
char*
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
char*
Default Value: ""
The unique name associated with the tool.
This field identifies the unique name associated with the tool.
Constructors
Tool()
ToolMessage Type
A tool message.
Syntax
MCPSDKToolMessage (declared in mcpsdk.h)
Remarks
This type represents an individual message within a tool response.
Fields
MessageType
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
char*
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
ToolMessage()
MCPSDKList Type
Syntax
MCPSDKList<T> (declared in mcpsdk.h)
Remarks
MCPSDKList is a generic class that is used to hold a collection of objects of type T, where T is one of the custom types supported by the MCPClient class.
Methods | |
GetCount |
This method returns the current size of the collection.
int GetCount() {}
|
SetCount |
This method sets the size of the collection. This method returns 0 if setting the size was successful; or -1 if the collection is ReadOnly. When adding additional objects to a collection call this method to specify the new size. Increasing the size of the collection preserves existing objects in the collection.
int SetCount(int count) {}
|
Get |
This method gets the item at the specified position. The index parameter specifies the index of the item in the collection. This method returns NULL if an invalid index is specified.
T* Get(int index) {}
|
Set |
This method sets the item at the specified position. The index parameter specifies the index of the item in the collection that is being set. This method returns -1 if an invalid index is specified. Note: Objects created using the new operator must be freed using the delete operator; they will not be automatically freed by the class.
T* Set(int index, T* value) {}
|
Config Settings (MCPClient Class)
The class 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 class, access to these internal properties is provided through the Config method.MCPClient Config Settings
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
The following is a list of valid code page identifiers:
Identifier | Name |
037 | IBM EBCDIC - U.S./Canada |
437 | OEM - United States |
500 | IBM EBCDIC - International |
708 | Arabic - ASMO 708 |
709 | Arabic - ASMO 449+, BCON V4 |
710 | Arabic - Transparent Arabic |
720 | Arabic - Transparent ASMO |
737 | OEM - Greek (formerly 437G) |
775 | OEM - Baltic |
850 | OEM - Multilingual Latin I |
852 | OEM - Latin II |
855 | OEM - Cyrillic (primarily Russian) |
857 | OEM - Turkish |
858 | OEM - Multilingual Latin I + Euro symbol |
860 | OEM - Portuguese |
861 | OEM - Icelandic |
862 | OEM - Hebrew |
863 | OEM - Canadian-French |
864 | OEM - Arabic |
865 | OEM - Nordic |
866 | OEM - Russian |
869 | OEM - Modern Greek |
870 | IBM EBCDIC - Multilingual/ROECE (Latin-2) |
874 | ANSI/OEM - Thai (same as 28605, ISO 8859-15) |
875 | IBM EBCDIC - Modern Greek |
932 | ANSI/OEM - Japanese, Shift-JIS |
936 | ANSI/OEM - Simplified Chinese (PRC, Singapore) |
949 | ANSI/OEM - Korean (Unified Hangul Code) |
950 | ANSI/OEM - Traditional Chinese (Taiwan; Hong Kong SAR, PRC) |
1026 | IBM EBCDIC - Turkish (Latin-5) |
1047 | IBM EBCDIC - Latin 1/Open System |
1140 | IBM EBCDIC - U.S./Canada (037 + Euro symbol) |
1141 | IBM EBCDIC - Germany (20273 + Euro symbol) |
1142 | IBM EBCDIC - Denmark/Norway (20277 + Euro symbol) |
1143 | IBM EBCDIC - Finland/Sweden (20278 + Euro symbol) |
1144 | IBM EBCDIC - Italy (20280 + Euro symbol) |
1145 | IBM EBCDIC - Latin America/Spain (20284 + Euro symbol) |
1146 | IBM EBCDIC - United Kingdom (20285 + Euro symbol) |
1147 | IBM EBCDIC - France (20297 + Euro symbol) |
1148 | IBM EBCDIC - International (500 + Euro symbol) |
1149 | IBM EBCDIC - Icelandic (20871 + Euro symbol) |
1200 | Unicode UCS-2 Little-Endian (BMP of ISO 10646) |
1201 | Unicode UCS-2 Big-Endian |
1250 | ANSI - Central European |
1251 | ANSI - Cyrillic |
1252 | ANSI - Latin I |
1253 | ANSI - Greek |
1254 | ANSI - Turkish |
1255 | ANSI - Hebrew |
1256 | ANSI - Arabic |
1257 | ANSI - Baltic |
1258 | ANSI/OEM - Vietnamese |
1361 | Korean (Johab) |
10000 | MAC - Roman |
10001 | MAC - Japanese |
10002 | MAC - Traditional Chinese (Big5) |
10003 | MAC - Korean |
10004 | MAC - Arabic |
10005 | MAC - Hebrew |
10006 | MAC - Greek I |
10007 | MAC - Cyrillic |
10008 | MAC - Simplified Chinese (GB 2312) |
10010 | MAC - Romania |
10017 | MAC - Ukraine |
10021 | MAC - Thai |
10029 | MAC - Latin II |
10079 | MAC - Icelandic |
10081 | MAC - Turkish |
10082 | MAC - Croatia |
12000 | Unicode UCS-4 Little-Endian |
12001 | Unicode UCS-4 Big-Endian |
20000 | CNS - Taiwan |
20001 | TCA - Taiwan |
20002 | Eten - Taiwan |
20003 | IBM5550 - Taiwan |
20004 | TeleText - Taiwan |
20005 | Wang - Taiwan |
20105 | IA5 IRV International Alphabet No. 5 (7-bit) |
20106 | IA5 German (7-bit) |
20107 | IA5 Swedish (7-bit) |
20108 | IA5 Norwegian (7-bit) |
20127 | US-ASCII (7-bit) |
20261 | T.61 |
20269 | ISO 6937 Non-Spacing Accent |
20273 | IBM EBCDIC - Germany |
20277 | IBM EBCDIC - Denmark/Norway |
20278 | IBM EBCDIC - Finland/Sweden |
20280 | IBM EBCDIC - Italy |
20284 | IBM EBCDIC - Latin America/Spain |
20285 | IBM EBCDIC - United Kingdom |
20290 | IBM EBCDIC - Japanese Katakana Extended |
20297 | IBM EBCDIC - France |
20420 | IBM EBCDIC - Arabic |
20423 | IBM EBCDIC - Greek |
20424 | IBM EBCDIC - Hebrew |
20833 | IBM EBCDIC - Korean Extended |
20838 | IBM EBCDIC - Thai |
20866 | Russian - KOI8-R |
20871 | IBM EBCDIC - Icelandic |
20880 | IBM EBCDIC - Cyrillic (Russian) |
20905 | IBM EBCDIC - Turkish |
20924 | IBM EBCDIC - Latin-1/Open System (1047 + Euro symbol) |
20932 | JIS X 0208-1990 & 0121-1990 |
20936 | Simplified Chinese (GB2312) |
21025 | IBM EBCDIC - Cyrillic (Serbian, Bulgarian) |
21027 | Extended Alpha Lowercase |
21866 | Ukrainian (KOI8-U) |
28591 | ISO 8859-1 Latin I |
28592 | ISO 8859-2 Central Europe |
28593 | ISO 8859-3 Latin 3 |
28594 | ISO 8859-4 Baltic |
28595 | ISO 8859-5 Cyrillic |
28596 | ISO 8859-6 Arabic |
28597 | ISO 8859-7 Greek |
28598 | ISO 8859-8 Hebrew |
28599 | ISO 8859-9 Latin 5 |
28605 | ISO 8859-15 Latin 9 |
29001 | Europa 3 |
38598 | ISO 8859-8 Hebrew |
50220 | ISO 2022 Japanese with no halfwidth Katakana |
50221 | ISO 2022 Japanese with halfwidth Katakana |
50222 | ISO 2022 Japanese JIS X 0201-1989 |
50225 | ISO 2022 Korean |
50227 | ISO 2022 Simplified Chinese |
50229 | ISO 2022 Traditional Chinese |
50930 | Japanese (Katakana) Extended |
50931 | US/Canada and Japanese |
50933 | Korean Extended and Korean |
50935 | Simplified Chinese Extended and Simplified Chinese |
50936 | Simplified Chinese |
50937 | US/Canada and Traditional Chinese |
50939 | Japanese (Latin) Extended and Japanese |
51932 | EUC - Japanese |
51936 | EUC - Simplified Chinese |
51949 | EUC - Korean |
51950 | EUC - Traditional Chinese |
52936 | HZ-GB2312 Simplified Chinese |
54936 | Windows XP: GB18030 Simplified Chinese (4 Byte) |
57002 | ISCII Devanagari |
57003 | ISCII Bengali |
57004 | ISCII Tamil |
57005 | ISCII Telugu |
57006 | ISCII Assamese |
57007 | ISCII Oriya |
57008 | ISCII Kannada |
57009 | ISCII Malayalam |
57010 | ISCII Gujarati |
57011 | ISCII Punjabi |
65000 | Unicode UTF-7 |
65001 | Unicode UTF-8 |
Identifier | Name |
1 | ASCII |
2 | NEXTSTEP |
3 | JapaneseEUC |
4 | UTF8 |
5 | ISOLatin1 |
6 | Symbol |
7 | NonLossyASCII |
8 | ShiftJIS |
9 | ISOLatin2 |
10 | Unicode |
11 | WindowsCP1251 |
12 | WindowsCP1252 |
13 | WindowsCP1253 |
14 | WindowsCP1254 |
15 | WindowsCP1250 |
21 | ISO2022JP |
30 | MacOSRoman |
10 | UTF16String |
0x90000100 | UTF16BigEndian |
0x94000100 | UTF16LittleEndian |
0x8c000100 | UTF32String |
0x98000100 | UTF32BigEndian |
0x9c000100 | UTF32LittleEndian |
65536 | Proprietary |
- 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.
Setting this configuration setting to true tells the class to use the internal implementation instead of using the system security libraries.
On Windows, this setting is set to false by default. On Linux/macOS, this setting is set to true by default.
To use the system security libraries for Linux, OpenSSL support must be enabled. For more information on how to enable OpenSSL, please refer to the OpenSSL Notes section.
Trappable Errors (MCPClient Class)
Error Handling (C++)
Call the GetLastErrorCode() method to obtain the last called method's result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. Known error codes are listed below. If an error occurs, the GetLastError() method can be called to retrieve the associated error message.
MCPClient Errors
104 | The class is already listening. |