Claudio.MCP.ServerConfig (Claudio v0.5.0)
View SourceStructured configuration for MCP servers passed to the Anthropic Messages API.
The Anthropic API supports a server-side MCP connector where Claude connects to MCP servers on your behalf. This module provides a typed builder for those server configurations.
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_*", "fetch_data"])
request = Request.new("claude-sonnet-4-5-20250929")
|> Request.add_mcp_server(server)
Summary
Functions
Sets which tools are allowed from this MCP server.
Creates a new MCP server configuration.
Sets the authorization token for authenticating with the MCP server.
Converts the server configuration to a map suitable for the API payload.
Types
Functions
Sets which tools are allowed from this MCP server.
Accepts a list of tool name patterns (supports glob-style matching).
Example
ServerConfig.new("my_server", "https://mcp.example.com")
|> ServerConfig.allow_tools(["search_*", "fetch_data"])
Creates a new MCP server configuration.
Parameters
name- Human-readable server nameurl- The server's HTTP URL
Example
ServerConfig.new("my_server", "https://mcp.example.com/sse")
Sets the authorization token for authenticating with the MCP server.
Example
ServerConfig.new("my_server", "https://mcp.example.com")
|> ServerConfig.set_auth_token("my-bearer-token")
Converts the server configuration to a map suitable for the API payload.