|
1 | 1 | # MCP Gateway
|
2 | 2 |
|
3 |
| -[](https://github.com/IBM/mcp-context-forge/actions/workflows/codeql.yml) [](https://github.com/IBM/mcp-context-forge/actions/workflows/bandit.yml) [](https://github.com/IBM/mcp-context-forge/actions/workflows/python-package.yml) [](https://github.com/IBM/mcp-context-forge/actions/workflows/docker-image.yml) [](https://github.com/IBM/mcp-context-forge/actions/workflows/dependency-review.yml) [](https://github.com/IBM/mcp-context-forge/actions/workflows/ibm-cloud-code-engine.yml) [](LICENSE) [](https://pypi.org/project/mcp-contextforge-gateway/) |
| 3 | +> Model Context Protocol gateway & proxy - unify REST, MCP and A2A with federation, virtual servers, retries, security and an optional admin UI. |
4 | 4 |
|
5 |
| -A flexible feature-rich FastAPI-based gateway for the Model Context Protocol (MCP) that unifies and federates tools, resources, prompts, servers and peer gateways, wraps any REST API as MCP-compliant tools or virtual servers, and exposes everything over HTTP/JSON-RPC, WebSocket, Server-Sent Events (SSE) and stdio transports—all manageable via a rich, interactive Admin UI and packaged as a container with support for any SQLAlchemy supported database. |
| 5 | +[](https://github.com/IBM/mcp-context-forge/actions/workflows/codeql.yml) |
| 6 | +[](https://github.com/IBM/mcp-context-forge/actions/workflows/bandit.yml) |
| 7 | +[](https://github.com/IBM/mcp-context-forge/actions/workflows/dependency-review.yml) |
| 8 | +[](https://github.com/IBM/mcp-context-forge/actions/workflows/python-package.yml) |
| 9 | +[](https://github.com/IBM/mcp-context-forge/actions/workflows/docker-image.yml) |
| 10 | +[](https://github.com/IBM/mcp-context-forge/actions/workflows/ibm-cloud-code-engine.yml) |
| 11 | + |
| 12 | +[](LICENSE) |
| 13 | +[](https://pypi.org/project/mcp-contextforge-gateway/) |
| 14 | +[](https://pepy.tech/projects/mcp-contextforge-gateway)<br/> |
| 15 | + |
| 16 | +ContextForge MCP Gateway is a feature-rich gateway & proxy that federates MCP and REST services - unifying discovery, auth, rate-limiting, observability, virtual servers, multi-transport protocols, and an optional live Admin UI into one clean endpoint for your AI clients. It runs as a fully compliant MCP server, deployable via PyPI or Docker, and scales to multi-cluster environments on Kubernetes with Redis-backed federation and caching. |
6 | 17 |
|
7 | 18 | 
|
8 | 19 | ---
|
9 | 20 |
|
10 |
| -## Overview & Goals |
| 21 | +## 🚀 Overview & Goals |
11 | 22 |
|
12 |
| -MCP Gateway builds on the MCP spec by sitting **in front of** MCP Server or REST API to: |
| 23 | +**ContextForge MCP Gateway** is a production-grade gateway, registry, and proxy that sits in front of any [Model Context Protocol](https://modelcontextprotocol.io) (MCP) server or REST API—exposing a unified endpoint for all your AI clients. |
13 | 24 |
|
14 |
| -* **Act as a true gateway**, centralizing tool, resource and prompt registries while preserving the official MCP 2025-03-26 protocol |
15 |
| -* **Federate** multiple MCP servers into one unified endpoint—auto-discover peers (mDNS or explicit), health-check them, and merge their capabilities |
16 |
| -* **Virtualize** non-MCP services as "virtual servers" so you can register any REST API or function endpoint and expose it under MCP semantics |
17 |
| -* **Adapt** arbitrary REST/HTTP APIs into MCP tools with JSON-Schema input validation, retry/rate-limit policies and transparent JSON-RPC invocation |
18 |
| -* **Simplify** deployments with a full admin UI, rich transports, pre-built DX pipelines and production-grade observability |
| 25 | +It supports: |
19 | 26 |
|
20 |
| - |
| 27 | +* Federation across multiple MCP and REST services |
| 28 | +* Virtualization of legacy APIs as MCP-compliant tools and servers |
| 29 | +* Transport over HTTP, JSON-RPC, WebSocket, SSE, and stdio |
| 30 | +* A live Admin UI for real-time management and configuration |
| 31 | +* Built-in auth, observability, retries, and rate-limiting |
| 32 | +* Scalable deployments via Docker or PyPI, Redis-backed caching, and multi-cluster federation |
| 33 | + |
| 34 | + |
21 | 35 |
|
22 | 36 | ---
|
23 | 37 |
|
24 |
| -## Features |
| 38 | +<details> |
| 39 | +<summary><strong>🔌 Gateway Layer with Protocol Flexibility</strong></summary> |
| 40 | + |
| 41 | +* Sits in front of any MCP server or REST API |
| 42 | +* Lets you choose your MCP protocol version (e.g., `2025-03-26`) |
| 43 | +* Exposes a single, unified interface for diverse backends |
| 44 | + |
| 45 | +</details> |
| 46 | + |
| 47 | +<details> |
| 48 | +<summary><strong>🌐 Federation of Peer Gateways</strong></summary> |
| 49 | + |
| 50 | +* Auto-discovers or configures peer gateways (via mDNS or manual) |
| 51 | +* Performs health checks and merges remote registries transparently |
| 52 | +* Supports Redis-backed syncing and fail-over |
| 53 | + |
| 54 | +</details> |
| 55 | + |
| 56 | +<details> |
| 57 | +<summary><strong>🧩 Virtualization of REST/gRPC Services</strong></summary> |
| 58 | + |
| 59 | +* Wraps non-MCP services as virtual MCP servers |
| 60 | +* Registers tools, prompts, and resources with minimal configuration |
25 | 61 |
|
26 |
| -### Core |
| 62 | +</details> |
| 63 | + |
| 64 | +<details> |
| 65 | +<summary><strong>🔁 REST-to-MCP Tool Adapter</strong></summary> |
| 66 | + |
| 67 | +* Adapts REST APIs into tools with: |
27 | 68 |
|
28 |
| -* **Full MCP 2025-03-26**: initialize, ping, notify, completion, sampling (SSE), plus JSON-RPC fallback |
29 |
| -* **Gateway Layer**: sits alongside or in front of MCP servers, enforcing MCP rules and consolidating multiple backends |
30 |
| -* **Multi-Transport**: HTTP/JSON-RPC, WebSocket (ping/pong), SSE (one-way + backchannel), stdio |
31 |
| -* **Federation**: |
| 69 | + * Automatic JSON Schema extraction |
| 70 | + * Support for headers, tokens, and custom auth |
| 71 | + * Retry, timeout, and rate-limit policies |
32 | 72 |
|
33 |
| - * Auto-discover or configure peer gateways |
34 |
| - * Periodic health checks with fail-over |
35 |
| - * Transparent merging of remote registries into one catalog |
36 |
| -* **Virtual Servers**: wrap any non-MCP endpoint (REST, gRPC, function) as a managed MCP server with minimal config |
37 |
| -* **REST-to-MCP Adapter**: register any REST API as an MCP tool—automatic schema extraction, auth headers, retry/rate limits |
38 |
| -* **Resources**: templated URIs, LRU+TTL caching, MIME detection, real-time SSE subscriptions |
39 |
| -* **Prompts**: Jinja2 templates, JSON-Schema enforcement, multimodal blocks, versioning & rollback |
40 |
| -* **Tools**: MCP-native or REST-based; input validation, retry logic, rate-limit/concurrency controls |
| 73 | +</details> |
| 74 | + |
| 75 | +<details> |
| 76 | +<summary><strong>🧠 Unified Registries</strong></summary> |
41 | 77 |
|
42 |
| -### Extras |
| 78 | +* **Prompts**: Jinja2 templates, multimodal support, rollback/versioning |
| 79 | +* **Resources**: URI-based access, MIME detection, caching, SSE updates |
| 80 | +* **Tools**: Native or adapted, with input validation and concurrency controls |
43 | 81 |
|
44 |
| -* **Admin UI** (HTMX + Alpine.js + Tailwind): full CRUD for servers, tools, resources, prompts, gateways, roots & metrics |
45 |
| -* **Authentication & Authorization**: Basic, JWT Bearer, custom header schemes, per-endpoint DI |
46 |
| -* **Persistence & Migrations**: async SQLAlchemy ORM (SQLite, Postgres, MySQL, etc.), Alembic auto-migrations |
47 |
| -* **Event System**: uniform event envelopes on WS/SSE fan-out, server-side filters, backchannel hooks |
48 |
| -* **Observability & Health**: structured JSON logs, `/health` latency metrics decorator on every handler |
49 |
| -* **Developer Experience**: Makefile targets, pre-commit (`ruff`, `black`, `mypy`, `isort`), live-reload, 400+ tests, CI badges |
| 82 | +</details> |
| 83 | + |
| 84 | +<details> |
| 85 | +<summary><strong>📈 Admin UI, Observability & Dev Experience</strong></summary> |
| 86 | + |
| 87 | +* Live Admin UI built with HTMX + Alpine.js |
| 88 | +* Auth: Basic, JWT, or custom schemes |
| 89 | +* Structured logs, health endpoints, metrics |
| 90 | +* 400+ tests, Makefile targets, live reload, pre-commit hooks |
| 91 | + |
| 92 | +</details> |
50 | 93 |
|
51 | 94 | ---
|
52 | 95 |
|
@@ -1700,7 +1743,3 @@ Special thanks to our contributors for helping us improve ContextForge MCP Gatew
|
1700 | 1743 | [](https://github.com/ibm/mcp-context-forge/network/members)
|
1701 | 1744 |
|
1702 | 1745 | <!-- [](https://github.com/ibm/mcp-context-forge/issues) -->
|
1703 |
| -
|
1704 |
| -**PyPi Downloads:** |
1705 |
| -
|
1706 |
| -[](https://pypi.org/project/mcp-contextforge-gateway/) [](https://pepy.tech/project/mcp-contextforge-gateway) |
|
0 commit comments