|
Entropic 2.3.8
Local-first agentic inference engine
|
Client for an external MCP server (stdio or SSE). More...
#include <entropic/mcp/external_client.h>
Public Member Functions | |
| ExternalMCPClient (std::string name, std::unique_ptr< Transport > transport) | |
| Construct with name and transport. | |
| bool | connect () |
| Connect: open transport + MCP initialize + tools/list. | |
| void | disconnect () |
| Disconnect: close transport. | |
| std::string | list_tools () const |
| List tools as JSON array string (cached). | |
| std::string | execute (const std::string &tool_name, const std::string &args_json) |
| Execute a tool call via the external server. | |
| std::pair< std::vector< std::string >, std::vector< std::string > > | refresh_tools () |
| Re-query tools/list and diff against cache. | |
| bool | is_connected () const |
| Check connection state. | |
| const std::string & | name () const |
| Get server name. | |
| void | interrupt () |
| Abort any pending execute() by interrupting the transport. | |
Client for an external MCP server (stdio or SSE).
Owns a Transport instance. Handles MCP protocol negotiation, tool list caching, tool name prefixing, and response sanitization.
Definition at line 41 of file external_client.h.
| entropic::ExternalMCPClient::ExternalMCPClient | ( | std::string | name, |
| std::unique_ptr< Transport > | transport | ||
| ) |
Construct with name and transport.
| name | Server name (unique key, used as tool prefix). |
| transport | Ownership transferred. |
| name | Server name. |
| transport | Ownership transferred. |
Definition at line 27 of file external_client.cpp.
| bool entropic::ExternalMCPClient::connect | ( | ) |
Connect: open transport + MCP initialize + tools/list.
Connect: open transport, initialize, query tools.
Definition at line 39 of file external_client.cpp.
| void entropic::ExternalMCPClient::disconnect | ( | ) |
Disconnect: close transport.
Disconnect: close transport, clear cache.
Definition at line 66 of file external_client.cpp.
| std::string entropic::ExternalMCPClient::execute | ( | const std::string & | tool_name, |
| const std::string & | args_json | ||
| ) |
Execute a tool call via the external server.
| tool_name | Local name (without server prefix). |
| args_json | JSON arguments string. |
| tool_name | Local name (without server prefix). |
| args_json | JSON arguments. |
Definition at line 93 of file external_client.cpp.
|
inline |
Abort any pending execute() by interrupting the transport.
Delegates to Transport::interrupt(). Safe to call concurrently from the engine's interrupt thread. (P1-10, 2.0.6-rc16)
@utility
Definition at line 114 of file external_client.h.
| bool entropic::ExternalMCPClient::is_connected | ( | ) | const |
Check connection state.
Check connection state via transport.
Definition at line 174 of file external_client.cpp.
| std::string entropic::ExternalMCPClient::list_tools | ( | ) | const |
List tools as JSON array string (cached).
List tools as JSON array string (cached, prefixed).
Definition at line 80 of file external_client.cpp.
|
inline |
Get server name.
Definition at line 103 of file external_client.h.
| std::pair< std::vector< std::string >, std::vector< std::string > > entropic::ExternalMCPClient::refresh_tools | ( | ) |
Re-query tools/list and diff against cache.
Definition at line 149 of file external_client.cpp.