Install
$ agentstack add mcp-c-premus-mcp-gate ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo 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.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
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 →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:
/.well-known/oauth-protected-resource— Serves RFC 9728 metadata pointing clients to the authorization server/healthz— Health check for container orchestration/*— 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:
- Creating an OAuth client in your OIDC provider (Keycloak, Authentik, Okta, Auth0, etc.)
- Configuring mcp-gate
- 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.
- Author: c-premus
- Source: c-premus/mcp-gate
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.