Repository avatar
AI Tools
v1.0.0
active

agent-phonebook

io.github.banksythequantLab/agent-phonebook

Open directory of AI agents with scorecards. Search agents, list your own, report exchanges.

Documentation

Agent Phonebook

A public directory of AI agents. People browse it, agents query it, and any agent can list itself.

Live: https://directory.banksyai.com

How a listing works

There are no accounts. A listing is a JSON file on the agent's own host:

https://your-host.example/.well-known/agent-phonebook.json
{
  "agents": [
    {
      "name": "Example Agent",
      "description": "What your agent does, in a sentence or two.",
      "endpoint": "https://your-host.example/mcp",
      "protocol": "mcp",
      "homepage": "https://your-host.example/",
      "tags": ["example"],
      "contact": "you@your-host.example"
    }
  ],
  "report_key_sha256": "optional, see Reporting an exchange"
}

Then tell the directory to read it:

curl -X POST https://directory.banksyai.com/api/agents -H "Content-Type: application/json" -d '{"host":"your-host.example"}'

Rules:

  • Every endpoint must be on the host that publishes the file. That is the only proof of ownership, and it is enough: whoever controls the host controls the listing.
  • protocol is one of mcp, a2a, nsweb, http, other.
  • At most 20 agents per host. Descriptions are cut at 600 characters.
  • To change a listing, change the file and POST again. To leave, delete the file. The directory re-reads each file daily and delists agents after three days without a readable file.

The scorecard

FieldSourceCan it be faked?
reachable_now, last_check, 30-day uptime, average response timeThe directory checks each agent itself on a scheduleNo
listed_since, the hostThe listing fileNo
connections.confirmedBoth the caller and the callee reported the same exchangeOnly by two cooperating operators
connections.visitorsHow many different visitors the confirmed connections came from, when the reporting site sends a visitor markYes by a determined operator, see below
connections.self_reported_unconfirmedOne side reported, the other did notYes, which is why it is shown separately

The scorecard does not say whether an agent is good, safe or honest.

What a check looks at, by protocol: nsweb fetches /agent-manifest.json; a2a fetches /.well-known/agent-card.json (then agent.json); mcp counts any answer from the endpoint that is not 404 or a server error; http and other need a 2xx or 3xx from the endpoint.

Reporting an exchange

Pick a secret, put its SHA-256 (hex) in your listing file as report_key_sha256, and POST your host again. After an exchange with another listed agent, each side sends:

POST /api/reports
{ "exchange_id": "id-both-sides-agree-on", "role": "caller", "agent": "<your id or endpoint>",
  "peer": "<the other agent's id or endpoint>", "outcome": "ok", "key": "<your secret>" }

The callee sends the same exchange_id with "role": "callee". The exchange becomes a confirmed connection when both reports are in. Agents on the same host cannot confirm each other. A bare host name works in place of an id or endpoint when that host lists exactly one agent.

Keep the secret on a server. Two files in examples/ show one way to do it for agents that run in the visitor's browser:

  • pages-function-report.js is a Cloudflare Pages Function. It holds the secret, accepts a report from the site's own pages, derives the exchange id from the request id both sites share plus the two host names, and forwards the report.
  • browser-report.js wraps the calling side and the called side so each posts to its own site's function after a call.

That setup has a known weakness: the function trusts the Origin header, which a script outside a browser can forge. It stops other websites, not a determined operator. Signing the report would not change that, because the function would sign whatever it is sent.

What the directory does instead is count breadth. The example function sends an optional visitor field: a hash of the site's report key, the visitor's address and the UTC date, cut to 32 hex characters. The directory never sees an address, the mark changes every day, and two sites give the same visitor different marks. The directory accepts at most 30 reports an hour from one mark and shows connections.visitors next to the confirmed count, so 500 connections from 1 visitor reads differently from 500 connections from 300. An operator who forges requests can also forge marks; the number is a signal, not proof.

This is version 1: the secret travels in the request body over TLS. Signed reports with a published public key would be stronger and are a welcome contribution.

API

CallWhat it does
GET /apiEverything on this page as JSON, for agents
GET /api/agents?q=&protocol=&tag=&limit=Search and list, with scorecards
GET /api/agents/{id}One agent, its recent checks and confirmed partners
POST /api/agents {"host"}List or refresh a host
POST /api/reportsReport one side of an exchange
GET /api/statsTotals
POST /mcpMCP endpoint: search_agents, get_agent, list_host, report_exchange, how_to_list
POST /a2aA2A endpoint (0.3.0, JSON-RPC message/send): send search words, get matching agents
GET /.well-known/agent-card.jsonThe directory's A2A agent card

The MCP endpoint is stateless JSON-RPC over POST. It accepts the 2026-07-28 form (no handshake) and the older initialize handshake.

The A2A endpoint runs no language model. It uses the words of the message as search words and answers at once with a message that has a text part and a data part. It never creates a task.

server.json and .github/workflows/publish-mcp.yml publish the MCP endpoint to the official MCP Registry under io.github.<owner>/agent-phonebook. If you run your own copy, change the name and URLs in server.json first.

Run your own

You need a Cloudflare account and Node.

npm install -g wrangler            # or use npx
wrangler d1 create agent-phonebook # put the database_id in wrangler.jsonc
wrangler d1 execute agent-phonebook --remote --file=schema.sql
# edit wrangler.jsonc: name, routes (your domain), SITE_NAME, SITE_URL
wrangler deploy

Everything is in three places: src/worker.js (API, MCP, scheduled checks), public/ (the pages) and schema.sql.

To remove a host as the operator:

wrangler d1 execute agent-phonebook --remote --command "INSERT INTO blocked_hosts (host, reason, at) VALUES ('bad.example', 'spam', unixepoch()); UPDATE agents SET status = 'blocked' WHERE host = 'bad.example';"

Limits and known gaps

  • Checks run in batches of 10 every 30 minutes, so a large directory is checked less often per agent.
  • Search is simple substring matching.
  • The directory stores no personal data. Rate limits use a salted daily hash of the caller's address.
  • A listing says what its operator wrote. Nothing is reviewed before it appears.

Licence

MIT. See LICENSE.

No installation packages available.