AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
MCP verified MIT Self-run

Mcp Gate

mcp-c-premus-mcp-gate · by c-premus

OAuth 2.1 reverse proxy for MCP servers — RFC 9728 metadata + JWT validation

No reviews yet
0 installs
40 views
0.0% view→install

Install

$ agentstack add mcp-c-premus-mcp-gate

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access Used
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/mcp-c-premus-mcp-gate)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
2mo ago

Declared compatibility

Claude CodeClaude DesktopCursorWindsurf

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Mcp Gate? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

mcp-gate

[](https://github.com/c-premus/mcp-gate/actions/workflows/ci.yaml) [](https://go.dev/) [](LICENSE)

OAuth 2.1 reverse proxy for MCP servers. Implements RFC 9728 Protected Resource Metadata and JWT validation, delegating authentication to an external authorization server.

Read the blog post: I couldn't find an OAuth 2.1 proxy for MCP servers, so I built one

What it does

mcp-gate sits in front of any MCP server and adds the MCP Authorization specification (2025-11-25) endpoints required by Claude.ai custom connectors:

  1. /.well-known/oauth-protected-resource — Serves RFC 9728 metadata pointing clients to the authorization server
  2. /healthz — Health check for container orchestration
  3. /* — Validates Bearer JWT tokens via JWKS, then reverse-proxies to the upstream MCP server

Every request is logged as structured JSON (method, path, status, duration_ms, client_ip, user_agent) for Loki/Alloy ingestion.

Architecture

Claude.ai → Reverse Proxy → mcp-gate (JWT validation) → MCP Server → Backend
                                 ↕
                         Authorization Server (OAuth 2.1 / OIDC)

Quick Start

export LISTEN_ADDR=0.0.0.0:8080
export UPSTREAM_URL=http://mcp-server:8000
export RESOURCE_URI=https://mcp.example.com
export AUTHORIZATION_SERVER=https://auth.example.com/application/o/mcp/
export JWKS_URI=https://auth.example.com/application/o/mcp/jwks/
export EXPECTED_ISSUER=https://auth.example.com/application/o/mcp/
export EXPECTED_AUDIENCE=your-client-id

go run ./cmd/mcp-gate

Docker

docker pull cpremus/mcp-gate:latest

Images are published to Docker Hub and GHCR on each release. Available tags: latest, version (e.g. v1.2.0).

Setup

See the Setup Guide for step-by-step instructions on:

  1. Creating an OAuth client in your OIDC provider (Keycloak, Authentik, Okta, Auth0, etc.)
  2. Configuring mcp-gate
  3. Connecting Claude.ai to the protected MCP server

Configuration

All configuration is via environment variables. See the Setup Guide for the full list.

Horizontal scaling

mcp-gate validates JWTs statelessly and is safe to run as multiple replicas behind a load balancer. The per-IP rate limiter defaults to in-memory state, which means the configured RPS holds per replica. Set REDIS_ADDR=host:port to back the limiter with Redis so the configured RPS is enforced globally across replicas. REDIS_USERNAME, REDIS_PASSWORD, and REDIS_DB are read separately so Vault can inject a password as a single secret. Redis errors fail open (the request passes through and a counter is incremented) so a Redis hiccup never blackholes user traffic.

License

MIT

Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.