You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[](https://github.com/IBM/mcp-context-forge/actions/workflows/ibm-cloud-code-engine.yml)
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.
23
+
24
+
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.
**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.
11
32
12
-
MCP Gateway builds on the MCP spec by sitting **in front of** MCP Server or REST API to:
33
+
It supports:
13
34
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
35
+
* Federation across multiple MCP and REST services
36
+
* Virtualization of legacy APIs as MCP-compliant tools and servers
37
+
* Transport over HTTP, JSON-RPC, WebSocket, SSE, and stdio
38
+
* A live Admin UI for real-time management and configuration
39
+
* Built-in auth, observability, retries, and rate-limiting
40
+
* Scalable deployments via Docker or PyPI, Redis-backed caching, and multi-cluster federation
@@ -1605,6 +1657,64 @@ devpi-web - Open devpi web interface
1605
1657
```
1606
1658
</details>
1607
1659
1660
+
## 🔍 Troubleshooting
1661
+
1662
+
<details>
1663
+
<summary><strong>Port publishing on WSL2 (rootless Podman & Docker Desktop)</strong></summary>
1664
+
1665
+
### Diagnose the listener
1666
+
1667
+
```bash
1668
+
# Inside your WSL distro
1669
+
ss -tlnp | grep 4444 # Use ss
1670
+
netstat -anp | grep 4444 # or netstat
1671
+
```
1672
+
1673
+
*Seeing `:::4444 LISTEN rootlessport` is normal* – the IPv6 wildcard
1674
+
socket (`::`) also accepts IPv4 traffic **when**
1675
+
`net.ipv6.bindv6only = 0` (default on Linux).
1676
+
1677
+
### Why localhost fails on Windows
1678
+
1679
+
WSL 2's NAT layer rewrites only the *IPv6* side of the dual-stack listener. From Windows, `http://127.0.0.1:4444` (or Docker Desktop's "localhost") therefore times-out.
1680
+
1681
+
#### Fix (Podman rootless)
1682
+
1683
+
```bash
1684
+
# Inside the WSL distro
1685
+
echo "wsl" | sudo tee /etc/containers/podman-machine
1686
+
systemctl --user restart podman.socket
1687
+
```
1688
+
1689
+
`ss` should now show `0.0.0.0:4444` instead of `:::4444`, and the
1690
+
service becomes reachable from Windows *and* the LAN.
1691
+
1692
+
#### Fix (Docker Desktop > 4.19)
1693
+
1694
+
Docker Desktop adds a "WSL integration" switch per-distro.
1695
+
Turn it **on** for your distro, restart Docker Desktop, then restart the
1696
+
container:
1697
+
1698
+
```bash
1699
+
docker restart mcpgateway
1700
+
```
1701
+
1702
+
</details>
1703
+
1704
+
<details>
1705
+
<summary><strong>Gateway starts but immediately exits ("Failed to read DATABASE_URL")</strong></summary>
1706
+
1707
+
Copy `.env.example` to `.env` first:
1708
+
1709
+
```bash
1710
+
cp .env.example .env
1711
+
```
1712
+
1713
+
Then edit `DATABASE_URL`, `JWT_SECRET_KEY`, `BASIC_AUTH_PASSWORD`, etc.
1714
+
Missing or empty required vars cause a fast-fail at startup.
1715
+
1716
+
</details>
1717
+
1608
1718
## Contributing
1609
1719
1610
1720
1. Fork the repo, create a feature branch.
@@ -1631,17 +1741,17 @@ Licensed under the **Apache License 2.0** – see [LICENSE](./LICENSE)
1631
1741
Special thanks to our contributors for helping us improve ContextForge MCP Gateway:
[](https://www.star-history.com/#ibm/mcp-context-forge&Date)
Copy file name to clipboardExpand all lines: docs/docs/architecture/roadmap.md
+74Lines changed: 74 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,80 @@
2
2
3
3
---
4
4
5
+
## 🌐 Federation & Routing
6
+
7
+
### 🧭 Epic: Streamable HTTP Transport (Protocol Revision 2025-03-26)
8
+
9
+
> **Note:** stdio and the legacy HTTP+SSE transports are already supported; this epic adds the new Streamable HTTP transport per the 2025-03-26 spec.
10
+
11
+
***HTTP POST Messaging**
12
+
**As** an MCP client
13
+
**I want** to send every JSON-RPC request, notification, or batch in a separate HTTP POST to the MCP endpoint, with `Accept: application/json, text/event-stream`
14
+
**So that** the server can choose between immediate JSON replies or initiating an SSE stream.
15
+
16
+
***SSE-Backed Streaming on POST**
17
+
**As** a developer
18
+
**I want** the server, upon receiving request-bearing POSTs, to return `Content-Type: text/event-stream` and open an SSE stream—emitting JSON-RPC responses, server-to-client requests, and notifications until complete—before closing the stream
19
+
**So that** clients can consume large or real-time payloads incrementally without buffering.
20
+
21
+
***Unsolicited Server Notifications via GET**
22
+
**As** a client
23
+
**I want** to open an SSE stream with a GET (using `Accept: text/event-stream`) to the same MCP endpoint
24
+
**So that** I can receive unsolicited server-to-client messages independently of POST calls.
25
+
26
+
***Session Management & Resumability**
27
+
**As** an operator
28
+
**I want** the server to issue a secure `Mcp-Session-Id` on Initialize, require it on subsequent calls (400 if missing), allow DELETE to terminate, and support SSE resumability via `Last-Event-ID` headers
29
+
**So that** clients can manage, resume, and explicitly end long-running sessions robustly.
30
+
31
+
***Security & Compatibility**
32
+
**As** a platform admin
33
+
**I want** to validate `Origin` headers, bind to localhost by default, and enforce authentication against DNS rebinding—while optionally preserving the legacy HTTP+SSE endpoints for backward compatibility with 2024-11-05 clients
34
+
**So that** we uphold security best practices and maintain dual-transport support.
35
+
36
+
---
37
+
38
+
## 🌐 Federation & Routing
39
+
40
+
### 🧭 Epic: A2A Transport Support
41
+
42
+
Enable full-duplex, application-to-application (A2A) integration so that virtual servers and gateways can speak A2A natively.
43
+
44
+
***A2A Gateway Registration**
45
+
**As** a platform admin
46
+
**I want** to register A2A-enabled servers as gateways (in addition to HTTP/SSE/WS)
47
+
**So that** I can federate A2A backends alongside standard MCP peers.
48
+
49
+
***A2A Tool Invocation**
50
+
**As** a developer
51
+
**I want** to call A2A servers as tools via the A2A protocol
52
+
**So that** A2A-native services appear in my tool catalog and handle messages over A2A transports.
53
+
54
+
***Expose Virtual Servers via A2A**
55
+
**As** an operator
56
+
**I want** to expose virtual servers (i.e. REST-wrapped MCP servers) over the A2A transport
57
+
**So that** clients that only support A2A can invoke those servers transparently.
58
+
59
+
---
60
+
61
+
## ⚙️ Lifecycle & Management
62
+
63
+
### 🧭 Epic: Virtual Server Protocol Version Selection
64
+
65
+
Allow choosing which MCP protocol version each virtual server uses.
66
+
67
+
***Per-Server Protocol Version**
68
+
**As** a platform admin
69
+
**I want** to specify the MCP protocol version (e.g. 2025-03-26 or earlier) on each virtual server
70
+
**So that** clients requiring legacy behavior can continue to work without affecting others.
71
+
72
+
***Protocol Compatibility Testing**
73
+
**As** a developer
74
+
**I want** to validate a virtual server's behavior against multiple protocol versions in the Admin UI
75
+
**So that** I can catch breaking changes before rolling out new servers.
76
+
77
+
---
78
+
5
79
## 🔐 Authentication & Identity
6
80
7
81
### 🧭 [#87 Epic: JWT Token Catalog with Per-User Expiry and Revocation](https://github.com/IBM/mcp-context-forge/issues/87)
0 commit comments