Public
MCP + A2A protocol bridge using Hono — an AI communication bus
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.

AI Bus

An AI communication bus implementing the Model Context Protocol (MCP), the Agent2Agent (A2A) Protocol, and the Universal Memory Protocol (UMP), built with Hono on Val Town.

Three interoperability layers in one service:

  • MCP — tools, resources, and prompts for AI clients like Claude Desktop
  • A2A — agent-to-agent task management and messaging
  • UMP — portable, bi-temporal agent memory with provenance and consent

Architecture

Rendering mermaid diagram...

Endpoints

EndpointMethodProtocolDescription
/GETService info & endpoint listing
/healthGETHealth check
/mcpPOSTMCPStreamable HTTP JSON-RPC endpoint
/mcpDELETEMCPSession termination
/a2aPOSTA2AJSON-RPC endpoint for agent communication
/ump/capabilitiesGETUMPServer capabilities & conformance level
/ump/recallPOSTUMPSearch memory by query + scope
/ump/rememberPOSTUMPWrite a memory record
/ump/memory/:idGETUMPGet a single record by URN
/ump/revisePOSTUMPNon-destructive update (creates successor)
/ump/forgetPOSTUMPTombstone or hard-delete a record
/.well-known/agent.jsonGETA2AAgent Card for discovery
/.well-known/ump.jsonGETUMPUMP manifest for memory discovery

MCP Protocol (v2025-06-18)

Supported Methods

  • initialize — Capability negotiation with session ID
  • notifications/initialized — Client ready notification
  • ping — Health check
  • tools/list — List available tools
  • tools/call — Invoke a tool
  • resources/list — List available resources
  • resources/read — Read a resource
  • prompts/list — List available prompts
  • prompts/get — Get a prompt template

Tools

ToolDescription
send_agent_messageSend a message to the A2A agent, creating or updating a task
get_taskRetrieve task status, history, and artifacts
list_tasksList tasks with optional context/state filters
cancel_taskCancel an active task
ump.capabilitiesGet UMP server capabilities and conformance level
ump.recallSearch agent memory by query + scope with ranked results
ump.rememberWrite a portable memory record
ump.getRetrieve a single memory record by URN
ump.reviseNon-destructive update — creates a successor record
ump.forgetTombstone or hard-delete a memory record

Resources

URIDescription
a2a://agent-cardThe A2A Agent Card JSON
a2a://tasksAll tasks in the system
ump://capabilitiesUMP server capabilities JSON

Prompts

PromptDescription
delegate_taskTemplate for delegating a task to the A2A agent

A2A Protocol (v1.0)

Supported Methods

  • message/send — Send a message, create or update a task
  • message/stream — Send a message with SSE streaming response
  • tasks/get — Get task by ID
  • tasks/list — List tasks with filters
  • tasks/cancel — Cancel a task
  • ping — Health check

Agent Card

Discovery via /.well-known/agent.json returns the agent's capabilities, skills, and endpoint URL.

Task States

workingcompleted | failed | canceled | rejected | input-required | auth-required

UMP Protocol (v0.1, L2 Conformance)

Implements the Standard (L2) conformance level: all six operations, bi-temporal valid_at queries, provenance, scope + consent enforcement, and both MCP and HTTP bindings.

Operations

OperationMCP ToolHTTP EndpointDescription
capabilitiesump.capabilitiesGET /ump/capabilitiesNegotiation handshake
recallump.recallPOST /ump/recallSearch memory with ranked results
rememberump.rememberPOST /ump/rememberWrite a memory record
getump.getGET /ump/memory/:idGet single record by URN
reviseump.revisePOST /ump/reviseNon-destructive update (supersedes prior)
forgetump.forgetPOST /ump/forgetTombstone (soft) or erase (hard)

Memory Record

Each record is a typed, scoped, bi-temporal, signed JSON object:

  • Kinds: semantic, episodic, procedural, working, identity
  • Scope: owner (DID), project, agent, session, visibility (private/shared/public)
  • Bi-temporal: valid_from/valid_to (when the fact is true) + created/observed (when the system learned it)
  • Provenance: actor, actor_kind, method, source, evidence (W3C PROV-aligned)
  • Consent: retention, exportable, redact (JSON-paths stripped on export)
  • Lifecycle: confidence, salience, decay, status (active/candidate/tombstoned)
  • Supersession: revise creates a successor and links via supersedes/superseded_by

Discovery

/.well-known/ump.json returns a manifest pointing at the UMP endpoint and advertising conformance level.

File Structure

main.ts      — Hono HTTP handler, routes for MCP, A2A & UMP
mcp.ts       — MCP protocol handler (tools, resources, prompts)
a2a.ts       — A2A protocol handler (agent card, tasks, messaging, SSE)
ump.ts       — UMP protocol handler (memory records, bi-temporal, supersession)
storage.ts   — SQLite persistence for tasks and messages
types.ts     — Shared TypeScript types for all three protocols

Usage Examples

MCP Initialize

curl -X POST <endpoint>/mcp \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"my-client","version":"1.0"}}}'

MCP Call a Tool

curl -X POST <endpoint>/mcp \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"send_agent_message","arguments":{"text":"Hello from MCP!"}}}'

A2A Send Message

curl -X POST <endpoint>/a2a \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":1,"method":"message/send","params":{"message":{"role":"user","parts":[{"type":"text","text":"Hello from A2A!"}]}}}'

UMP Remember (HTTP binding)

curl -X POST <endpoint>/ump/remember \ -H "Content-Type: application/json" \ -d '{"record":{"kind":"procedural","body":{"text":"Use pnpm for this repo."},"scope":{"owner":"did:key:z6Mk...","project":"github.com/example/app","visibility":"private"},"provenance":{"actor":"did:key:z6Mk...","actor_kind":"user","method":"user_correction"}}}'

UMP Recall (HTTP binding)

curl -X POST <endpoint>/ump/recall \ -H "Content-Type: application/json" \ -d '{"query":"package manager","scope":{"owner":"did:key:z6Mk...","project":"github.com/example/app"}}'

UMP Remember (MCP binding)

curl -X POST <endpoint>/mcp \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"ump.remember","arguments":{"record":{"kind":"semantic","body":{"text":"User prefers concise release notes."},"scope":{"owner":"did:key:z6Mk...","project":"github.com/example/app","visibility":"private"},"provenance":{"actor":"did:key:z6Mk...","actor_kind":"user","method":"user_correction"}}}}}'

Protocols