← Docs

Set up the gateway

AgentDNS is a unified MCP gateway. Install once, configure once. Your agent gets access to 25+ services through one MCP server, billed through one card.

The gateway is the only MCP server you need. It handles discovery, auth, and billing across every service. No per-service plugin. No per-service API key. Your agent only sees the services you've enabled — no context bloat from 242 unused tools.

1

Install

npm install -g agent-gateway-mcp
2

Configure

Run the config command. It opens a local web page in your browser.

agent-gateway config

In the page you will:

  • Sign in with Google. This links your gateway to your AgentDNS account.
  • Add a card. Required only for paid services. Free services work without a payment method.
  • Toggle services on / off. For OAuth services (Gmail, GitHub, Notion...) one click runs the OAuth flow. For BYO API key services, paste your key following the per-service setup guide.
  • Set spending caps. Optional per-service monthly cap, e.g. "max $10 / month on OpenAI".
3

Wire it into your MCP client

Add the gateway to your client's MCP server config.

Claude Code
claude mcp add gateway -- agent-gateway-mcp
Claude Desktop, Cursor, Windsurf, Zed
{
  "mcpServers": {
    "gateway": {
      "command": "agent-gateway-mcp"
    }
  }
}
4

Test it

Restart your MCP client and ask your agent something.

Example session
User: "Send an email to alice@example.com about tomorrow's meeting"

Agent → discover({ query: "send email" })
Gateway returns: gmail (enabled), slack (enabled)

Agent → call({
  domain: "gmail.googleapis.com",
  capability: "users_messages_send",
  params: { to: "alice@example.com", subject: "...", body: "..." }
})

Gateway calls Gmail with your OAuth token. Records usage.

Agent: "Done — email sent."

What the agent sees

The gateway exposes three tools. Your agent uses these — it never touches credentials directly.

discoverBrowse and search the catalog. By default returns only the services you've enabled. Pass browse_catalog=true to search the full 242-service catalog (results are marked as not enabled and cannot be called until you enable them).
callExecute a capability. Auth is handled automatically: OAuth tokens refresh transparently, API keys inject from your enablement, usage is metered. Calling a non-enabled service returns a clear error asking the user to enable it.
list_connectionsShow what's enabled, what's connected (auth done), and which services still need setup.

Empty state

If you haven't enabled any services yet, every discover call returns:

No services enabled yet. Run agent-gateway config in a terminal to sign in, add a payment method, and toggle services on.

Pricing & billing

Pay-per-use. No subscriptions. We act as the merchant for every paid service in v1 — you pay us, we pay providers.

  • Free services are free. Things like OpenWeatherMap free tier, Gmail (under your own quota), etc. — no card needed.
  • Paid services are passthrough + ~15% markup. You pay slightly above provider cost. No bundled monthly fees.
  • Monthly invoice via Stripe. One charge per month covering everything you used. View line-by-line history in the Stripe customer portal.
  • Per-service spending caps. Set a hard monthly cap in agent-gateway config. When hit, the gateway refuses further calls to that service until next month.
  • Catalog-only services. For the ~217 services that aren't billable through us yet, you can still enable them with your own API key (BYO key) — we don't handle billing, you call your own provider account through the gateway.

By using the gateway you agree to our Acceptable Use Policy. See /aup.

Trust signals

Each service in the catalog has a trust level. The gateway prefers verified services in search results.

[VERIFIED] — Service hosts its own manifest, crawled periodically.

[COMMUNITY] — Manifest maintained by AgentDNS based on the service's public docs.

[UNVERIFIED] — Newly submitted, hidden from search by default.

More detail in trust levels.

Troubleshooting

The agent says "no services enabled".

Run agent-gateway config and toggle on at least one service.

How do I revoke access to a service?

Run agent-gateway config and toggle the service off. The gateway revokes its OAuth token (if applicable) and clears the BYO key. Any in-flight call fails cleanly with an "not enabled" error.

The agent wants to use a service I haven't enabled.

The gateway returns an error explaining the service is in the catalog but not enabled. The agent should tell you in conversation. Open agent-gateway config and enable it.

Where are my credentials stored?

Locally, in ~/.agent-gateway/. Cards are stored in Stripe (we never see them). OAuth tokens and BYO API keys live on your machine, not synced to any server.

Can I see month-to-date usage from the CLI?

The config page shows usage from this machine. Authoritative billing data lives in your account via the Stripe customer portal. Cross-machine in-CLI aggregation is planned for a later release.

Where do I get help?

Email support@agent-dns.dev.

Building your own agent framework?

You can hit the registry REST API directly to discover services and fetch capability details. See the API reference for endpoints. Note that authenticated endpoints (enablement, billing) require a registry JWT — issued from the same OAuth flow as agent-gateway config.