include/entropic/mcp/mcp_json_discovery.h

← API

include/entropic/mcp/mcp_json_discovery.h

entropic::ExternalServerConfig

Parsed server entry from .mcp.json.

std::string entropic::ExternalServerConfig::name

Server name.

std::string entropic::ExternalServerConfig::transport

"stdio" | "sse"

std::string entropic::ExternalServerConfig::command

Stdio command (empty for SSE)

std::vector<std::string> entropic::ExternalServerConfig::args

Stdio command args.

std::map<std::string, std::string> entropic::ExternalServerConfig::env

Stdio env vars.

std::string entropic::ExternalServerConfig::url

SSE URL (empty for stdio)

std::string entropic::ExternalServerConfig::working_dir

gh#166 (v2.13.0): cwd for the spawned child ("" = inherit).

An external server is a separate process, and before this it took whatever cwd the HOST happened to have — which made a repo-scoped server useless in a second workspace. ServerManager fills this with its own root when a spec leaves it empty.

entropic::MCPJsonDiscovery

Discovers external MCP servers from .mcp.json files.

entropic::MCPJsonDiscovery::MCPJsonDiscovery(std::filesystem::path project_dir)

Construct with project directory.

Parameters
  • project_dir — Project root for .mcp.json search.
  • project_dir — Project root.

std::vector< ExternalServerConfig > entropic::MCPJsonDiscovery::discover(const std::set< std::string > &existing_names) const

Discover servers from .mcp.json files.

Project file first, then ~/.entropic/.mcp.json, so the first match for a given name wins and a project can override the global.

Parameters
  • existing_names — Already-registered server names (skip shadows).
  • existing_names — Already-registered server names, passed in so a discovered entry can never shadow one.
Returns
  • Vector of discovered server configs.
  • The discovered server configs, deduped by name; empty when neither file exists or every entry was skipped.