Mead.MCP.Catalog (mead v0.1.1)

Copy Markdown View Source

The tools the connected MCP servers offer, plus the normalized server configuration, in an ETS table any process can read.

The process owns the table and is the only writer. A connection registers its tools after the handshake, and the catalog monitors that connection, so a connection that is killed without running terminate/2 still loses its tools. A server re-registered by a newer connection keeps the new rows when the old connection's death is noticed afterwards.

The configuration lives here so that Mead.MCP.Hub can ask the policy for a decision with one read and no call.

Summary

Types

tool()

@type tool() :: %{
  name: String.t(),
  description: String.t() | nil,
  input_schema: map()
}

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

register(catalog, server, owner, tools)

@spec register(atom(), atom(), pid(), [tool()]) :: :ok

snapshot(catalog)

@spec snapshot(atom()) :: {:ok, [map()], [map()]} | :unavailable

start_link(options)

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

unregister(catalog, server)

@spec unregister(atom(), atom()) :: :ok