Qore json Module 1.11.0
Loading...
Searching...
No Matches
McpClient::McpConnection Class Reference

Class for MCP client connections; returns McpClient objects. More...

#include <McpConnection.qc.dox.h>

Inherits ConnectionProvider::HttpBasedConnection.

Public Member Methods

void constructor (string url, hash< auto > attributes, string name, string description, hash< auto > options)
 Creates the McpConnection object.
 
void constructor (hash< auto > config, soft< hash< auto > > attr)
 Creates the object from the arguments.
 
string getType ()
 returns "mcp"
 
McpClient getImpl (bool connect, soft< hash< auto > > rtopts)
 returns a McpClient object
 
hash< ConnectionSchemeInfo > getConnectionSchemeInfoImpl ()
 Returns the ConnectionSchemeInfo hash for this object.
 

Public Attributes

hash< auto > real_opts
 Real options for creating the MCP client.
 
const auto ConnectionScheme = ...
 Connection entry info.
 

Detailed Description

Class for MCP client connections; returns McpClient objects.

supports the following options:

  • "connect_timeout": connection timeout to use in milliseconds (default: 30000)
  • "timeout": transfer timeout to use in milliseconds (default: 60000)
  • "client_name": the client name to use for initialization (default: "QoreMcpClient")
  • "client_version": the client version to use for initialization (default: "1.0")
See also
McpClient::constructor() for more information on the above options

Member Function Documentation

◆ constructor() [1/2]

void McpClient::McpConnection::constructor ( hash< auto >  config,
soft< hash< auto > >  attr 
)

Creates the object from the arguments.

Parameters
configwith the following keys:
  • name (required string): the connection name
  • display_name (optional string): the display name
  • short_desc (optional string): a short description in plain text
  • desc (optional string): a long description with markdown formatting
  • url (required string): the connection URL
  • opts (optional hash): connection options
  • logger (optional LoggerInterface object): logger for the connection
attroptional connection attributes
  • monitor (optional bool): should the connection be monitored? Default: True
  • enabled (optional bool): is the connection enabled? Default: True
  • locked (optional bool): is the connection locked? Default: False
  • debug_data (optional bool): debug data? Default: False
  • tags (optional hash): tags for the connection; no default value
Exceptions
CONNECTION-OPTION-ERRORmissing or invalid connection option or attribute

◆ constructor() [2/2]

void McpClient::McpConnection::constructor ( string  url,
hash< auto >  attributes,
string  name,
string  description,
hash< auto >  options 
)

Creates the McpConnection object.

Parameters
namethe name of the connection
descriptionconnection description
urlconnection URL (potentially with password info)
attributesvarious attributes. See below
optionsconnection options

See AbstractConnection::constructor for attributes and options reference.

◆ getImpl()

McpClient McpClient::McpConnection::getImpl ( bool  connect,
soft< hash< auto > >  rtopts 
)

returns a McpClient object

Parameters
connectif True, then the connection is returned already initialized
rtoptsthis connection type does not accept any runtime options, so this parameter is ignored
Returns
a McpClient object

The documentation for this class was generated from the following file: