ubl-mcp
Secure Model Context Protocol for LogLine Agents
MCP tools, but with a kernel: policy-first, audit-ready, and boringly predictable.
What is this?
ubl-mcp is a clean implementation of the Model Context Protocol (JSON-RPC 2.0) that routes every tool call through your TDLN Gate. It's the "universal IO bus" for your agents — interop with the MCP ecosystem without giving the model a foot-gun.
Why this exists
Tooling is where agents get hurt:
- "Try calling delete_repo lol" — no thanks.
- Shadow state and ad-hoc logs — unverifiable.
- Each tool wrapper a snowflake — not scalable.
We fix it with three invariants:
- Gate-before-IO: tool calls are proposals → Gate decides Permit/Deny/Challenge
- Canonical Intent: calls carry a tiny, canonicalized Intent body (TDLN)
- Schema-first: tools declare their input schema (via schemars)
Quickstart
Client (Gate-aware)
use ;
use json;
async
Server (schema-first)
use ;
use JsonSchema;
use Deserialize;
let server = new
.tool
.tool
.build;
// Handle requests
let tools = server.list_tools;
println!;
API Overview
Protocol Types
// JSON-RPC 2.0
// MCP
Client
Server
Error Model
| Error | Meaning |
|---|---|
Protocol(msg) |
JSON-RPC or MCP protocol error |
ToolFailure(msg) |
Tool returned an error |
PolicyViolation(msg) |
Gate denied the call |
Transport(msg) |
IO or connection error |
Features
client— MCP client with Gate enforcement (default)server— MCP server with schema-first tools (default)
Security
#![forbid(unsafe_code)]- Gate-before-IO: every call goes through TDLN Gate
- Schema validation via schemars
- Size and time caps (defaults are conservative)
License
MIT — See LICENSE