{"slug": "i-built-a-discovery-layer-for-ai-agents-because-mine-kept-getting-lost", "title": "I built a discovery layer for AI agents because mine kept getting lost", "summary": "A developer built agentreg, a self-hosted service registry for AI agents that provides capability-based discovery and health checks. The Go-based tool addresses the lack of a discovery layer for agents using the Model Context Protocol (MCP), offering features like heartbeat monitoring and a pluggable verifier for future trust verification.", "body_md": "Everyone's building AI agents right now. Almost nobody's building the boring layer underneath them: how do agents find each other?\n\nI hit this in my own stack. I run a few MCP servers one for search, one for my database, one exposing my product's API. Their addresses lived in a JSON config I edited by hand. When I added a fourth, the file got messy. When one went down, I found out because something downstream broke and I debugged backwards. There was no single source of truth for what agents existed or whether they were alive.\n\nMCP gave agents a common language. There's still no discovery layer. That felt like having HTTP without a service registry.\n\nSo I built **agentreg**. It's a self-hosted service registry for agents one Go binary:\n\nagentctl serve &\n\nagentctl register search-agent -c search -e [http://localhost:3000](http://localhost:3000)\n\nagentctl find search # discover by capability, not a hardcoded URL\n\nagentctl list # everything, with live health\n\nIt health-checks every registered agent on a heartbeat, so a dead one shows up as `unhealthy`\n\nbefore it takes something down with it. That single feature has already saved me a debugging session.\n\nA fair question I keep getting: \"isn't this just service discovery, like Consul?\" Close, but the query is different. Consul answers *where is this service?* a host and port. Agents need *what can this thing do, is it healthy, and can I trust it?* That's capability-first, and it's why the registry is agent-shaped rather\n\nthan micro service-shaped.\n\nI'm being upfront about the stage: this is v0.1, I built it solo, and it does discovery + health and nothing more yet. No federation, no auth, no trust verification — though the code has a pluggable verifier seam for exactly that later. It's MIT, self-hosted, no cloud, no account.\n\nInstall:\n\n```\nbrew install mkk2026/tap/agentreg\nRepo: https://github.com/mkk2026/agentreg\n```\n\nIf you run more than a couple of MCP servers, I'd genuinely like to know whether this solves a real annoyance for you or whether I'm a year early. The most useful thing you can tell me is whether you're still running it a week after you try it. That's the only feedback that counts.", "url": "https://wpnews.pro/news/i-built-a-discovery-layer-for-ai-agents-because-mine-kept-getting-lost", "canonical_source": "https://dev.to/mkk2026/i-built-a-discovery-layer-for-ai-agents-because-mine-kept-getting-lost-5bjo", "published_at": "2026-07-25 23:54:41+00:00", "updated_at": "2026-07-26 00:30:48.899225+00:00", "lang": "en", "topics": ["ai-agents", "developer-tools", "ai-infrastructure"], "entities": ["agentreg", "MCP", "Consul"], "alternates": {"html": "https://wpnews.pro/news/i-built-a-discovery-layer-for-ai-agents-because-mine-kept-getting-lost", "markdown": "https://wpnews.pro/news/i-built-a-discovery-layer-for-ai-agents-because-mine-kept-getting-lost.md", "text": "https://wpnews.pro/news/i-built-a-discovery-layer-for-ai-agents-because-mine-kept-getting-lost.txt", "jsonld": "https://wpnews.pro/news/i-built-a-discovery-layer-for-ai-agents-because-mine-kept-getting-lost.jsonld"}}