|
Entropic 2.3.8
Local-first agentic inference engine
|
Pure C interface contract for MCP server plugins. More...


Go to the source code of this file.
Classes | |
| struct | entropic_state_provider_t |
| Read-only engine state provider for introspection tools. More... | |
Macros | |
| #define | ENTROPIC_MCP_PLUGIN_API_VERSION 1 |
| Current MCP plugin API version. | |
Typedefs | |
| typedef struct entropic_mcp_server * | entropic_mcp_server_t |
| Opaque handle to an MCP server instance. | |
Functions | |
| const char * | entropic_mcp_server_name (entropic_mcp_server_t server) |
| Get the server name. | |
| char * | entropic_mcp_server_list_tools (entropic_mcp_server_t server) |
| List tools as JSON array string. | |
| char * | entropic_mcp_server_execute (entropic_mcp_server_t server, const char *tool_name, const char *args_json) |
| Execute a tool and return ServerResponse JSON envelope. | |
| entropic_error_t | entropic_mcp_server_configure (entropic_mcp_server_t server, const char *config_json) |
| Configure a server instance after creation. | |
| entropic_error_t | entropic_mcp_server_set_working_dir (entropic_mcp_server_t server, const char *path) |
| Set the working directory for a server. | |
| void | entropic_mcp_server_destroy (entropic_mcp_server_t server) |
| Destroy a server instance. | |
| void | entropic_free (void *ptr) |
| Free a string allocated by the server. | |
Pure C interface contract for MCP server plugins.
Every MCP server plugin (.so) implements this interface. The ServerManager discovers plugins via dlopen and calls these functions through the opaque handle.
entropic_mcp_server_t opaque-handle type are LOCKED at API version 1. Any change to a function declaration, struct member layout, or the macro/typedef contracts in this header is a breaking change that requires bumping entropic_plugin_api_version(). Comment-only changes are safe. Cross-version compatibility test: a plugin built against 2.1.4 headers MUST dlopen cleanly into a 2.1.5 engine (verified comment-only diff in gh release v2.1.5 review).Definition in file i_mcp_server.h.
| #define ENTROPIC_MCP_PLUGIN_API_VERSION 1 |
Current MCP plugin API version.
Bumped when MCPServerBase or ToolBase virtual method signatures change. A plugin built against an older vtable loaded into a newer engine will be rejected with ENTROPIC_ERROR_PLUGIN_VERSION_MISMATCH.
Definition at line 237 of file i_mcp_server.h.
| typedef struct entropic_mcp_server* entropic_mcp_server_t |
| void entropic_free | ( | void * | ptr | ) |
Free a string allocated by the server.
| ptr | Pointer returned by list_tools or execute. NULL is a safe no-op. |
Free a string allocated by the server.
Free memory allocated by the engine or entropic_alloc().
@utility
Definition at line 1738 of file entropic.cpp.
| entropic_error_t entropic_mcp_server_configure | ( | entropic_mcp_server_t | server, |
| const char * | config_json | ||
| ) |
Configure a server instance after creation.
| server | Server handle. |
| config_json | JSON configuration string. |
Some servers need construction parameters (root_dir, config). The entropic_create_server() signature is parameterless for ABI uniformity. Per-server configuration is passed via this call.
Configure a server instance after creation.
| server | Server handle. |
| config_json | Configuration JSON. |
Definition at line 107 of file mcp_c_api.cpp.
| void entropic_mcp_server_destroy | ( | entropic_mcp_server_t | server | ) |
Destroy a server instance.
| server | Server handle to destroy. NULL is a safe no-op. |
| server | Server handle. |
Definition at line 142 of file mcp_c_api.cpp.
| char * entropic_mcp_server_execute | ( | entropic_mcp_server_t | server, |
| const char * | tool_name, | ||
| const char * | args_json | ||
| ) |
Execute a tool and return ServerResponse JSON envelope.
| server | Server handle. |
| tool_name | Tool name (without server prefix). |
| args_json | JSON string of arguments. |
Execute a tool and return ServerResponse JSON envelope.
| server | Server handle. |
| tool_name | Tool name. |
| args_json | JSON arguments. |
Definition at line 86 of file mcp_c_api.cpp.
| char * entropic_mcp_server_list_tools | ( | entropic_mcp_server_t | server | ) |
List tools as JSON array string.
| server | Server handle. |
List tools as JSON array string.
| server | Server handle. |
Definition at line 70 of file mcp_c_api.cpp.
| const char * entropic_mcp_server_name | ( | entropic_mcp_server_t | server | ) |
Get the server name.
| server | Server handle. |
Get the server name.
| server | Server handle. |
Definition at line 56 of file mcp_c_api.cpp.
| entropic_error_t entropic_mcp_server_set_working_dir | ( | entropic_mcp_server_t | server, |
| const char * | path | ||
| ) |
Set the working directory for a server.
| server | Server handle. |
| path | Working directory path. |
Base class default is no-op. Directory-aware servers (filesystem, bash, git) implement this. Enables ScopedSandbox (v2.1.5; formerly ScopedWorktree) to swap directories across .so boundaries without breaking isolation.
Set the working directory for a server.
| server | Server handle. |
| path | Working directory path. |
Definition at line 126 of file mcp_c_api.cpp.