Mcp Context Forge
An AI Gateway, registry, and proxy that sits in front of any MCP, A2A, or REST/gRPC APIs, exposing a unified endpoint with centralized discovery, guardrails and management. Optimizes Agent & Tool calling, and supports plugins.
Last verified:
What is Mcp Context Forge?
MCP Context Forge (ContextForge AI Gateway) is an open-source registry and proxy from IBM that federates Model Context Protocol (MCP) servers, Agent-to-Agent (A2A) services, and REST/gRPC APIs into a single unified endpoint for AI clients. It serves as a centralized control plane providing governance, discovery, and observability across your AI infrastructure, optimizing agent and tool calling while supporting plugin extensibility.
Key features include: a Tools Gateway supporting MCP, REST, and gRPC-to-MCP translation with TOON compression; an Agent Gateway for A2A protocol and OpenAI/Anthropic agent routing; an API Gateway with rate limiting, authentication, and retries; 40+ plugins for additional transports and integrations; and OpenTelemetry observability with Phoenix, Jaeger, Zipkin, and other OTLP backends. It also features an Admin UI built with HTMX + Alpine.js for real-time management, configuration, and log monitoring.
ContextForge is designed for developers building AI applications, organizations needing to expose legacy APIs as MCP-compliant tools for AI clients, teams managing multiple MCP servers who need centralized governance, and anyone requiring observability and debugging capabilities for AI agent tool calls. It works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.
Mcp Context Forge pricing
Pricing model: Freemium
MCP Context Forge is completely free and open-source under Apache License 2.0. There are no paid plans, subscriptions, or enterprise tiers. The tool is self-hosted and can be deployed via PyPI (pip install mcp-contextforge-gateway), Docker, Podman, Docker Compose, or Kubernetes Helm charts at no cost. All features including the Admin UI, A2A integration, gRPC-to-MCP translation, OpenTelemetry observability, and multi-tenancy are available in the free open-source version. Organizations only incur infrastructure costs for their own hosting (servers, Kubernetes clusters, cloud platforms like AWS ECS/EKS, Azure AKS, Google Cloud Run, or IBM Cloud Code Engine).
Mcp Context Forge pros
- Open-source under Apache License 2.0 with no licensing costs
- Federates MCP, REST, gRPC, and A2A services into one endpoint
- Supports 6+ transport protocols: HTTP, JSON-RPC, WebSocket, SSE, stdio, streamable-HTTP
- Built-in gRPC-to-MCP translation via automatic reflection-based service discovery
- Virtualizes legacy APIs as MCP-compliant tools with minimal configuration
- 40+ plugins for additional transports, protocols, and integrations
- OpenTelemetry observability with Phoenix, Jaeger, Zipkin, Tempo, DataDog, New Relic support
- Admin UI with real-time log viewer, filtering, search, and export capabilities
- Multi-tenancy support with email authentication, teams, and RBAC (v0.7.0+)
- Redis-backed caching and multi-cluster federation for Kubernetes scaling
- REST-to-MCP Tool Adapter with automatic JSON Schema extraction
- Built-in authentication: Basic auth, JWT tokens, OAuth, and SSO support
- Rate limiting, retries, and timeout policies configurable per tool
- Deployable via PyPI, Docker, Podman, Docker Compose, or Helm charts
- 400+ tests with Makefile targets, live reload, and pre-commit hooks
Mcp Context Forge cons
- ARM64 not supported in production (macOS M1/M2 must use Rosetta or PyPI)
- Requires Python 3.10 or newer (3.11 recommended)
- Configuration requires editing 300+ environment variables for full setup
- SQLite disk I/O errors can occur on macOS in iCloud-synced directories
- Port 4444 accessibility issues on WSL2 require Docker Desktop configuration
- JWT_SECRET_KEY and passwords must be manually changed before production
- No official Windows native build (requires PowerShell/WSL setup)
- Learning curve for understanding MCP protocol and gateway federation concepts
Frequently asked questions about Mcp Context Forge
What is MCP Context Forge used for?
MCP Context Forge is a gateway, registry, and proxy that sits in front of any Model Context Protocol (MCP) server, A2A server, or REST API, exposing a unified endpoint for all your AI clients. It federates multiple MCP servers, REST APIs, and Agent-to-Agent services into a single endpoint, facilitating discovery, authentication, rate-limiting, and observability for AI clients and coding agents. Use it to register remote MCP servers, expose tools and virtual servers, virtualize legacy APIs as MCP-compliant tools, and manage everything from a centralized admin UI or via programmatic endpoints.
How do I install ContextForge?
You can install ContextForge in multiple ways. Quick start with uv: copy .env.example to .env, customize settings, then run 'uvx --from mcp-contextforge-gateway mcpgateway --host 0.0.0.0 --port 4444'. For pip: create a virtual environment, run 'pip install mcp-contextforge-gateway', configure .env, then run 'mcpgateway --host 0.0.0.0 --port 4444'. For Docker: 'docker run -d --name mcpgateway -p 4444:4444 -e MCPGATEWAY_UI_ENABLED=true -e JWT_SECRET_KEY=my-test-key ghcr.io/ibm/mcp-context-forge:1.0.0-RC-2'. For full stack with PostgreSQL and Redis, use Docker Compose: 'git clone https://github.com/IBM/mcp-context-forge.git && cd mcp-context-forge && docker compose up -d'.
What MCP clients work with ContextForge?
ContextForge works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support. You can use the MCP Inspector (npx @modelcontextprotocol/inspector) for visual debugging and testing. For clients that only support stdio transport, use the mcpgateway.wrapper which exposes the gateway over stdio while maintaining JWT authentication. Configure your MCP client's JSON config with the wrapper command and environment variables MCP_AUTH (Bearer token) and MCP_SERVER_URL (gateway endpoint).
What observability backends does ContextForge support?
ContextForge supports OpenTelemetry (OTLP) protocol with vendor-agnostic tracing. Multiple backend support includes Phoenix (LLM-focused), Jaeger, Zipkin, Tempo, DataDog, and New Relic. It provides distributed tracing across federated gateways and services, automatic instrumentation of tools/prompts/resources/gateway operations, and LLM-specific metrics including token usage, costs, and model performance. To enable with Phoenix: start Phoenix with 'docker run -p 6006:6006 -p 4317:4317 arizephoenix/phoenix:latest', then set OTEL_ENABLE_OBSERVABILITY=true, OTEL_TRACES_EXPORTER=otlp, OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317 before running the gateway.
What authentication methods does ContextForge support?
ContextForge supports multiple authentication methods: Basic auth (BASIC_AUTH_USER/BASIC_AUTH_PASSWORD for Admin UI login), JWT tokens (JWT_SECRET_KEY for signing API access tokens), user-scoped OAuth tokens, and SSO (Single Sign-On). API authentication uses Bearer tokens generated via 'python3 -m mcpgateway.utils.create_jwt_token --username [email protected] --exp 10080 --secret my-test-key'. The gateway also supports unconditional X-Upstream-Authorization header support for upstream services. Multi-tenancy (v0.7.0+) adds email authentication, teams, and RBAC with configurable resource visibility.
How do I upgrade ContextForge safely?
Before upgrading, backup your data: 'cp mcp.db mcp.db.backup.$(date +%Y%m%d_%H%M%S)' for SQLite, export configuration via Admin UI or API. Review release notes for breaking changes and migration guides (especially MIGRATION-0.7.0.md for multi-tenancy migration). Update .env by copying .env.example and configuring required settings. Database schema updates happen automatically via 'python3 -m mcpgateway.bootstrap_db'. Verify migration with the verification script. Test in staging first with your test suite and user acceptance testing. If migration fails, restore from backup and retry.
Can I deploy ContextForge in an airgapped environment?
Yes, ContextForge supports airgapped deployment (no internet access). Build an airgapped image with 'docker build -f Containerfile.lite -t mcpgateway:airgapped .', then run 'docker run -d --name mcpgateway -p 4444:4444 -e MCPGATEWAY_UI_AIRGAPPED=true -e MCPGATEWAY_UI_ENABLED=true -e HOST=0.0.0.0 -e JWT_SECRET_KEY=my-test-key mcpgateway:airgapped'. Set MCPGATEWAY_UI_AIRGAPPED=true to enable airgapped mode. For persistent storage, mount a volume: '-v $(pwd)/data:/data -e DATABASE_URL=sqlite:////data/mcp.db'.