Claudio.MCP.ServerConfig (Claudio v0.7.0)
View SourceStructured configuration for the Anthropic MCP connector (mcp-client-2025-11-20).
The connector needs two halves in a Messages request: a server entry in
mcp_servers (to_map/1) and an mcp_toolset entry in tools that
references the server by name (to_toolset/1). Claudio.Messages.Request.add_mcp_server/2
emits both and declares the beta header.
Tool selection lives on the toolset: allow_tools/2 (allowlist of exact
tool names), set_default_config/2, and configure_tool/3.
Example
alias Claudio.MCP.ServerConfig
server =
ServerConfig.new("my_server", "https://mcp.example.com/sse")
|> ServerConfig.set_auth_token("bearer-token-here")
|> ServerConfig.allow_tools(["search_events", "fetch_data"])
Request.new("claude-opus-5-5")
|> Request.add_mcp_server(server)
Summary
Functions
Allowlists tools by exact name: disables all tools by default and enables each named one. A later call replaces the allowlist (tools only an earlier call enabled are no longer enabled); other per-tool settings are kept.
Merges settings into the per-tool override for name (an exact tool name).
Creates a new MCP server configuration.
Sets the OAuth bearer token the connector sends to the MCP server.
Merges settings into the toolset's default_config (applies to every tool
unless overridden per tool). Supported keys include "enabled" and "defer_loading".
Splits a raw server map into {server_entry, toolset}.
The mcp_servers entry for this server.
The mcp_toolset entry (for tools) that references this server.
Types
Functions
Allowlists tools by exact name: disables all tools by default and enables each named one. A later call replaces the allowlist (tools only an earlier call enabled are no longer enabled); other per-tool settings are kept.
Raises ArgumentError on a name containing * or ?. The connector matches
configs keys literally and only logs a server-side warning for unknown
names, so a pattern would produce a valid request with no tools enabled.
ServerConfig.allow_tools(config, ["search_events", "fetch_data"])
Merges settings into the per-tool override for name (an exact tool name).
ServerConfig.configure_tool(config, "delete_all", %{"enabled" => false})
Creates a new MCP server configuration.
ServerConfig.new("my_server", "https://mcp.example.com/sse")
Sets the OAuth bearer token the connector sends to the MCP server.
Merges settings into the toolset's default_config (applies to every tool
unless overridden per tool). Supported keys include "enabled" and "defer_loading".
Splits a raw server map into {server_entry, toolset}.
A legacy tool_configuration key (connector mcp-client-2025-04-04) is
removed from the server entry and translated onto the toolset with a
deprecation warning. Raises ArgumentError when the map has neither
"name" nor :name.
The mcp_servers entry for this server.
The mcp_toolset entry (for tools) that references this server.