MingaAgent.MCP.ServerRegistry (Minga v0.1.0)

Copy Markdown View Source

Source-owned registry for MCP server declarations.

This is declaration metadata, not the per-provider live client registry. Native providers read this registry to build their MCP config list and keep active sessions synchronized when extension MCP contributions are removed or reloaded.

Summary

Types

Registry entry for one MCP server declaration.

Source that contributed MCP server declarations.

Functions

Returns all registered MCP configs in deterministic registration order.

Returns registry entries in deterministic registration order.

Registers a source-owned batch of MCP declarations. Same-source batches replace prior entries.

Resolves config-owned and registry-owned MCP configs with deterministic first-owner collision handling.

Starts the MCP server declaration registry.

Removes all MCP server declarations owned by a source.

Types

entry()

@type entry() :: %{
  source: source(),
  id: String.t(),
  config: MingaAgent.MCP.ServerConfig.t()
}

Registry entry for one MCP server declaration.

source()

Source that contributed MCP server declarations.

state()

@type state() :: [entry()]

Functions

configs()

@spec configs() :: [MingaAgent.MCP.ServerConfig.t()]

Returns all registered MCP configs in deterministic registration order.

entries()

@spec entries() :: [entry()]

Returns registry entries in deterministic registration order.

register_many(source, servers, opts \\ [])

@spec register_many(source(), [{atom() | String.t(), keyword()}], keyword()) :: :ok

Registers a source-owned batch of MCP declarations. Same-source batches replace prior entries.

resolve_configs(config_configs, opts \\ [])

Resolves config-owned and registry-owned MCP configs with deterministic first-owner collision handling.

start_link(opts \\ [])

@spec start_link(keyword()) :: GenServer.on_start()

Starts the MCP server declaration registry.

unregister_source(source)

@spec unregister_source(source()) :: :ok

Removes all MCP server declarations owned by a source.