|
Entropic 2.3.8
Local-first agentic inference engine
|
C API implementation for external MCP server management. More...
#include "engine_handle.h"#include <entropic/entropic.h>#include <entropic/mcp/mcp_json_discovery.h>#include <entropic/types/logging.h>#include "json_serializers.h"#include <cstring>
Go to the source code of this file.
Functions | |
| static entropic_error_t | check_server_mgr (entropic_handle_t h) |
| Check handle prerequisites for MCP server APIs. | |
| static entropic::ExternalServerConfig | parse_external_server_spec (const char *name, const nlohmann::json &j) |
| Register an external MCP server at runtime. | |
| ENTROPIC_EXPORT entropic_error_t | entropic_register_mcp_server (entropic_handle_t handle, const char *name, const char *config_json) |
| Register an external MCP server from JSON config (C ABI). | |
| ENTROPIC_EXPORT entropic_error_t | entropic_deregister_mcp_server (entropic_handle_t handle, const char *name) |
| Deregister an external MCP server. | |
| ENTROPIC_EXPORT char * | entropic_list_mcp_servers (entropic_handle_t handle) |
| List all MCP servers as JSON array. | |
Variables | |
| static auto | logger = entropic::log::get("facade.mcp") |
C API implementation for external MCP server management.
Implements entropic_register_mcp_server, entropic_deregister_mcp_server, and entropic_list_mcp_servers from entropic.h.
Definition in file entropic_mcp.cpp.
|
static |
Check handle prerequisites for MCP server APIs.
| h | Engine handle. |
Definition at line 31 of file entropic_mcp.cpp.
| ENTROPIC_EXPORT entropic_error_t entropic_deregister_mcp_server | ( | entropic_handle_t | handle, |
| const char * | name | ||
| ) |
Deregister an external MCP server.
| handle | Engine handle returned by entropic_create. |
| name | MCP server name (must be unique). |
Definition at line 138 of file entropic_mcp.cpp.
| ENTROPIC_EXPORT char * entropic_list_mcp_servers | ( | entropic_handle_t | handle | ) |
List all MCP servers as JSON array.
List all MCP servers with status information.
| handle | Engine handle returned by entropic_create. |
Definition at line 166 of file entropic_mcp.cpp.
| ENTROPIC_EXPORT entropic_error_t entropic_register_mcp_server | ( | entropic_handle_t | handle, |
| const char * | name, | ||
| const char * | config_json | ||
| ) |
Register an external MCP server from JSON config (C ABI).
Register an external MCP server at runtime.
Definition at line 105 of file entropic_mcp.cpp.
|
static |
Register an external MCP server at runtime.
Issue #9 (v2.1.4): parses the FULL ExternalServerConfig from config_json — including env and explicit transport. Pre-2.1.4 the runtime path silently dropped env, leaving spawned children with an empty environment (not even PATH). Env keys are filtered through the same blocklist used by .mcp.json discovery (is_blocked_env_var) so PATH/LD_PRELOAD/etc. cannot be injected.
Recognized config_json fields:
| handle | Engine handle returned by entropic_create. |
| name | MCP server name (must be unique). |
| config_json | JSON-serialized MCP server configuration. |
Parse an ExternalServerConfig from register-mcp JSON.
Extracted from entropic_register_mcp_server to keep it knots-clean. Env vars on the block list are skipped with a warning.
| name | Server name. |
| j | Parsed config JSON. |
Definition at line 73 of file entropic_mcp.cpp.
|
static |
Definition at line 22 of file entropic_mcp.cpp.