Docs/Quickstart
Quickstart

Register your first MCP server

ModGate sits in front of your existing MCP server and enforces OAuth 2.1 automatically. You keep hosting your server wherever it is — no code changes required.

Time to complete
~15 minutes
Prerequisites
A running MCP server with a public HTTPS URL
1

Create a free ModGate account

Go to app.modgate.io/sign-up and create an account. The Free plan includes 500 agent authentications per month — no credit card required.

2

Register your MCP server

In your dashboard, go to MCP Servers → Register server. Enter a name and the HTTPS URL of your MCP server endpoint.

Your MCP server must be reachable over HTTPS. Localhost and HTTP endpoints are supported for development only.

ModGate will save your server and assign it a unique server ID (e.g. srv_abc123). You'll use this to route agent traffic.

3

Point your MCP client at the ModGate proxy

Instead of having AI agents connect directly to your MCP server, point them at your ModGate proxy URL:

# Direct connection (before ModGate)
https://your-mcp-server.workers.dev/mcp

# Through ModGate proxy (after)
https://api.modgate.io/mcp/{tenantId}/{serverId}

Your tenantId and serverId are visible in your dashboard on the server detail page.

4

Discover the OAuth 2.1 endpoints

Any compliant MCP client (Claude Desktop, custom agents) will auto-discover ModGate's auth endpoints via the standard /.well-known endpoint:

curl https://api.modgate.io/.well-known/oauth-authorization-server

This returns the full OAuth 2.1 server metadata including:

  • authorization_endpoint — where agents initiate auth
  • token_endpoint — where agents exchange codes for tokens
  • registration_endpoint — Dynamic Client Registration
5

Test with your first agent

Send a request to your ModGate proxy URL without a token to confirm the gate is enforcing auth:

curl https://api.modgate.io/mcp/{tenantId}/{serverId}/tools/list

# Expected response:
# HTTP 401 Unauthorized
# {"error":"unauthorized","error_description":"Bearer token required."}

Now register a client and complete the OAuth 2.1 flow. See the OAuth 2.1 setup guide for the full flow, or use an existing MCP client that supports OAuth — it will handle registration and auth automatically.

Claude Desktop and other MCP clients that implement the MCP 2025-11-05 spec or later handle OAuth 2.1 with PKCE automatically. Point them at your ModGate proxy URL and they'll negotiate auth on first connection.
6

Check the audit log

After a successful authentication, go to Audit Log in your dashboard. You'll see the event logged with agent identity, tool name, timestamp, and outcome.

Every tool call, token issuance, and access decision is logged automatically — no additional configuration required.