ContextForge is an open source registry and proxy developed by IBM that federates Model Context Protocol (MCP) servers, Agent-to-Agent (A2A) services, and REST/gRPC APIs into a unified endpoint. Written in Python, it provides centralized governance, discovery, and observability for AI infrastructure while optimizing agent and tool calling through plugin extensibility. The project is distributed via PyPI as mcp-contextforge-gateway and available as Docker containers from GHCR, with deployment options ranging from local development to multi-cluster Kubernetes environments.
The gateway layer provides protocol flexibility by federating any MCP server or REST API while allowing users to select their MCP protocol version. It virtualizes non-MCP services as MCP-compliant servers through automatic service discovery and method introspection, with specific support for gRPC-to-MCP translation via server reflection protocol. A REST-to-MCP tool adapter wraps REST APIs into tools with automatic JSON Schema extraction, header and token support, and configurable retry, timeout, and rate-limit policies. The platform maintains unified registries for prompts using Jinja2 templates with multimodal support and versioning, resources with URI-based access and caching, and tools with input validation and concurrency controls.
The Admin UI, built with HTMX 2.0.3 and Alpine.js, provides real-time log viewing with filtering and search capabilities. Authentication options include Basic, JWT, and custom schemes. OpenTelemetry observability enables vendor-agnostic distributed tracing across federated gateways with support for multiple backends including Phoenix, Jaeger, Zipkin, Tempo, DataDog, and New Relic. The platform includes automatic instrumentation of tools, prompts, resources, and gateway operations with LLM-specific metrics for token usage and cost tracking.
According to GitGenius activity data, the repository shows strong engagement with a median issue and pull request response latency of 0.0 hours and a mean latency of 12.9 hours across 2575 tracked items. The most active issue labels are bug with 899 occurrences, enhancement with 867, and python with 576. Primary contributors tracked by GitGenius include crivetimihai with 9202 events, jonpspri with 1160 events, and marekdano with 497 events. The repository shares overlapping contributors with berriai/litellm and mlflow/mlflow, indicating cross-project collaboration within the AI infrastructure ecosystem.
The platform supports multiple transport protocols including HTTP, JSON-RPC, WebSocket, Server-Sent Events with configurable keepalive, stdio, and streamable-HTTP. Built-in features include authentication middleware, rate limiting, automatic retries, and reverse proxy capabilities for REST services. The system scales through Redis-backed caching and federation, with support for user-scoped OAuth tokens and unconditional X-Upstream-Authorization header support. Deployment is supported via PyPI installation, Docker containers, Docker Compose for full stacks with PostgreSQL and Redis, and Helm charts for Kubernetes with enterprise-grade features. The repository includes comprehensive testing infrastructure with 7000+ tests, Makefile targets, live reload capabilities, and pre-commit hooks for development workflows.