|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// *mcp_gateway_discover/about-mcp-gateway.adoc |
| 4 | + |
| 5 | +:_mod-docs-content-type: CONCEPT |
| 6 | +[id="con-mcp-gateway-arch-components_{context}"] |
| 7 | += {mcpg} architectural components |
| 8 | + |
| 9 | +[role="_abstract"] |
| 10 | +The MCP gateway architecture consists of three components that manage connectivity: the router, broker, and controller. |
| 11 | + |
| 12 | +MCP router:: |
| 13 | +The MCP router is an Envoy-focused `ext_proc` component that is capable of parsing the MCP protocol. When `ext_proc` parses the MCP Protocol, the router uses the protocol to set headers to force the correct routing of the request to the correct MCP server. |
| 14 | ++ |
| 15 | +The MCP router component is responsible for the following activities: |
| 16 | + |
| 17 | +* Parsing and validating the `JSON-RPC` request object, which is the MCP message body |
| 18 | +* Setting the key request headers, `:authority`, `:path`, `x-mcp-method`, `x-mcp-servername`, `x-mcp-toolname`, and `mcp-session-id` |
| 19 | +* Watching for `404` responses from MCP servers and invalidating the session store |
| 20 | +* Handling session initialization and storage on behalf of a requesting MCP client during a tools call request |
| 21 | +
|
| 22 | +MCP broker:: |
| 23 | +The MCP broker manages the complexity of connecting to multiple AI services simultaneously for you. The broker component aggregates multiple backend MCP servers and presents them as a unified MCP server to clients. This means that your MCP clients or applications do not have to manage a large set of MCP servers and configurations for each server. |
| 24 | ++ |
| 25 | +The MCP broker component is a backend service that acts as a default MCP server backend for the `/mcp` endpoint. For example, the broker does the following activities: |
| 26 | + |
| 27 | +* Handles the handshake, `init`. |
| 28 | +* Discovers tools from connected MCP servers and aggregates them into a unified list. Validates that discovered MCP servers meet minimum protocol version and capabilities before including their tools in the list. |
| 29 | +* Listens for updates and can change its state so that the agentic AI always has the latest information. |
| 30 | +* Handles notifications sent through whichever backend MCP server it is connected to, for example, `notifications/tools/list_changed`. |
| 31 | +* Handles notification requests from clients and MCP servers by proxying from the MCP server notification to registered clients. |
| 32 | +
|
| 33 | +MCP discovery controller:: |
| 34 | +The MCP discovery controller is a Kubernetes-based controller that watches for changes to custom resources (CRs). The MCP discovery controller uses CRs to configure the MCP gateway and register MCP servers. The CRs are then turned into a configuration that is consumed by the MCP gateway so that it can route and present the tools from the registered MCP server to the client. |
| 35 | ++ |
| 36 | +The MCP discovery controller component is responsible for the following activities: |
| 37 | + |
| 38 | +* Watching `MCPServerRegistration` CRs |
| 39 | +* Maintaining a configuration from both `HTTPRoute` and `MCPServerRegistration` CRs |
| 40 | +* Updating the MCP broker and MCP router config secret based on discovered `MCPServerRegistration` CRs and the `HTTPRoutes` they target |
| 41 | +* Reporting the status of `MCPServerRegistrations` CRs |
0 commit comments