Get the FREE Ultimate OpenClaw Setup Guide →

mcp-gateway

Model Context Protocol (MCP) Gateway & Registry - Central hub for managing tools, resources, and prompts for MCP-compatible LLMs. Translates REST APIs into MCP, builds virtual MCP servers with security and observability, and bridges multiple transports (stdio, SSE, streamable HTTP).

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio theognis1002-mcp-gateway docker compose up --build \
  --env ENV_FILE="Path to environment file (e.g., .env) used by Docker Compose" \
  --env DOCKER_HOST="Docker daemon host (optional; typically not needed locally)"

How to use

The MCP Gateway acts as a production-ready API gateway for Model Context Protocol (MCP) servers. It provides authentication, RBAC, rate limiting, server discovery, and multi-protocol transport support (JSON-RPC over HTTP, WebSocket, Server-Sent Events, and more) to securely expose MCP servers to clients. Use the gateway to register and route traffic to MCP backends within a namespace-aware architecture, benefiting from centralized logging, auditing, and policy enforcement. The setup emphasizes a docker-compose based deployment that runs the gateway together with required services (datastore, cache, and auxiliary components) so you can start in a single command and scale as needed.

Once running, you can interact with the gateway’s REST APIs for namespace discovery and server inventory, or connect through supported protocols to MCP backends. The system includes an admin interface for user management, API keys, and RBAC policies, which helps you enforce access controls across clients and services. Typical workflows involve wiring MCP servers behind the gateway, applying security policies, and observing traffic through built-in logging and metrics.

How to install

Prerequisites:

  • Git
  • Docker Desktop (or Docker Engine with Docker Compose)
  • Make (optional but recommended as per repository)
  • Go (for building or contributing, not strictly required for containerized usage)

Step-by-step:

  1. Clone the repository
git clone https://github.com/mcp-gateway/mcp-gateway.git
cd mcp-gateway
  1. Copy environment example if using local env files (as suggested in Quick Start)
cp .env.example .env
  1. Start the stack via Docker Compose (as recommended for quick start)
docker compose up --build
  1. Alternatively, use the Makefile to automatically detect and run the appropriate setup
make setup
  1. Access the application endpoints after startup:

Notes:

  • Ensure Docker daemon is running and you have sufficient permissions to run containers.
  • If you modify environment variables, rebuild with the appropriate command (e.g., docker compose up --build).

Additional notes

Tips and common issues:

  • Ports 8080, 3000, 5432 (PostgreSQL), and 6379 (Redis) may conflict with other services; stop other apps using these ports or change the gateway configuration accordingly.
  • If the Makefile chooses between docker-compose v1 and v2, use make help to determine which command it will run.
  • For production deployments, consider persisting data volumes and configuring external secrets management for sensitive values.
  • When troubleshooting, view logs with make logs or docker compose logs to identify startup or runtime errors.
  • The gateway supports authentication (e.g., JWT/OIDC) and RBAC; ensure proper policies are defined for your MCP backends to prevent unauthorized access.

Related MCP Servers

Sponsor this space

Reach thousands of developers