Getting started Community Training Tutorials Documentation APIs, AI & Tools
Inject MCP Element Headers
Policy Name |
MCP Support |
Summary |
Adds MCP support to an Omni Gateway MCP server instance. This policy is required for your MCP server instance to function properly. |
Category |
MCP |
First Omni Gateway version available |
v1.9.3 |
Release Notes |
|
Returned Status Codes |
No return codes exist for this policy. |
| This policy supports Model Context Protocol (MCP) version 2025-06-18 and earlier. To learn more about MCP, see MCP Specification. |
The MCP Support Policy configures Omni Gateway to support MCP server instances. You must apply this policy to all MCP server instances for the instance to function properly. If you don’t apply this policy, Omni Gateway might throw a runtime error.
The MCP Support policy enables the Total MCP Calls metric that tracks the total successful and unsuccessful calls made to the MCP server. To view the total MCP calls, see Viewing Key Metrics in API Manager for Managed Omni Gateway.
Configure the policy to inject the MCP primitive as request headers toward the upstream backend so that downstream policies can use it. To learn more, see Configuring Policy Parameters.
| This policy must come first in policy order. If this policy doesn’t come first, Omni Gateway might throw a runtime error. |
The MCP Support policy handles requests and responses differently:
Requests: The policy doesn’t process GET requests. It buffers the full body of POST requests with a JSON or text/event-stream content type.
Responses: The policy processes SSE (text/event-stream) responses one event at a time and doesn’t buffer the full stream. It buffers the full body of JSON responses.
Buffered payloads count toward the Omni Gateway payload limit, which is 1 MB by default. To change the limit on a self-managed Omni Gateway, set the FLEX_DOWNSTREAM_CONNECTION_BUFFER_LIMIT_BYTES environment variable. In Connected Mode, you can also set Global connection buffer limit in Runtime Manager. For more information, see Configure Global and Routing Settings in Runtime Manager. For more information about the limit, see Omni Gateway Limits and Performance Metrics.
When you apply the policy from the UI, the following parameters are displayed:
| Element | Description | Default |
|---|---|---|
Inject MCP Element Headers |
Injects the MCP primitive as request headers for downstream policy use. The policy sets |
Disabled |