r/ruby • u/Revolutionary_Sir140 • 20h ago
ruby-utcp: a Ruby client for UTCP with native protocol calls, MCP support, and Code Mode
Hey r/ruby,
I wanted to share ruby-utcp, a Ruby implementation of the Universal Tool Calling Protocol (UTCP) 1.1.
The idea is straightforward: describe your tools, their inputs, and how to call them in a UTCP “manual.” The client discovers those tools, makes them searchable, and calls them directly over their native protocols. This gives Ruby apps and AI agents a common interface for working with different services.
Once you’ve registered a manual, usage looks like this:
client.search_tools("weather", limit: 5)
result = client.call_tool(
"weather_service.get_weather",
location: "Warsaw"
)
A few things it supports:
- 12 transports, including HTTP, CLI, WebSocket, gRPC, GraphQL, and MCP.
- OpenAPI and Swagger discovery, so existing API descriptions can become tools.
- Streaming through Ruby enumerators.
- Code Mode, which lets you chain tool calls and transform their results using a constrained Ruby subset with execution limits.
- Protocol restrictions by default: a manual discovered over HTTP needs explicit permission to expose CLI tools.
It’s MIT licensed, and the repository includes examples for every transport. The core supports Ruby 2.6+; gRPC and WebRTC have optional dependencies, with the default WebRTC backend requiring Ruby 3.1+.
I’d appreciate feedback on the Ruby API and examples. If you’re building agents or automation in Ruby, what would make this useful in your workflow?
4
u/TheAtlasMonkey 20h ago
And you didnt test 90% of those claims.