|
Entropic 2.14.3
Local-first agentic inference engine
|
Abstract transport for external MCP communication. More...
#include <entropic/mcp/transport.h>

Public Member Functions | |
| virtual bool | open ()=0 |
| Open the transport connection. | |
| virtual void | close ()=0 |
| Close the transport connection. | |
| virtual std::string | send_request (const std::string &request_json, uint32_t timeout_ms=0)=0 |
| Send a JSON-RPC request and wait for response. | |
| virtual bool | is_connected () const =0 |
| Check if transport is connected. | |
| virtual void | interrupt () |
| Abort any in-flight send_request() call ASAP. | |
| virtual void | clear_interrupt () |
| Release an interrupt so the transport can be used again. | |
| virtual bool | is_interrupted () const |
| Whether an interrupt is currently suppressing this transport. | |
Abstract transport for external MCP communication.
Internal to librentropic-mcp.so. Not exposed across .so boundaries. Two implementations: StdioTransport (fork/exec + pipes) and SSETransport (cpp-httplib SSE stream + HTTP POST).
Definition at line 29 of file transport.h.
Release an interrupt so the transport can be used again.
The counterpart to interrupt(). gh#150: without one, a transport that latches on interrupt() stays disabled for the lifetime of the process, because AgentEngine::reset_interrupt() clears only the engine's own flag and never reaches here.
Default is a no-op, matching interrupt(): a transport that does not latch has nothing to release.
@req REQ-MCP-025
Reimplemented in entropic::StdioTransport.
Definition at line 92 of file transport.h.
Close the transport connection.
Implemented in entropic::SSETransport, and entropic::StdioTransport.
Abort any in-flight send_request() call ASAP.
Called from another thread (typically the engine's interrupt path) so tool dispatches to external MCP servers do not run to completion after Ctrl+C. Default is a no-op for transports with no blocking calls. Must wake pending reads within ~100ms. (P1-10, 2.0.6-rc16)
@utility
Reimplemented in entropic::StdioTransport.
Definition at line 76 of file transport.h.
Check if transport is connected.
Implemented in entropic::SSETransport, and entropic::StdioTransport.
Whether an interrupt is currently suppressing this transport.
gh#150: a suppressed transport returns an empty response, which a caller cannot distinguish from a legitimate empty result — the reporting consumer saw status=ok on every call while every call was in fact being dropped. This makes the state answerable.
Reimplemented in entropic::StdioTransport.
Definition at line 106 of file transport.h.
Open the transport connection.
Implemented in entropic::SSETransport, and entropic::StdioTransport.
|
pure virtual |
Send a JSON-RPC request and wait for response.
| request_json | JSON-RPC request string. |
| timeout_ms | Timeout in milliseconds (0 = default 30s). |
Implemented in entropic::SSETransport, and entropic::StdioTransport.