ExUtcp (ex_utcp v0.2.8)
View SourceElixir implementation of the Universal Tool Calling Protocol (UTCP).
UTCP is a modern, flexible, and scalable standard for defining and interacting with tools across a wide variety of communication protocols. It is designed to be easy to use, interoperable, and extensible, making it a powerful choice for building and consuming tool-based services.
Features
- Built-in transports for HTTP, CLI, Server-Sent Events, streaming HTTP, GraphQL, MCP, WebSocket, gRPC, TCP, UDP, and WebRTC
- Variable substitution via environment variables or
.envfiles - In-memory repository for storing providers and tools discovered at runtime
- Utilities such as
OpenApiConverterto convert OpenAPI definitions into UTCP manuals - Example programs demonstrating the client usage
Getting Started
alias ExUtcp.{Client, Config}
# Create a client configuration
config = Config.new(providers_file_path: "providers.json")
# Create a UTCP client
{:ok, client} = Client.start_link(config)
# Search for tools
{:ok, tools} = Client.search_tools(client, "", 10)
# Call a tool
{:ok, result} = Client.call_tool(client, "provider.tool_name", %{"arg" => "value"})Architecture
The library is organized into several main components:
ExUtcp.Client- Main client interfaceExUtcp.Config- Configuration managementExUtcp.Providers- Provider implementations for different protocolsExUtcp.Transports- Transport layer implementationsExUtcp.Tools- Tool definitions and managementExUtcp.Repository- Tool and provider storage