Normandy.MCP.Registry
(normandy v2.2.0)
View Source
Helpers for discovering and registering MCP tools in a Normandy.Tools.Toolset.
Example
alias Normandy.MCP.Registry, as: MCPRegistry
alias Normandy.Tools.Toolset
toolset = Toolset.new()
{:ok, toolset} = MCPRegistry.discover_and_register(
toolset,
Claudio.MCP.Adapters.ExMCP,
mcp_client,
prefix: "my_server"
):prefix is required (false keeps the server's names): see
Normandy.MCP.ToolWrapper's "Tool names and policy rules" and "Trust". Every
description, input schema and result the server sends reaches the model unchanged.
Summary
Functions
Discovers tools from an MCP server and registers them in a toolset.
Wraps a list of MCP tools as ToolWrapper structs.
Functions
@spec discover_and_register(Normandy.Tools.Toolset.t(), module(), term(), keyword()) :: {:ok, Normandy.Tools.Toolset.t()} | {:error, term()}
Discovers tools from an MCP server and registers them in a toolset.
Options
:prefix(String.t/0orfalse) - Required. The server's namespace: the model sees each tool asprefix__name. Letters, digits,-and single_(no__, no_at either end), at most 61 bytes.falsekeeps the server's own names (see "Tool names and policy rules").
@spec wrap_tools(module(), term(), [Claudio.MCP.Client.Tool.t()], keyword()) :: [ Normandy.MCP.ToolWrapper.t() ]
Wraps a list of MCP tools as ToolWrapper structs.
Options
:prefix(String.t/0orfalse) - Required. The server's namespace: the model sees each tool asprefix__name. Letters, digits,-and single_(no__, no_at either end), at most 61 bytes.falsekeeps the server's own names (see "Tool names and policy rules").