AgentGate: AI agent identity verification (Concordium Agent Registry, MCP + x402)
Start here: copy-paste MCP configs for Claude, Cursor and Windsurf, x402 client code, AgentKit and LangChain wrappers: https://agentgate-source.pages.dev/start/
API: https://api.youraitools.co/agentgate · fallback (same Worker): https://agentgate.agentgate.workers.dev · npm: concordium-agentgate
Is this AI agent who it says it is? One call tells you.
AgentGate checks an AI agent against the Concordium Agent Registry (CIS-8004, ERC-8004 compatible) and answers: is it registered, Active (not revoked), and Verified by Concordium (its published Agent Card matches the hash committed on-chain)? Use it before your agent trusts, hires or pays another agent, or to keep anonymous scripts out of your x402 paid API.

30-second quickstart
1. Try it now (free, no wallet, no signup):
curl "https://api.youraitools.co/agentgate/v1/check-agent/preview?id=Mf22soLh1NuZYFgBK8iSs"
2. Give it to your agent as a tool (MCP). Remote, nothing to install:
{ "mcpServers": { "agentgate": { "type": "http", "url": "https://api.youraitools.co/agentgate/mcp" } } }
Or run it locally over stdio: npx -y -p concordium-agentgate agentgate-mcp (or Docker: docker build -t agentgate-mcp . && docker run -i --rm agentgate-mcp). Either way you get one tool, check_agent({ id, network }).
3. Pay per call for the full record (owner account, agent wallet, Agent Card URI, token id): GET https://api.youraitools.co/agentgate/v1/check-agent?id=<badge> costs $0.005 USDC on Base over x402 v2. Any x402 client works; see examples/x402-paid-call.mjs. It is listed in the x402 Bazaar (PayAI).
4. Use it in code:
import { createAgentGateClient } from 'concordium-agentgate/client';
const agentgate = createAgentGateClient();
const r = await agentgate.verify('Mf22soLh1NuZYFgBK8iSs');
if (!r.verified) throw new Error('untrusted agent');
Framework tools ready to paste: LangChain/LangGraph, Vercel AI SDK, OpenAI Agents SDK, ElizaOS.
GET /v1/check-agent/preview?id=&network= | free, 20/min per IP | verdict: verified, found, active, cardHashMatches, issues |
POST /mcp | free, 20/min per IP | remote MCP server, tool check_agent (verdict) |
GET /v1/check-agent?id=&network= | $0.005 USDC (x402, Base) | full record incl. owner, agent wallet, Agent Card URI |
GET /v1/stats | free | public usage counters |
What's in the repo:
- Library (
src/registry.js): checkAgent(badgeOrAccount, { network }), with pluggable providers.
- Express-style middleware (
src/middleware.js): agentGate(). Mount it before x402 paymentMiddleware.
- MCP server (
mcp/server.js): a check_agent tool for Claude, Cursor and other MCP clients.
- Static checker page (
docs/): a single HTML file you can open locally or host anywhere. live at https://agentgate-source.pages.dev/agentgate/demo/ (guide: https://youraitools.co/guides/x402-agent-verification)
- Paid x402 API (
service/): check_agent at $0.005 USDC per call on Base mainnet, using the official @x402/* packages and the PayAI facilitator, and listed in the x402 Bazaar (PayAI). Live: https://api.youraitools.co/agentgate/v1/check-agent?id=<badge or account>. See service/README.md.
- Tests and a runnable demo.
Status: v0.1, an MVP built for the Concordium Trusted Agents Hackathon (Encode Club). Independent project, not affiliated with Concordium.
Why
x402 lets any agent pay any API with no signup, which also means any anonymous script can call it. Concordium's Agent Registry ties each agent to an identity-verified owner account without putting personal data on-chain. AgentGate is the missing piece in between: one line of middleware that lets only agents with an accountable owner reach your paid routes. Unverified agents are rejected before they are asked to pay.
Quickstart
curl -LO https://agentgate-source.pages.dev/agentgate/agentgate.bundle && git clone agentgate.bundle agentgate && cd agentgate
npm install
npm test
npm run demo
npm run demo:live
npm run check -- Mf22soLh1NuZYFgBK8iSs
npm run check -- JyP9TtQC3HCNrTYR3sc2T --network testnet
Gate a route
import express from 'express';
import { agentGate } from 'concordium-agentgate';
const app = express();
app.get('/paid/quote',
agentGate({ network: 'testnet' }),
paymentMiddleware(),
(req, res) => res.json({ quote: '…', agent: req.agentGate.tokenAddress }));
Agents identify themselves with the X-Agent-Badge header. Its value is their badge, i.e. the CIS-2 token address such as Mf22soLh1NuZYFgBK8iSs. CAIP-19 form and a Concordium owner account are also accepted.
agentGate(options):
network | 'mainnet' | mainnet / testnet / devnet |
provider | cached ConcordiumPublicProvider (60 s TTL) | any object with check(id, {network}) |
header | X-Agent-Badge | request header carrying the badge |
requireCardMatch | true | require Agent Card hash == on-chain metadata_hash |
bindPayer | false | if an x402 PAYMENT-SIGNATURE is attached, require its payer to be the agent's on-chain agentWallet or owner |
failOpen | false | let traffic through if the registry is unreachable (default: fail closed, 503) |
policy | — | async (req, result) => boolean for extra rules |
On success, the verified record is available as req.agentGate, and an X-AgentGate: verified; … header is set.
MCP server
Remote (hosted, free tier): https://api.youraitools.co/agentgate/mcp (Streamable HTTP). Local (stdio, queries Concordium directly, full record):
{ "mcpServers": { "agentgate": { "command": "npx", "args": ["-y", "-p", "concordium-agentgate", "agentgate-mcp"] } } }
Or run it locally with node mcp/server.js (stdio). The server exposes one tool:
check_agent({ id, network }) returns VERIFIED / NOT VERIFIED plus the structured record.
Set AGENTGATE_MOCK=1 to use offline fixtures.
Static checker
Live at https://agentgate-source.pages.dev/agentgate/demo/ (or open docs/index.html locally). You can deep-link a check, e.g. ?id=Mf22soLh1NuZYFgBK8iSs&network=mainnet. The page queries Concordium's public endpoints directly from the browser (CORS is open), using the same registry.js as the library.
What is real and what is mocked
| Mainnet lookups | Real. Concordium's public, documented badge-check REST endpoint: GET https://agent-registry-mcp.concordium.com/v1/badge-check/{badge|account} (docs). It returns on-chain status plus the Agent Card hash check. |
| Testnet / devnet lookups | Real. Concordium's hosted Agent Registry MCP server (https://agent-registry-mcp.concordium.com/mcp, JSON-RPC tools agent_by_token_address, agents_by_owner, verify_agent_card; docs). Testnet registry contract <12802,0>, mainnet <10082,0>. |
MockProvider | Mock. In-memory fixtures (MockVerifiedAgent1111, MockRevokedAgent22222, MockTamperedCard33333). Every result has mock: true and source: 'mock'. Used for tests and the offline demo only. |
examples/mock-paywall.js | Mock. Speaks the x402 v2 header shapes (PAYMENT-REQUIRED / PAYMENT-SIGNATURE / PAYMENT-RESPONSE) but does not verify signatures or settle anything. No funds move. In production use the official x402 middleware and a real facilitator. |
| Badge ownership proof | Not yet. In v0.1 the badge header is a claim. bindPayer ties it to the x402 payer when the payer is the agent's Concordium wallet or owner. Cross-chain payer binding via CIS-8 external keys and signed badge challenges are on the roadmap. |
Tests use recorded real responses from the badge-check API (test/fixtures/). npm run test:live also hits the real endpoints.
Roadmap (toward the Dec 9, 2026 hackathon submission)
Development
npm test
npm run test:live
npm run sync-docs
Built by an AI builder agent (agentgate-builder) with human oversight.
Support
If AgentGate is useful to you, tips are welcome at 0x3c1A1E01e790Cd326495631B3b38Bd7068F08d6F (EVM: Ethereum, Base, and other EVM chains).
Agent trust kit
Five small x402 tools for agents that act on outside input. Same pay-per-call USDC on Base, free tiers, remote MCP:
| AgentGate | Is this AI agent who it says it is? Concordium Agent Registry (CIS-8004) check | $0.005 |
| WebRead | Any public web page as clean Markdown, robots.txt-aware, SSRF-safe | $0.002 |
| InjectScan | Scans text, pages and MCP tool definitions for prompt injection (repo) | $0.003 |
| DomainCheck | Is this domain or email real and trustworthy? DNS, SPF/DMARC, RDAP registration age, disposable and parked detection, 0-100 score (source) | $0.002 domain / $0.001 email |
| PayGuard | Is this crypto address on the US Treasury OFAC SDN list? Exact match with entity, programs and list date, plus chain and checksum (source) | $0.001 address / $0.01 batch of 50 |
Typical flow: verify the counterpart agent with AgentGate, check its domain or contact email with DomainCheck, read a page with WebRead, check it with InjectScan before following anything in it, and screen any wallet with PayGuard before paying it.
License
MIT