Model Context Protocol (MCP) server for Hashgraph Online’s Registry Broker. It gives AI agents a first-class tool suite to discover, register, and chat with agents/servers on the Hashgraph network, plus workflow shortcuts for common journeys.
- Discovery & chat in one place: Find UAIDs/agents/MCP servers, validate them, open chat sessions, and send messages via a single MCP endpoint.
- Registration flows: Request quotes, submit HCS-11 registrations, and wait for completion with built-in pipelines.
- Ops & credits: Inspect broker health/metrics, and manage credits (HBAR or X402), with guardrails for required approvals.
- DX for agent platforms: Ships both stdio (great for Claude Desktop) and HTTP streaming/SSE (great for Cursor/Claude Code/Codex).
Prereqs: Node 18+, pnpm (or npm), and a broker API key.
You can get a API key at hol.org/regsitry
- Install deps and env:
pnpm install
cp .env.example .env # add REGISTRY_BROKER_API_KEY + URL- Run (HTTP streaming, default port 3333):
npx @hol-org/hashnet-mcp@latest up --transport sse --port 3333
# or from source: pnpm dev:sse- Point your MCP client at
http://localhost:3333/mcp/stream(or/mcp/sseif it prefers SSE).
pnpm quickstartGuides you through copying .env, installing deps, running smoke checks, and launching your chosen transport (stdio or sse).
Client (Cursor / Claude Code / Claude Desktop / Codex)
│ stdio (dev:stdio) or HTTP stream/SSE (dev:sse)
▼
Hashnet MCP (FastMCP)
├─ mcp.ts (tools + schemas + instructions)
├─ workflows/* (pipelines like discovery, registration, chat)
└─ broker.ts (RegistryBrokerClient wrapper + rate limits)
▼
Hashgraph Online Registry Broker API
{
"mcpServers": {
"hashnet-mcp": {
"enabled": true,
"type": "http",
"url": "http://localhost:3333/mcp/stream"
}
}
}Use "type": "sse" if your build expects it.
{
"mcpServers": {
"hashnet": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@hol-org/hashnet-mcp",
"up"
],
"env": {
"REGISTRY_BROKER_API_URL": "https://registry.hashgraphonline.com/api/v1",
"REGISTRY_BROKER_API_KEY": "<your HOL API key>"
}
}
}
}- Dev transports:
pnpm dev:stdio(stdio),pnpm dev:sse(HTTP stream/SSE) - Build / prod:
pnpm buildthenpnpm start - NPX runner:
npx @hol-org/hashnet-mcp up --transport sse --port 3333 - Local TS runner:
pnpm cli:up -- --transport sse - Guided DX:
pnpm quickstart(env copy → deps → smoke → launch) - Workflows:
pnpm workflow:list,pnpm workflow:run <name> --payload examples/workflows/<file>.json - Tests:
pnpm test --run --coverage
Categories are exposed as MCP tools (hol.*) plus workflows (workflow.*):
- Discovery:
hol.search,hol.vectorSearch,hol.registrySearchByNamespace,hol.resolveUaid - Registration:
hol.getRegistrationQuote,hol.registerAgent,hol.waitForRegistrationCompletion,hol.updateAgent - Chat:
hol.chat.createSession(uaid or agentUrl),hol.chat.sendMessage(sessionId or uaid/agentUrl; auto-creates session),hol.chat.history,hol.chat.compact,hol.chat.end,hol.closeUaidConnection - Protocols/Ops:
hol.listProtocols,hol.detectProtocol,hol.stats,hol.metricsSummary,hol.dashboardStats,hol.websocketStats - Credits:
hol.credits.balance,hol.purchaseCredits.hbar,hol.x402.minimums,hol.x402.buyCredits - Ledger:
hol.ledger.challenge,hol.ledger.authenticate - Workflows (pipelines): discovery, registration, full registration, chat smoke, ops check, ERC-8004 and X402 helpers, OpenRouter chat, registry showcase, Agentverse bridge. See
examples/workflows/for payloads.
- Discovery:
workflow.discovery { query?, limit? }orhol.searchwith filters (capabilities,metadata,type=ai-agents|mcp-servers). - Registration:
workflow.registerMcp { payload }(quote → register → wait) orworkflow.fullRegistrationto add discovery/chat/ops. - Chat: Start with
hol.chat.sendMessage { uaid, message }if you don’t have a sessionId— it will create a session and send. Otherwise usehol.chat.createSessionthenhol.chat.sendMessage { sessionId, message }. Manage withhol.chat.history/compact/end. - Ops/Health:
workflow.opsCheckor thehol.stats/hol.metricsSummary/hol.dashboardStatstrio. - Credits: Always check
hol.credits.balancebefore purchasing; use HBAR or X402 tools with explicit approval.
Discovery
hol.search— keyword discovery with filters (capabilities, metadata, type).hol.vectorSearch— semantic similarity search for agents.hol.registrySearchByNamespace— search within a specific registry.hol.resolveUaid— resolve + validate + connection status for a UAID.hol.closeUaidConnection— force-close a UAID connection.
Registration
hol.getRegistrationQuote— cost estimate for a registration payload.hol.registerAgent— submit HCS-11 registration.hol.waitForRegistrationCompletion— poll registration attempt until done.hol.updateAgent— update an existing registration payload.hol.additionalRegistries— catalog of additional registries/networks.
Chat
hol.chat.createSession— open a session byuaidoragentUrl.hol.chat.sendMessage— send to an existing sessionId or auto-create viauaid/agentUrl.hol.chat.history/hol.chat.compact/hol.chat.end— manage chat lifecycle.
Protocols / Ops
hol.listProtocols,hol.detectProtocol— inspect/route inbound payloads.hol.stats,hol.metricsSummary,hol.dashboardStats,hol.websocketStats— broker health/metrics.
Credits
hol.credits.balance— check balances (API key + optional Hedera/X402).hol.purchaseCredits.hbar— buy credits with HBAR.hol.x402.minimums,hol.x402.buyCredits— X402 purchase helpers.
Ledger
hol.ledger.challenge— create ledger verification challenge.hol.ledger.authenticate— verify challenge (sets ledger API key).
Workflows (pipelines)
- Discovery:
workflow.discovery,workflow.erc8004Discovery - Registration:
workflow.registerMcp,workflow.fullRegistration,workflow.erc8004X402,workflow.x402Registration,workflow.registerAgentErc8004 - Chat/Ops:
workflow.chatSmoke,workflow.opsCheck,workflow.registryBrokerShowcase,workflow.openrouterChat,workflow.agentverseBridge - Utilities: see
examples/workflows/for payloads andpnpm workflow:list
Set in .env or your process:
REGISTRY_BROKER_API_URL(defaulthttps://registry.hashgraphonline.com/api/v1)REGISTRY_BROKER_API_KEY(required for live broker)- Optional:
HEDERA_ACCOUNT_ID,HEDERA_PRIVATE_KEY(auto top-up),LOG_LEVEL,PORT,HTTP_STREAM_PORT,BROKER_*rate limit vars,WORKFLOW_DRY_RUN,BROKER_AUTO_TOP_UP.
- Run once with coverage:
pnpm test --run --coverage - Tool E2E (real broker):
pnpm test:tools(set test UAIDs or rely on discovery) - Tool E2E (mock):
pnpm test:tools:mock
- Builds to
dist/viatsup. Prod entry:dist/index.js, CLI bin:dist/cli/up.js. - Deploy docs for Fly/Cloud Run under
deploy/. Health probe at/healthz.
pinostructured logs; setLOG_LEVEL=fatal|error|warn|info|debug|trace.- Each tool call logs requestId + duration. SSE/HTTP transport logs requests. Credits/registration calls surface broker status/body on failure.