|
Entropic 2.3.8
Local-first agentic inference engine
|
C API implementation for i_mcp_server.h. More...
#include <entropic/interfaces/i_mcp_server.h>#include <entropic/mcp/server_base.h>#include <cstdlib>#include <cstring>
Go to the source code of this file.
Functions | |
| static entropic::MCPServerBase * | cast (entropic_mcp_server_t server) |
| Cast opaque handle to MCPServerBase pointer. | |
| static char * | alloc_string (const std::string &s) |
| Allocate a C string copy for caller-owned return. | |
| const char * | entropic_mcp_server_name (entropic_mcp_server_t server) |
| Get server name. | |
| char * | entropic_mcp_server_list_tools (entropic_mcp_server_t server) |
| List tools as JSON array. | |
| char * | entropic_mcp_server_execute (entropic_mcp_server_t server, const char *tool_name, const char *args_json) |
| Execute a tool. | |
| entropic_error_t | entropic_mcp_server_configure (entropic_mcp_server_t server, const char *config_json) |
| Configure a server. | |
| entropic_error_t | entropic_mcp_server_set_working_dir (entropic_mcp_server_t server, const char *path) |
| Set server working directory. | |
| void | entropic_mcp_server_destroy (entropic_mcp_server_t server) |
| Destroy a server instance. | |
C API implementation for i_mcp_server.h.
Bridges the pure C interface to the C++ MCPServerBase class. Each function casts the opaque handle and delegates.
Definition in file mcp_c_api.cpp.
|
static |
Allocate a C string copy for caller-owned return.
Uses malloc so the caller can deallocate via entropic_free() (which is the canonical public free in facade/entropic.cpp and wraps free(3)). Mismatched new[]/free is undefined behavior.
| s | Source string. |
Definition at line 41 of file mcp_c_api.cpp.
|
static |
Cast opaque handle to MCPServerBase pointer.
| server | Opaque handle. |
Definition at line 25 of file mcp_c_api.cpp.
| entropic_error_t entropic_mcp_server_configure | ( | entropic_mcp_server_t | server, |
| const char * | config_json | ||
| ) |
Configure a server.
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. |
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.
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.
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 server name.
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 server working directory.
Set the working directory for a server.
| server | Server handle. |
| path | Working directory path. |
Definition at line 126 of file mcp_c_api.cpp.