Kong Context Mesh
AI agents are only as good as the context they can reach. Context Mesh exposes REST APIs and existing MCP servers to AI agents as a single Code Mode MCP server.
Standard MCP tool calling doesn’t scale: every tool definition and every intermediate result burns tokens as they flow through the model. Code Mode removes that ceiling: agents can use far more tools at far lower cost.
Context Mesh is the mediation layer between agents and APIs that you deploy behind Kong Gateway to complement AI Gateway.
Context Mesh is in active development. The current release supports APIs and MCP servers as source types. Additional source types are planned for future releases.
Why Context Mesh?
Context Mesh is designed to make enterprise APIs and MCP servers usable by AI agents without adding integration complexity to your teams.
- One agent, many sources: Aggregate sources (OpenAPI specs, existing MCP servers) into a single source of truth for agents.
- Traffic stays on Kong: Because each MCP server runs on a Konnect control plane, agent calls to your APIs pass through Kong and can be governed with the plugins you already use.
- Reusable instructions: Attach skills to an MCP server to give agents task-specific instructions alongside the tools.
Code Mode MCP servers
Context Mesh generates MCP servers in Code Mode. Instead of loading every tool definition into the agent’s context, the server gives the agent a few meta-tools to search for the operations it needs and to run code that calls them.
Only the final result returns to the model, so agents can work with large APIs without flooding the context window. For details, see How agents use a Code Mode MCP server.
Get started
Walk through creating a Code Mode MCP server from an OpenAPI specification, deploying it, and calling it from an MCP client.
Common usage patterns
What an agent can do depends on the sources you add to Context Mesh.
When you create a Context Mesh Code Mode MCP server, you can choose to create your MCP server from the following:
- Expose a single internal API
- Compose multiple APIs
- Combine APIs with existing MCP servers
You manually add MCP servers as sources using their upstream URL.
If you’re adding one or many APIs to your Code Mode MCP server, you can either upload an OpenAPI Specification (OAS) v3.0 file for each API or add them directly from APIs that you already have in Catalog.
Deploying a Context Mesh MCP server
To deploy a Context Mesh MCP server, add its source APIs and MCP servers, then create the MCP server and map it to a Kong Gateway control plane.
Both deployment modes require Kong Operator on the control plane. When you create the MCP server, you choose how Kong Operator manages the underlying Kubernetes workload. Basic mode uses its preconfigured defaults, and advanced mode hands the deployment over to you:
| Capability | Basic mode (default) | Advanced mode Tech Preview |
|---|---|---|
| Initial deployment created for you | Supported | Not supported |
| Deployment managed by Konnect after creation | Supported | Supported |
| Customize replica count and CPU and memory resources | Not supported | Supported |
| Set custom labels and annotations on the deployment | Not supported | Supported |
| MCP server code managed by Konnect | Supported | Supported |
You can switch an existing MCP server between basic and advanced mode.
Either way, Kong Gateway creates a Gateway Service entity for your MCP server, for example mcpserver-98dd0356.
This lets you apply plugins and other governing strategies to your Context Mesh MCP server.
For the deployment modes and statuses, see Context Mesh MCP servers. For an end-to-end walkthrough, see Deploy an MCP server with Context Mesh and Kong Operator.
Context Mesh limitations
Context Mesh has the following limitations:
|
Feature |
Limitation |
Details |
|---|---|---|
| Deployment | Requires Kong Operator, and advanced mode is in Tech Preview |
MCP servers can only be deployed to Kong Gateway control planes that have Kong Operator installed, in both deployment modes.
Advanced mode is in Tech Preview and shouldn’t be used in production. |
| Sources | Fixed after creation | You can’t change a source’s type, spec, or MCP server URL. To update one, create a new source and delete the old one. Sources imported from the Catalog are a forked copy and don’t stay in sync. |
| Custom headers | Not encrypted | Context Mesh stores custom headers unencrypted, so don’t use them for API keys, tokens, or passwords. |
| Skills | Single file, one MCP server |
A skill is one SKILL.md file that belongs to a single MCP server. Context Mesh doesn’t support supporting files or skill versions.
|
Frequently asked questions
Is Context Mesh different from the AI Gateway MCP Server?
Yes. You configure a AI Gateway MCP Server by hand, tool by tool, with full governance (auth, ACLs, rate limiting) built into that configuration. AI Gateway MCP Servers don’t support Code Mode.
Context Mesh MCP servers use Code Mode instead: rather than declaring tools manually, Context Mesh generates the MCP server directly from each source’s existing configuration, so you can combine multiple types of sources into a single context surface for agents.
In short: AI Gateway MCP Servers are built for fine-grained control over one endpoint. Context Mesh is built for assembling different sources quickly, as a Code Mode MCP server.
What type of source can I use with Context Mesh?
Context Mesh supports two source types: REST APIs, added as OpenAPI specifications, and existing MCP servers. You can mix both in the same Context Mesh MCP server.