# ContextForge AI Gateway

> An open source AI gateway, registry, and proxy that federates MCP, A2A, and REST/gRPC APIs into a unified endpoint with centralized governance, discovery, and observability.

ContextForge is an open source AI gateway built by IBM that federates tools, agents, and APIs into one clean endpoint for AI clients. Published on PyPI as `mcp-contextforge-gateway` and available as an OCI container image, it is licensed under Apache 2.0 and actively maintained on GitHub with version v1.0.6 as of July 2026.

## What It Is

ContextForge sits in front of any Model Context Protocol (MCP) server, A2A server, or REST/gRPC API and exposes a single, unified interface with centralized discovery, guardrails, and management. It acts simultaneously as a **Tools Gateway** (MCP, REST, gRPC-to-MCP translation, TOON compression), an **Agent Gateway** (A2A protocol, OpenAI-compatible and Anthropic agent routing), and an **API Gateway** (rate limiting, auth, retries, reverse proxy). The project is fully compliant with the MCP specification and scales from a single Docker container to multi-cluster Kubernetes deployments backed by Redis.

## Architecture and Protocol Support

ContextForge is built on FastAPI with async SQLAlchemy ORM and Pydantic Settings, and exposes multiple transport options:

- **Transports**: HTTP, JSON-RPC, WebSocket, SSE (with configurable keepalive), stdio, and streamable HTTP
- **Protocol translation**: gRPC-to-MCP via automatic reflection-based service discovery; REST-to-MCP tool adapter with automatic JSON Schema extraction
- **Virtualization**: Wraps non-MCP services as virtual MCP servers with minimal configuration
- **Unified registries**: Prompts (Jinja2 templates, multimodal, versioning), Resources (URI-based, MIME detection, caching), and Tools (native or adapted, with input validation)
- **Plugin framework**: 40+ plugins for additional transports, protocols, and integrations, with gRPC and Unix socket transport options for external plugins

The modular architecture is documented through 48+ Architecture Decision Records (ADRs) and is incrementally migrating toward a Rust MCP runtime sidecar model.

## Observability and Security

ContextForge ships vendor-agnostic OpenTelemetry tracing with zero overhead when disabled:

- **Backends**: Phoenix (LLM-focused), Jaeger, Zipkin, Tempo, DataDog, New Relic via OTLP
- **LLM-specific metrics**: Token usage, costs, model performance
- **Distributed tracing** across federated gateways
- **Auth**: Basic auth, JWT (with JTI revocation support), OAuth 2.0, OIDC/SSO (GitHub, Google, Microsoft Entra ID, Keycloak, Okta), RBAC, and Dynamic Client Registration
- **Security defaults**: `REQUIRE_JTI=true`, `REQUIRE_TOKEN_EXPIRATION=true`, `PUBLIC_REGISTRATION_ENABLED=false`; OWASP/DAST security testing included in the test suite

## Deployment Model

ContextForge supports a wide range of deployment targets:

- **Local**: PyPI install (`pip install mcp-contextforge-gateway`) or `uvx` one-liner
- **Container**: Docker or Podman single-container with SQLite; Docker Compose full stack with PostgreSQL, Redis, and Nginx
- **Kubernetes**: Helm charts with HPA auto-scaling, multi-replica deployments, and Redis clustering; OpenShift and Minikube guides included
- **Cloud**: AWS ECS/EKS, Azure AKS, Google Cloud Run, IBM Cloud Code Engine, Fly.io
- **Air-gapped**: Bundled JavaScript (HTMX + Alpine.js) with optional vendor library bundling for offline deployments

The Admin UI provides real-time management, log viewing with filtering and export, and configuration management.

## Agent Framework Integrations

The documentation lists explicit integration guides for major agent frameworks:

- LangChain, LangGraph, CrewAI, BeeAI, AutoGen, Semantic Kernel, OpenAI Agents SDK, LlamaIndex
- A2A (Agent-to-Agent) protocol for cross-agent communication
- MCP clients: Claude Desktop, GitHub Copilot, Cline (VS Code), Continue (VS Code), OpenWebUI, MCP CLI, MCP Inspector

## Update: v1.0.6

The latest release, v1.0.6 (published July 21, 2026), is titled "OAuth Token Exchange, Vault Credentials, MCP Apps, Dataplane Publishing, and Security Hardening." The project reached v1.0.0 general availability and has been actively releasing through the 1.0.x series. The GitHub repository shows 4,200+ stars and 796 forks. The roadmap includes a Rust MCP runtime sidecar and a modular architecture split into 14 independent modules. The test suite has grown to 7,000+ tests.

## Features
- MCP server federation and proxy
- A2A (Agent-to-Agent) protocol support
- gRPC-to-MCP translation via server reflection
- REST-to-MCP tool adapter with JSON Schema extraction
- Unified tool, prompt, and resource registries
- 40+ plugins for transports and integrations
- OpenTelemetry observability with multiple OTLP backends
- Admin UI with real-time log viewer
- JWT, OAuth 2.0, OIDC/SSO authentication
- RBAC and team management
- Rate limiting, retries, and reverse proxy
- Redis-backed caching and multi-cluster federation
- Docker, Kubernetes, and Helm deployment support
- Air-gapped deployment mode
- STDIO wrapper for MCP client compatibility
- Transport bridge (SSE, streamable HTTP, WebSocket, stdio)
- Prometheus metrics and health endpoints
- Dynamic Client Registration (DCR)
- Jinja2 prompt templates with versioning
- TOON compression for tool calling

## Integrations
LangChain, LangGraph, CrewAI, BeeAI, AutoGen, Semantic Kernel, OpenAI Agents SDK, LlamaIndex, Claude Desktop, GitHub Copilot, Cline, Continue, OpenWebUI, MCP Inspector, PostgreSQL, Redis, Prometheus, Jaeger, Zipkin, Phoenix, DataDog, New Relic, Langfuse, Keycloak, Okta, Microsoft Entra ID, Google OAuth, IBM Security Verify, Terraform, IBM Instana, Box, monday.com, GitHub MCP Server, Argo CD, Helm, Kubernetes, OpenShift, AWS ECS/EKS, Azure AKS, Google Cloud Run, IBM Cloud Code Engine, Fly.io

## Platforms
WINDOWS, MACOS, LINUX, WEB, API, VSC_EXTENSION, CLI

## Pricing
Open Source

## Version
v1.0.6

## Links
- Website: https://ibm.github.io/mcp-context-forge/
- Documentation: https://ibm.github.io/mcp-context-forge/latest/
- Repository: https://github.com/IBM/mcp-context-forge
- EveryDev.ai: https://www.everydev.ai/tools/contextforge-ai-gateway
