|
Entropic 2.11.1
Local-first agentic inference engine
|
A loaded MCP server plugin and its C-ABI entry points. More...
#include <entropic/mcp/plugin_server.h>
Public Member Functions | |
| ~PluginServer () | |
| Destroy the plugin instance, then close the library. | |
| PluginServer (const PluginServer &)=delete | |
| PluginServer & | operator= (const PluginServer &)=delete |
| PluginServer (PluginServer &&)=delete | |
| PluginServer & | operator= (PluginServer &&)=delete |
| const std::string & | name () const |
| Server name, used as the tool-routing prefix. | |
| const std::filesystem::path & | path () const |
| Path this plugin was loaded from. | |
| std::string | list_tools () const |
| List the plugin's tools. | |
| std::string | execute (const std::string &tool_name, const std::string &args_json) |
| Execute one of the plugin's tools. | |
| entropic_error_t | configure (const std::string &config_json) |
| Pass configuration to the plugin instance. | |
| entropic_error_t | set_working_dir (const std::string &dir) |
| Set the plugin's working directory. | |
Static Public Member Functions | |
| static entropic_error_t | load (const std::filesystem::path &path, std::unique_ptr< PluginServer > &out) |
Load a plugin .so and construct its server instance. | |
A loaded MCP server plugin and its C-ABI entry points.
Non-copyable and non-movable: it owns a raw dlopen handle and a plugin instance whose lifetime is tied to that library staying mapped.
Definition at line 46 of file plugin_server.h.
| entropic::PluginServer::~PluginServer | ( | ) |
Destroy the plugin instance, then close the library.
Order matters: the instance's destructor lives inside the library, so the library must outlive it. destroy() therefore happens-after every other call on the handle, and dlclose happens-after destroy().
@req REQ-MCP-006
Definition at line 40 of file plugin_server.cpp.
| entropic_error_t entropic::PluginServer::configure | ( | const std::string & | config_json | ) |
Pass configuration to the plugin instance.
| config_json | JSON configuration string. |
Serialised on the same per-instance mutex as execute().
| config_json | JSON configuration string; borrowed for the call. |
Definition at line 345 of file plugin_server.cpp.
| std::string entropic::PluginServer::execute | ( | const std::string & | tool_name, |
| const std::string & | args_json | ||
| ) |
Execute one of the plugin's tools.
| tool_name | Local tool name (no server prefix). |
| args_json | JSON arguments. |
Serialised on a per-instance mutex so the threading promise the plugin header makes to authors — "the engine never runs these concurrently on one handle" — holds by construction rather than by every upstream caller behaving. No ordering is promised between distinct handles and the calling thread is not fixed.
| tool_name | Local tool name (no server prefix); borrowed for the call. |
| args_json | JSON arguments; borrowed for the call. |
Definition at line 328 of file plugin_server.cpp.
| std::string entropic::PluginServer::list_tools | ( | ) | const |
List the plugin's tools.
Descriptors use inputSchema (camelCase), which is what ServerManager::get_tool_schema parses so a plugin tool gets the same argument validation a built-in does.
Definition at line 303 of file plugin_server.cpp.
|
static |
Load a plugin .so and construct its server instance.
Load a plugin .so and construct its server instance.
Performs the full sequence: dlopen, resolve all nine entry points, verify entropic_plugin_api_version() against ENTROPIC_MCP_PLUGIN_API_VERSION, then entropic_create_server(). Every failure is logged with the offending path before returning.
| path | Filesystem path to the plugin shared object. | |
| [out] | out | Receives the loaded plugin on success; untouched otherwise. |
dlopen, then dlsym of all nine entry points, then the API-version check, then entropic_create_server(). Every failure is typed and logged with its path — a configured plugin never fails silently.
| path | Plugin shared object path. | |
| [out] | out | Receives the loaded plugin on success; left untouched on failure. |
Definition at line 70 of file plugin_server.cpp.
|
inline |
Server name, used as the tool-routing prefix.
Definition at line 84 of file plugin_server.h.
|
inline |
Path this plugin was loaded from.
Definition at line 92 of file plugin_server.h.
| entropic_error_t entropic::PluginServer::set_working_dir | ( | const std::string & | dir | ) |
Set the plugin's working directory.
| dir | Directory path. |
Serialised on the same per-instance mutex as execute().
| dir | Directory path; borrowed for the call. |
Definition at line 360 of file plugin_server.cpp.