rs-utcp
Official Rust implementation of the UTCP
claude mcp add --transport stdio universal-tool-calling-protocol-rs-utcp cargo run --package rs-utcp
How to use
rs-utcp is a Rust-based Universal Tool Calling Protocol (UTCP) client library that enables async, protocol-agnostic tool discovery and invocation. It supports MCP as a transport (stdio and SSE) among many other protocols, and provides in-memory repositories, tagging-based search, and an orchestrator-friendly interface for building AI-assisted workflows. To use it, you typically configure a client with a tool repository (for example an in-memory or file-backed provider), initialize a search strategy for discovering tools by tag, and then call tools by name with a set of inputs. The client also supports streaming tool results and integrates with Codemode for dynamic script execution and orchestration, making it suitable for AI-driven automation pipelines that rely on a growing catalog of tools.
In practice, you would:
- Create a UtcpClient with a repository (e.g., InMemoryToolRepository) and a search strategy (e.g., TagSearchStrategy).
- Discover tools using search_tools with a keyword and limit.
- Call a tool by name using call_tool with a map of input arguments, and handle the JSON-like result. If a tool supports streaming, you can use call_tool_stream to process results incrementally.
- Optionally leverage Codemode to run dynamic scripts that orchestrate multiple tools and produce higher-level outputs. This makes it easy to implement AI-assisted workflows that adaptively select and compose tools at runtime.
How to install
Prerequisites:
- Rust and Cargo installed (viarustup: https://rustup.rs/)
- Basic understanding of Rust and Cargo workflows
- Install Rust toolchain (if not already installed):
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
- Create a new project or use an existing one that depends on rs-utcp. To add rs-utcp to an existing Cargo.toml:
[dependencies]
rs-utcp = "0.1.8"
tokio = { version = "1", features = ["full"] }
- If starting from scratch, initialize a new project and add the dependency:
cargo new my_utcp_app
cd my_utcp_app
Then edit Cargo.toml to include rs-utcp and tokio with full features as shown above.
- Build or run examples that exercise MCP/UTCP interactions. For example:
cargo build
# or run a sample binary that demonstrates MCP stdio usage
cargo run --example mcp_stdio_example
- (Optional) If you publish or use a binary target for the rs-utcp server, ensure you configure the proper cargo run arguments and, if needed, compile with features enabling MCP or other protocol transports as required by your project.
Additional notes
Tips and notes:
- rs-utcp supports MCP via stdio and Server-Sent Events (SSE). If your workflow relies on MCP, you can wire tools that read from or write to stdio or subscribe to SSE streams for real-time results.
- The library emphasizes async usage with Tokio, so structure your code to await results and handle streaming responses gracefully.
- Tools can be discovered by tag-based search or by loading a provider from a JSON configuration (providers.json style), enabling dynamic tool catalogs without recompiling.
- When integrating Codemode, you can run dynamic scripts that call registered tools and manage complex AI-driven pipelines.
- If you expose a server or binary that uses rs-utcp, consider adding OpenAPI or CLI-based tool definitions to simplify discovery and invocation.
- Environment variable configuration and tool provider loading can be customized via the provided loaders (e.g., dotenv) to suit your deployment environment.
Related MCP Servers
agentgateway
Next Generation Agentic Proxy for AI Agents and MCP servers
grafbase
The Grafbase GraphQL Federation Gateway
python-utcp
Official python implementation of UTCP. UTCP is an open standard that lets AI agents call any API directly, without extra middleware.
utcp
All-in-one MCP server that can connect your AI agents to any native endpoint, powered by UTCP
neurolink
Universal AI Development Platform with MCP server integration, multi-provider support, and professional CLI. Build, test, and deploy AI applications with multiple ai providers.
go-utcp
Official Go implementation of the UTCP