Synap now supports UMICP (Universal Matrix Intelligent Communication Protocol) v0.2.3, providing a high-performance binary protocol for AI model interoperability and inter-process communication.
Version: 0.2.3
Status: ✅ Production Ready
Implementation Pattern: Vectorizer-compatible
- ✅ Envelope-based Communication: Structured binary protocol with validation
- ✅ Tool Discovery: Auto-discovery of 8 core operations via
DiscoverableServicetrait - ✅ MCP Compatible: Converts UMICP → MCP → UMICP (reuses existing MCP tools)
- ✅ Native JSON Types: Full support for numbers, booleans, arrays, objects
- ✅ HTTP/2 Transport: High-performance streaming over HTTP
- ✅ Zero Duplication: Wraps existing MCP handlers without code duplication
Endpoint: POST /umicp
Content-Type: application/json
Accepts UMICP envelopes and routes to appropriate MCP handlers.
Example Request:
{
"from": "client-001",
"to": "synap-server",
"operation": "Request",
"message_id": "msg-12345",
"capabilities": {
"operation": "synap_kv_set",
"key": "user:001",
"value": "Andre Silva"
}
}Example Response:
{
"from": "synap-server",
"to": "client-001",
"operation": "Data",
"message_id": "resp-msg-12345",
"capabilities": {
"status": "success",
"result": {"success": true},
"original_message_id": "msg-12345"
}
}Endpoint: GET /umicp/discover
Returns all available operations in UMICP format.
Example Response:
{
"protocol": "UMICP",
"version": "0.2.3",
"server_info": {
"server": "synap-server",
"version": "0.3.0-rc",
"protocol": "UMICP/2.0",
"features": [
"key-value-store",
"message-queues",
"event-streams",
"pub-sub",
"kafka-partitioning",
"consumer-groups",
"persistence",
"replication",
"mcp-compatible"
],
"operations_count": 8,
"mcp_compatible": true
},
"operations": [ /* 8 operation schemas */ ],
"total_operations": 8
}Synap exposes 8 core operations via UMICP:
| Operation | Type | Description |
|---|---|---|
synap_kv_get |
Request | Retrieve value from KV store |
synap_kv_set |
Request | Store key-value pair |
synap_kv_delete |
Request | Delete key from store |
synap_kv_scan |
Request | Scan keys by prefix |
synap_queue_publish |
Request | Publish message to queue |
synap_queue_consume |
Request | Consume message from queue |
synap_stream_publish |
Data | Publish event to stream |
synap_pubsub_publish |
Data | Publish to pub/sub topic |
src/server/umicp/
├── mod.rs # Module exports + UmicpState
├── handlers.rs # UMICP → MCP conversion layer
├── discovery.rs # DiscoverableService implementation
└── transport.rs # HTTP handlers (POST / + GET /discover)
Client
↓ (UMICP Envelope via HTTP POST)
transport.rs::umicp_handler()
↓ (Parse & Validate Envelope)
handlers.rs::handle_umicp_request()
↓ (Extract capabilities)
capabilities_to_mcp_request()
↓ (MCP CallToolRequest)
mcp_handlers.rs::handle_mcp_tool()
↓ (Process via existing MCP logic)
create_success_response() / create_error_response()
↓ (UMICP Envelope)
Client
- MCP Reuse: UMICP handlers convert envelopes to MCP
CallToolRequestand reuse existing MCP handlers - Zero Duplication: No duplicate business logic—all operations go through the same MCP handlers
- Stateful Wrapper:
UmicpStatewrapsAppStatefor protocol-specific needs - Native JSON: Capabilities use
HashMap<String, serde_json::Value>for native JSON support
use umicp_core::{Envelope, OperationType};
use std::collections::HashMap;
use serde_json::json;
// Create KV SET request
let mut caps = HashMap::new();
caps.insert("operation".to_string(), json!("synap_kv_set"));
caps.insert("key".to_string(), json!("user:001"));
caps.insert("value".to_string(), json!("Andre Silva"));
let envelope = Envelope::builder()
.from("client-001")
.to("synap-server")
.operation(OperationType::Request)
.message_id("msg-001")
.capabilities(caps)
.build()?;
// Send via HTTP
let client = reqwest::Client::new();
let response = client
.post("http://localhost:15500/umicp")
.json(&envelope)
.send()
.await?;
// Parse response envelope
let response_envelope: Envelope = response.json().await?;
tracing::info!("Result: {:?}", response_envelope.capabilities());# Discovery
curl http://localhost:15500/umicp/discover | jq .
# KV SET
curl -X POST http://localhost:15500/umicp \
-H "Content-Type: application/json" \
-d '{
"from": "curl-client",
"to": "synap-server",
"operation": "Request",
"message_id": "msg-001",
"capabilities": {
"operation": "synap_kv_set",
"key": "test:key",
"value": "test value"
}
}' | jq .
# KV GET
curl -X POST http://localhost:15500/umicp \
-H "Content-Type: application/json" \
-d '{
"from": "curl-client",
"to": "synap-server",
"operation": "Request",
"message_id": "msg-002",
"capabilities": {
"operation": "synap_kv_get",
"key": "test:key"
}
}' | jq .#[derive(Clone)]
pub struct UmicpState {
pub app_state: Arc<AppState>,
}Simple wrapper around AppState for UMICP-specific needs.
impl DiscoverableService for SynapDiscoveryService {
fn server_info(&self) -> ServerInfo { /* ... */ }
fn list_operations(&self) -> Vec<OperationSchema> { /* ... */ }
}Converts MCP tools to UMICP OperationSchema format.
All errors are converted to UMICP error envelopes:
{
"from": "synap-server",
"to": "client",
"operation": "Control",
"message_id": "err-msg-001",
"capabilities": {
"status": "error",
"error": "Key not found",
"original_message_id": "msg-001"
}
}# Run UMICP tests
cargo test --package synap-server --lib server::umicp::discovery
# Test discovery endpoint
curl http://localhost:15500/umicp/discover
# Test message handler
curl -X POST http://localhost:15500/umicp \
-H "Content-Type: application/json" \
-d '{"from":"test","to":"synap","operation":"Request","message_id":"1","capabilities":{"operation":"synap_kv_scan","limit":10}}'- Latency: Sub-millisecond operation routing (UMICP → MCP conversion)
- Throughput: Matches MCP throughput (no additional overhead)
- Memory: Minimal overhead (~200 bytes per envelope)
| Feature | UMICP | MCP | REST |
|---|---|---|---|
| Protocol | Binary envelope | JSON-RPC 2.0 | HTTP JSON |
| Discovery | ✅ DiscoverableService | ✅ list_tools | ❌ Manual |
| Validation | ✅ Envelope validation | ✅ Schema validation | |
| Streaming | ✅ HTTP/2 + WebSocket | ✅ StreamableHTTP | |
| Native Types | ✅ serde_json::Value | ✅ JSON | ✅ JSON |
| Overhead | Low (binary) | Medium (JSON-RPC) | Medium (HTTP) |
| AI Integration | ✅ UMICP clients | ✅ MCP servers |
- WebSocket Transport: Real-time bidirectional communication
- Compression: Per-message GZIP/LZ4 compression
- Authentication: UMICP-level auth integration
- Batch Operations: Multiple operations in single envelope
- Streaming Responses: Large result streaming
Status: ✅ Production Ready (v0.2.3)
Last Updated: October 22, 2025
Author: HiveLLM Team