Agent Doctor
An MCP server that audits ERC-8004 agent registrations, diagnosing issues and providing fix lists.
README
Agent Doctor
An AI-agent-facing service that audits ERC-8004 agent registrations and tells owners exactly how to fix them.
Why: of 170,000+ agents registered in the ERC-8004 registries, only 3–15%
expose BOTH a valid registration file AND a live declared endpoint
(arXiv:2606.26028). Agent Doctor diagnoses
that gap: it resolves the on-chain identity, fetches and validates the
registration file, probes every declared endpoint for liveness, verifies the
ENSIP-25 bidirectional ENS link, and returns a graded report (A–F) with a
concrete, ordered fix list.
What it checks
| Check | Meaning |
|---|---|
identity.resolve |
tokenURI(agentId) on the IdentityRegistry (0x8004A169FB4a3325136EB29fA0ceB6D2e539a432, same address on Ethereum, Base, Arbitrum, Optimism, Polygon, Linea) returns a non-empty agentURI |
registration.fetch |
the agentURI (https / ipfs / data:) serves valid JSON |
registration.structure / core_fields / services |
registration-v1 shape: type, name, description, image, well-formed services[] (lenient — soft fields warn, not fail) |
registration.registrations |
registrations[] actually references this chain + registry + agentId (eip155:{chainId}:{registry}) |
endpoint.* |
liveness probe per declared service — generic HTTP GET; A2A additionally looks for the agent card (endpoint itself, then /.well-known/agent-card.json); MCP is reachability-only (no handshake in MVP); ENS/DID/email/agentWallet are identifiers, skipped here |
ens.*.bidirectional |
ENSIP-25: the registration file references the ENS name and the name carries the text record agent-registration[<ERC-7930 registry>][<agentId>] — either side alone fails |
Grades: A all pass · B warnings only · C endpoint/ENS failures ·
D broken registration file · F identity unresolvable.
Quickstart
cd agent-doctor
python3 -m venv .venv
.venv/bin/pip install web3 fastapi uvicorn httpx mcp pytest
CLI
.venv/bin/python -m agent_doctor check --chain base --agent-id 42
.venv/bin/python -m agent_doctor check --chain base --agent-id 42 --ens myagent.eth
.venv/bin/python -m agent_doctor check --ens myagent.eth # best-effort discovery
.venv/bin/python -m agent_doctor check --chain base --agent-id 42 --json
Exit code 0 for grades A/B, 1 otherwise (CI-friendly).
HTTP API
.venv/bin/uvicorn agent_doctor.api:app --port 8004
curl 'http://127.0.0.1:8004/check?chain=base&agentId=42'
curl 'http://127.0.0.1:8004/check?ens=myagent.eth'
curl 'http://127.0.0.1:8004/healthz'
MCP (stdio)
.venv/bin/python -m agent_doctor.mcp_server
Exposes one tool, diagnose_agent(chain, agent_id, ens, timeout). Claude Code
registration example:
claude mcp add agent-doctor -- /path/to/agent-doctor/.venv/bin/python -m agent_doctor.mcp_server
Configuration
AGENT_DOCTOR_RPC_<CHAIN>(e.g.AGENT_DOCTOR_RPC_BASE) — override the default publicnode RPCs; ENS always resolves on Ethereum mainnet.AGENT_DOCTOR_IPFS_GATEWAY— defaulthttps://ipfs.io/ipfs/.AGENT_DOCTOR_HTTP_TIMEOUT— default 10 s.
Tests
.venv/bin/python -m pytest # unit tests (offline)
.venv/bin/python -m pytest --live # + live read-only test against the real Base registry
Fixtures include the ENSIP-25 worked example: registry
0x8004A169…a432 on eip155:1, agentId 42 →
agent-registration[0x000100000101148004a169fb4a3325136eb29fa0ceb6d2e539a432][42].
Register Agent Doctor itself (owner-only steps)
The repo ships its own dogfood identity in identity/:
registration.json (valid per our own validator), mint_identity.py
(unsigned tx builder — never touches keys), ens_records.py (exact ENSIP-25
record printer). To go live:
- Registration file is hosted — this repo is public, so the canonical
agentURI is
https://raw.githubusercontent.com/Maxwell012/agent-doctor/main/identity/registration.json. Theagentdoctor.example.comservice endpoints inside it are still placeholders — replace them once the HTTP API is deployed somewhere real. - Fund a wallet on Base (a few dollars of ETH for gas).
- Mint the identity — build the unsigned tx and sign it in your own wallet:
Function:.venv/bin/python identity/mint_identity.py --agent-uri https://raw.githubusercontent.com/Maxwell012/agent-doctor/main/identity/registration.json --from 0xYourAddressregister(string agentURI)on0x8004A169FB4a3325136EB29fA0ceB6D2e539a432(Base, chainId 8453). Read the mintedagentIdfrom theRegisteredevent, then updateregistrations[].agentIdinregistration.json(currently a0placeholder) and re-upload. - Buy the ENS name —
agent-doctor.eth(checked free on mainnet 2026-07-13); register it in the ENS app, set its ETH address record to the minting wallet. - Set the ENSIP-25 text record (bidirectional link):
Set the printed key to value.venv/bin/python identity/ens_records.py --ens <yourname>.eth --chain base --agent-id <agentId>1in the ENS app; also update the ENSservices[]entry inregistration.jsonif the name differs from the placeholder. Optionally set profile text records (avatar,description,url). - Optional: buy the $1 verification certificate at veral.tech for an extra trust signal.
- Self-check until grade A:
.venv/bin/python -m agent_doctor check --chain base --agent-id <agentId> --ens <yourname>.eth
Design notes / known limits (MVP)
- Read-only chain access; no keys, no signing, no state.
- The deployed registry proxy does not answer
totalSupply()/ enumeration (observed 2026-07-09), so ENS-only diagnosis without an agentId is best-effort and warns instead of guessing. - MCP probe is reachability-only; a real MCP handshake (initialize/tools-list) is a natural next step.
- Registration schema is validated leniently on purpose — the EIP-8004 registration-v1 field list is not a closed schema.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.