Skip to content

TruCore Product Docs

MeshDNS

The service registry for AI agents. Never hardcode an MCP server again. Register capabilities, resolve by feature, automatic health checks.

What is MeshDNS?

MeshDNS is a capability-based service registry for MCP (Model Context Protocol) servers. Think DNS, but for your AI agent mesh. Instead of hardcoding server URLs into every agent config file, agents ask: "who can do weather forecasting right now?" — and MeshDNS returns the best available server.

Every MCP agent today ships a hardcoded JSON server list. New server = config edit. Dead server = silent failure. No way to ask "who can do X?" MeshDNS fixes all three: dynamic registration, live health checks, and capability-based resolution in one MCP-native call.

Architecture

Six components in one static Go binary:

ComponentRole
HTTP ServerGo stdlib net/http — no frameworks. Serves REST API, landing page, and JSON export endpoint.
Registry StoreSQLite via modernc.org/sqlite — pure Go, no CGo. Server manifests, health history, resolution counters.
Health Check PoolBackground worker pool probes every registered health_url on a configurable interval. Tracks 30-day uptime history.
Resolution EngineMatches capability queries against UP servers, ranks by 30-day uptime. Dead servers never appear in results.
Landing PagePublic dashboard at the domain root — live server counts, resolutions/24h, per-server uptime.
SDK ClientsPython (pip) + TypeScript (npm). Thin resolve clients — one function call from agent to server.

Quickstart

Install, start, register, resolve — 60 seconds:

$ go install github.com/trucore-ai/meshdns/cmd/meshdns@latest
$ meshdns --port=:8080
  MeshDNS listening on :8080

# Register a server
$ curl -s -X POST http://localhost:8080/v0/servers \
  -H "Content-Type: application/json" \
  -d '{"name":"weather-agent","description":"Weather data MCP server",
       "server_url":"https://weather.example.com",
       "health_url":"https://weather.example.com/health",
       "capabilities":["weather","forecast","alerts"],
       "owner_contact":"ops@example.com"}'
# → {"server_id":"...","write_key":"..."}

# Resolve by capability
$ curl -s "http://localhost:8080/v0/resolve?capability=weather"
# → [{"name":"weather-agent","server_url":"https://weather.example.com",...}]

API Reference

MethodPathDescription
POST/v0/serversRegister a new server. Returns server_id + write_key. Duplicate names → 409.
GET/v0/serversList servers. Query params: status (active/delisted/all), query, capability, cursor, limit.
PUT/v0/servers/{id}Update a server manifest. Requires Authorization: Bearer write_key.
DELETE/v0/servers/{id}Delist (soft-delete) a server. Requires Authorization: Bearer write_key. Stops health probes within one cycle.
GET/v0/resolveResolve servers by capability. Query param: capability (required). Returns only UP servers, ranked by 30-day uptime.
GET/v0/statsRegistry statistics: active/total servers, up count, resolutions and probes in the last 24h.
GET/v0/exportFull registry JSON export. Open data — no auth required. Platform-risk hedge: your data is never locked in.

How Health Checks Work

MeshDNS probes every registered server's health_url on a configurable interval (default: 60s). A probe is a simple HTTP GET with a 5-second timeout. Non-2xx responses and timeouts both mark the server as DOWN.

  1. Register with health_url. When you register a server, provide the health endpoint URL. MeshDNS starts probing it immediately.
  2. Probe every 60s. Background goroutine pool sends HTTP GET requests. Configurable via MESHDNS_PROBE_INTERVAL and MESHDNS_PROBE_TIMEOUT env vars.
  3. Mark UP/DOWN. Server goes down → marked DOWN within one probe cycle. Server comes back → marked UP on the next successful probe. 30-day uptime history preserved.
  4. Resolution excludes DOWN servers. /v0/resolve never returns servers marked DOWN. Agents always get working endpoints. No silent failures.

SDK Reference

Python

$ pip install meshdns-client
from meshdns_client import MeshDNSClient

client = MeshDNSClient("https://meshdns.trucore.xyz")

# Resolve a capability
servers = client.resolve("weather")
# → [{"name":"weather-agent","server_url":"https://...","up":true}]

# Smart retry — skips recently-failed servers
next_server = client.resolve_next("weather")

TypeScript

$ npm i @meshdns/client
import { MeshDNSClient } from "@meshdns/client";

const client = new MeshDNSClient("https://meshdns.trucore.xyz");

// Resolve a capability
const servers = await client.resolve("weather");

// Smart retry — skips recently-failed servers
const next = await client.resolveNext("weather");

Configuration

All config via environment variables:

VariableDefaultDescription
MESHDNS_PORT:8080Listen address
MESHDNS_DBmeshdns.dbSQLite database path
MESHDNS_PROBE_INTERVAL60sSeconds between health probes
MESHDNS_PROBE_TIMEOUT5sPer-probe HTTP timeout
MESHDNS_WORKERS4Health check goroutine pool size

Security Model

Read paths are public

List, resolve, stats, and export endpoints require no authentication. Registry data is open by design — the platform-risk hedge.

Write paths require bearer tokens

Registration returns a write_key. Updates and deletes require Authorization: Bearer write_key. You control your server entry.

Soft-delete, not hard-delete

Deleting delists a server — it stops appearing in listings and health probes — but the record is preserved. No data destruction.

No PII beyond owner contact

The only quasi-personal field is owner_contact (email). Source IPs hashed at ingestion, never stored raw. No third-party trackers.

Full data export

GET /v0/export returns the complete registry as JSON. Your data is never locked in. This is the platform-risk hedge — if MeshDNS goes down, you have everything.

Single binary, zero external deps

Go stdlib + pure-Go SQLite. No Redis, no Postgres, no message queue. Deploy the binary, point at a volume, done.

FAQ

How is this different from the MCP Registry?

The official MCP Registry is a flat list of servers with no capability search, no health checks, and no programmatic resolution. MeshDNS adds all three: ask "who can do weather?" and get back working servers sorted by uptime — automatically.

Can I run my own instance?

Yes. MeshDNS is a single Go binary — MIT-licensed, self-contained, zero external dependencies. Deploy behind Caddy or nginx with auto-TLS and you have a private registry in minutes. The public instance at meshdns.trucore.xyz is a convenience, not a requirement.

What happens if MeshDNS goes down?

Agents should cache the last resolve result and fall back to cached servers. Additionally, GET /v0/export gives you the full registry as JSON — archive it periodically for disaster recovery.

How fast is resolution?

p99 under 100ms with 1,000 registered servers on MVP hardware. Resolution is a simple indexed SQLite query — no network hops, no external services, no cache warming.

When will trust scores be added?

Trust scores and ratings are planned for phase 2. They need usage data to be meaningful — the current uptime-based ranking is the v1 foundation that trust scores build on. Register now and your uptime history gives you a head start when scoring launches.

Integrations & Next Steps