LABSCO SUMMARY
Refuses to start without its secrets, which tells you what kind of software this is.
Most gateways will happily boot with a default signing key; this one fails instead, and ships with public registration off and token expiry required. That posture is the point — it is aimed at an organization putting many teams' MCP servers behind one governed door. The virtualization layer is what makes it more than a proxy: a REST or gRPC service that nobody is going to rewrite becomes an MCP server with schemas, retries and rate limits attached.
What it is
IBM's ContextForge: an open-source registry and proxy that puts any MCP server, A2A agent, REST API or gRPC service behind a single MCP-compliant interface, with central governance over what clients can reach.
What you get
- Federation across many MCP servers and REST services, exposed through one unified interface, with the MCP protocol version pinnable per deployment
- Legacy APIs virtualized as MCP servers: REST endpoints adapted into tools with JSON Schema extracted automatically, and gRPC services discovered through server reflection
- Retry, timeout and rate-limit policies applied per adapted tool, along with header and token handling
- Unified registries for tools, prompts and resources — Jinja2 prompt templates with versioning and rollback, URI-based resources with MIME detection, caching and SSE updates, and input validation and concurrency controls on tools
- Transport flexibility: HTTP, JSON-RPC, WebSocket, SSE with configurable keepalive, stdio and streamable HTTP
- Built-in authentication with user-scoped OAuth tokens and an upstream authorization header, plus basic, JWT and custom schemes
- An admin UI with real-time configuration and a log viewer that filters, searches and exports, usable in airgapped deployments
- OpenTelemetry tracing and metrics to Phoenix, Jaeger, Zipkin, Tempo, DataDog or New Relic, including token usage and cost per model, and no overhead when disabled
- Deployment paths that scale with you: PyPI, Docker, Podman, Docker Compose or Helm, with Redis-backed caching and multi-cluster federation
Requirements
Python 3.11 or newer, installed from PyPI as mcp-contextforge-gateway or run from a container image. Two secrets are mandatory in every environment including local development — JWT_SECRET_KEY and AUTH_ENCRYPTION_SECRET — and the gateway refuses to start without them; a script generates both. Set the bootstrap admin password and the basic-auth password before first run, since neither has a usable default. Content size limits apply to new writes: resources are capped at 100KB and prompt templates at 10KB by default. Public self-registration is off, and token expiry and JTI claims are required, unless you deliberately relax them.
Setup effort
Follow the published steps — mkdir mcpgateway && cd mcpgateway
USE CASES
01
Giving one team's agents access to servers another team runs
Register them in the gateway and let clients connect to one governed endpoint instead of each server directly.
02
Making an internal REST API usable by an agent
Adapt it into tools with schemas extracted automatically, and attach retry and rate-limit policies at the same time.
03
Bringing a gRPC service into the same interface
Let reflection discover the methods rather than hand-writing a wrapper for each one.
04
Finding out what your agents are actually spending
Send traces and metrics to your OTLP backend and read token usage and cost per model alongside the calls.
05
Managing prompts as shared assets rather than copies
Keep them in the registry as templates with versions, and roll back when a change makes things worse.
06
Running a gateway where the network is closed
Deploy it airgapped and use the bundled admin UI and log viewer for day-to-day operation.
BEFORE YOU INSTALL
What to know first
Requires
- Python ≥ 3.11
- JWT_SECRET_KEY and AUTH_ENCRYPTION_SECRET — the gateway will not start without them; init_secrets generates them
- A bearer token (MCPGATEWAY_BEARER_TOKEN) for the wrapper's MCP_AUTH
Where it runs
The documented client runs the server on your machine.
INSTALLATION
Connect your client
Server setup
TERMINAL
mkdir mcpgateway && cd mcpgateway
python3 -m venv .venv && source .venv/bin/activate
pip install mcp-contextforge-gateway
curl -O https://raw.githubusercontent.com/IBM/mcp-context-forge/main/.env.example
cp .env.example .env
python3 -m mcpgateway.scripts.init_secrets --patch-env .env
mcpgateway --host 0.0.0.0 --port 4444 &Generate a bearer token for the gateway: export JWT_SECRET_KEY=$(grep '^JWT_SECRET_KEY=' .env | cut -d= -f2) then export MCPGATEWAY_BEARER_TOKEN=$(python3 -m mcpgateway.utils.create_jwt_token --username <YOUR_USERNAME> --exp 10080 --secret "$JWT_SECRET_KEY")
Register the MCP servers you want to federate and bundle their tools into a virtual server (README section "Quick Start - PyPI", steps 2–5: POST /gateways, then POST /servers with associatedTools); note the virtual server's UUID
Add the mcpgateway-wrapper entry to your client, with MCP_AUTH set to "Bearer " plus your MCPGATEWAY_BEARER_TOKEN and MCP_SERVER_URL set to http://localhost:4444/servers/<YOUR_VIRTUAL_SERVER_UUID>/mcp
MCP Clients
Claude Desktop
CLAUDE DESKTOP · JSON
{
"mcpServers": {
"mcpgateway-wrapper": {
"command": "python",
"args": [
"-m",
"mcpgateway.wrapper"
],
"env": {
"MCP_AUTH": "Bearer <YOUR_TOKEN>",
"MCP_SERVER_URL": "http://localhost:4444/servers/<YOUR_UUID_OF_SERVER_1>/mcp",
"MCP_TOOL_CALL_TIMEOUT": "120"
}
}
}
}<YOUR_TOKEN> is the MCPGATEWAY_BEARER_TOKEN you generated, and <YOUR_UUID_OF_SERVER_1> is your virtual server's UUID. Use the python from the .venv you installed into (its full path) if python is not that interpreter.