Get the FREE Ultimate OpenClaw Setup Guide →

mcp-gateway

MCP OAuth Proxy incl. dynamic client registration (DCR), MCP prompt analytics and MCP firewall to build enterprise grade MCP servers.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio hyprmcp-mcp-gateway docker run -i hyprmcp/mcp-gateway \
  --env PORT="8080" \
  --env LOG_LEVEL="info" \
  --env OAUTH_CLIENT_ID="OAuth client ID" \
  --env UPSTREAM_MCP_URL="URL of the upstream MCP server" \
  --env OAUTH_CLIENT_SECRET="OAuth client secret"

How to use

Hypr MCP Gateway provides an OAuth2-enabled gateway for MCP servers, adding dynamic client registration, single-sign-on flow, and prompt telemetry to MCP requests. It acts as a proxy between end-user MCP clients and your MCP backend, handling OAuth authorization and logging MCP requests for analytics and debugging. With dynamic client registration, you can onboard new clients without manual configuration and observe prompts and authorization states via the gateway’s telemetry features. Use the gateway to keep your MCP server lean while offloading authentication and telemetry concerns to this dedicated component.

To use it, deploy the gateway (via Docker in the provided configuration) and point your MCP upstream to the gateway URL. Configure the gateway’s environment variables to integrate with your OAuth provider and upstream MCP. Once running, clients will authenticate through the gateway, receive dynamic client registrations as needed, and MCP requests will be logged and instrumented for analytics.

How to install

Prerequisites:

  • Docker installed and running
  • Access to an OAuth 2.0 provider for client registration

Option 1: Run with Docker (recommended)

  1. Pull and run the gateway container using the provided configuration:
# If you’re using the default image name in mcp_config
docker run -i hyprmcp/mcp-gateway
  1. Ensure environment variables are configured (PORT, OAuth credentials, upstream MCP URL) as shown in mcp_config.

Option 2: Build from source (Go)

  1. Install Go (1.18+).
  2. Clone the repository and build:
git clone https://github.com/hyprmcp/mcp-gateway.git
cd mcp-gateway
go build ./...
  1. Run the binary with required flags or environment variables (port, OAuth config, upstream MCP URL).

Option 3: Docker compose (advanced)

  1. Create a docker-compose.yml that mirrors the docker run configuration with the necessary environment variables.
  2. Start with:
docker-compose up -d

Additional notes

Notes and tips:

  • Ensure your OAuth provider supports dynamic client registration if you rely on that feature.
  • The gateway logs MCP requests and payloads; consider adjusting log levels to balance observability with sensitivity of data.
  • If you encounter connection issues to the upstream MCP, verify UPSTREAM_MCP_URL is reachable from the gateway container.
  • Environment variables can be extended as needed; refer to the gateway’s docs for a complete list of supported options (e.g., enabling telemetry, configuring prompt analytics).
  • For local testing, the default PORT is 8080; expose or map this port as needed in your deployment environment.
  • When using Docker, make sure the container has network access to your OAuth provider and the upstream MCP server.

Related MCP Servers

Sponsor this space

Reach thousands of developers