For the complete documentation index, see llms.txt. Markdown versions of all docs pages are available by appending .md to any docs URL.
Composable MCP
Define custom MCP tools as multi-step pipelines that chain HTTP and MCP calls together with CEL expressions.
Each step in that pipeline is an HTTP request or a tool call on another MCP server, and subsequent steps can reference earlier outputs. A final CEL expression assembles the composite response that downstream MCP clients receive.
About composable MCP
In many agentic workflows, a single user action requires data from multiple sources. For example, an agent might need to fetch a user profile from one REST API and a list of that user’s recent repositories from another. Without composable MCP, you would need to build a custom MCP server to combine those results.
A composable MCP target removes the need for a custom server by letting you declare a pipeline of steps directly on an EnterpriseAgentgatewayBackend. Each step is either an HTTP call (to any REST API) or an MCP call (to another MCP server). Steps run sequentially, and each step’s JSON response is captured in output.<step_name> so that later steps and the final output expression can reference it. The composite tool appears to downstream MCP clients as a single tool in tools/list.
The key components of a composable MCP target are:
inputSchema: A JSON schema that defines the tool’s input parameters. The gateway validates every incoming tool call against this schema before running any steps.steps: An ordered list of HTTP and MCP calls. Each step has a unique name, and its response is stored inoutput.<step_name>.output: A CEL expression evaluated after all steps complete. The result becomes the tool’s return value.
There are two ways to create a composable MCP server:
- Composable MCP wizard (Solo UI): Turn an existing OpenAPI service into a composable MCP server without writing YAML by hand. The wizard imports an OpenAPI document, lets you choose which operations to expose, and generates the backend and route resources for you. Each selected operation becomes a composable target with a single HTTP step. For more information, see Create an MCP server (UI).
- Manually with YAML: Define the composable target directly on an
EnterpriseAgentgatewayBackendresource for full control over multi-step pipelines that chain HTTP and MCP calls with CEL expressions. For more information, see the steps in Create an MCP server (YAML).
Create an MCP server (UI)
The Composable MCP wizard in the Solo UI turns an existing OpenAPI service into a composable MCP server in four steps: Import, Compose, Deploy, and Expose. You import an OpenAPI document and select the operations to expose. Then, the wizard generates the resources for you: an EnterpriseAgentgatewayBackend MCP server, its upstream backend, and an HTTPRoute with a permissive CORS policy. Each operation that you select becomes a composable target with a single HTTP step, so the wizard gives you the same composable MCP capability as the manual steps through a guided workflow. When you finish, the wizard opens the deployed server in the agentgateway playground so that you can test it right away.
Before you begin
- Install the agentgateway control plane.
Set up the Solo UI and open it in your browser.
Step 1: Import an OpenAPI spec
In the Solo UI, click Composable MCP in the navigation menu.
On the Import step, choose how to provide your OpenAPI document:
- URL Fetch: Enter a URL to an OpenAPI document. The UI fetches the document from your browser, so the URL must be reachable from your browser and allow cross-origin requests.
- File Upload: Upload a
.yaml,.yml, or.jsonfile up to 5 MiB. - YAML Editor: Paste the document directly into an editor.
This example uses a minimal Swagger Petstore spec that exposes two operations. Run the following command to create a
petstore.jsonfile, select File Upload, and upload the file. Because theserversentry uses an absolutehttpsURL, the wizard can infer the upstream host, port, and TLS settings in the Deploy step.cat > petstore.json <<'EOF' { "openapi": "3.0.4", "info": { "title": "Swagger Petstore", "description": "A sample API for a pet store.", "version": "1.0.0" }, "servers": [ { "url": "https://petstore3.swagger.io/api/v3" } ], "paths": { "/store/inventory": { "get": { "operationId": "getInventory", "summary": "Returns pet inventories by status", "description": "Returns a map of status codes to quantities.", "responses": { "200": { "description": "successful operation" } } } }, "/pet/{petId}": { "get": { "operationId": "getPetById", "summary": "Find pet by ID", "description": "Returns a single pet.", "parameters": [ { "name": "petId", "in": "path", "description": "ID of pet to return", "required": true, "schema": { "type": "integer", "format": "int64" } } ], "responses": { "200": { "description": "successful operation" } } } } } } EOFVerify that the wizard validates the document and reports the number of operations that it found, such as
OpenAPI file is valid · 2 operations found. Then, click Continue.

Step 2: Compose the MCP server
On the Compose step, select which API paths and parameters to expose through your MCP server. Every operation is selected by default. To expose only a subset, click Select none and select the operations that you want, or use the filter to find specific paths. When you select a path, its parameters are shown in the Path Parameters panel. Leave both operations selected for this example, and click Continue.


Step 3: Deploy the MCP server
On the Deploy step, the wizard infers the upstream connection details from the spec’s server URL and generates the resources to create the MCP server.
Review the resource configuration. You can edit any of the following fields:
Field Description MCP Server Name The name of the EnterpriseAgentgatewayBackendMCP server that exposes the composed tools. Defaults to the imported document’s name, such aspetstore.Upstream Name The name of the EnterpriseAgentgatewayBackendthat represents the upstream API, such aspetstore-upstream.MCP & Upstream Namespace The namespace to create both backends in. Defaults to agentgateway-system.Upstream host The upstream hostname. Inferred from the spec’s server URL. For this example, the wizard fills in petstore3.swagger.io.Upstream port The upstream port. Inferred from the server URL scheme. Because the server uses https, the wizard fills in443.Because the spec’s server uses an absolute
httpsURL, the wizard also adds atls: {}policy to the upstream backend so that the gateway originates a TLS connection to the API. If your spec uses a relative server URL or the wizard cannot infer these values, enter the upstream host and port manually.

Review the generated YAML in the code block. The wizard creates two
EnterpriseAgentgatewayBackendresources: an upstream backend with the inferredstatichost, port, and TLS settings, and an MCP backend whoseentMcp.targetslist contains one composablecustomtarget per operation that you selected. Each target has a single HTTP step that calls the upstream backend.Click the Copy or Download button to get a YAML file that you can apply to your cluster. The wizard does not apply the resources for you.
kubectl apply -f - <<EOF apiVersion: enterpriseagentgateway.solo.io/v1alpha1 kind: EnterpriseAgentgatewayBackend metadata: name: petstore-upstream namespace: agentgateway-system spec: policies: tls: {} static: host: petstore3.swagger.io port: 443 --- apiVersion: enterpriseagentgateway.solo.io/v1alpha1 kind: EnterpriseAgentgatewayBackend metadata: name: petstore namespace: agentgateway-system spec: entMcp: targets: - name: get-inventory custom: description: "Returns pet inventories by status. Returns a map of status codes to quantities." inputSchema: type: object steps: - name: request http: backendRef: group: enterpriseagentgateway.solo.io kind: EnterpriseAgentgatewayBackend name: petstore-upstream method: GET path: '"/api/v3/store/inventory"' output: output.request - name: get-pet-by-id custom: description: "Find pet by ID. Returns a single pet." inputSchema: type: object properties: petId: type: integer description: "ID of pet to return" required: - petId steps: - name: request http: backendRef: group: enterpriseagentgateway.solo.io kind: EnterpriseAgentgatewayBackend name: petstore-upstream method: GET path: '"/api/v3/pet/" + string(input.petId)' output: output.request EOFAfter the resources are created, the wizard detects them and enables the Continue button. Click Continue.
Step 4: Expose the MCP server
On the Expose step, the wizard generates an HTTPRoute and a permissive CORS policy so that the MCP server can be reached through the gateway and tested in the playground.
Review the route configuration. You can edit any of the following fields:
Field Description Name The name of the HTTPRoute, such aspetstore-route.Namespace The namespace to create the route in. Defaults to agentgateway-system.Path override (optional) The path prefix that the route matches, such as /petstore-mcp.Gateway The gateway to attach the route to, such as agentgateway-proxy.

Review the generated YAML. The wizard creates an
HTTPRoutethat routes the path prefix to the MCP backend, and anAgentgatewayPolicythat applies a permissive CORS policy to the route so that the playground can call it from your browser.Click the Copy or Download button to get a YAML file that you can apply to your cluster. The wizard does not apply the resources for you.
kubectl apply -f - <<EOF apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: name: petstore-route namespace: agentgateway-system spec: parentRefs: - name: agentgateway-proxy rules: - matches: - path: type: PathPrefix value: /petstore-mcp backendRefs: - group: enterpriseagentgateway.solo.io kind: EnterpriseAgentgatewayBackend name: petstore --- apiVersion: agentgateway.dev/v1alpha1 kind: AgentgatewayPolicy metadata: name: petstore-route-cors namespace: agentgateway-system spec: targetRefs: - group: gateway.networking.k8s.io kind: HTTPRoute name: petstore-route traffic: cors: allowOrigins: - "*" allowMethods: - "*" allowHeaders: - "*" EOFAfter the resources are created, the wizard detects them and enables the Continue button. Click Continue.
Step 5: Test the MCP server in the playground
After you apply the route, the wizard opens the Playground tab with the new route selected. From here, you can connect to the MCP server and call its tools.
In the Connection Settings card, provide a route bearer token if your route requires authentication. For this example, no token is required. Click Connect.


After you connect, the playground lists the tools that the MCP server exposes. Each composable target appears as a tool named
<target>_<tool>, such asget-inventory_get-inventoryandget-pet-by-id_get-pet-by-id.Select a tool, provide any required input parameters, and run it. For example, select the
get-inventory_get-inventorytool, which takes no parameters, and click Run Tool. Verify that the response contains the pet inventory from the upstream API. The following image shows a sample response; the exact inventory values that you see depend on the live upstream API.

Clean up the wizard resources
You can remove the resources that you created in this guide.kubectl delete HTTPRoute petstore-route -n agentgateway-system
kubectl delete AgentgatewayPolicy petstore-route-cors -n agentgateway-system
kubectl delete EnterpriseAgentgatewayBackend petstore petstore-upstream -n agentgateway-systemCreate an MCP server (YAML)
Create an MCP server with YAML by defining the composable target directly on an EnterpriseAgentgatewayBackend resource. This example defines a github-summary tool that fetches a GitHub user’s profile and their public repositories in two HTTP steps, then synthesizes a greeting from both results.
Before you begin
Install the agentgateway control plane.Step 1: Create a backend for the upstream HTTP API
Create an EnterpriseAgentgatewayBackend resource that represents the target that you want to access. In this example, you use the GitHub API server. Because, the server only accepts HTTPS connections, create an EnterpriseAgentgatewayPolicy resource that originates TLS connections to the GitHub API server backend.
kubectl apply -f- <<EOF
apiVersion: enterpriseagentgateway.solo.io/v1alpha1
kind: EnterpriseAgentgatewayBackend
metadata:
name: github-api
namespace: default
spec:
static:
host: api.github.com
port: 443
---
apiVersion: enterpriseagentgateway.solo.io/v1alpha1
kind: EnterpriseAgentgatewayPolicy
metadata:
name: github-api-tls
namespace: default
spec:
targetRefs:
- group: enterpriseagentgateway.solo.io
kind: EnterpriseAgentgatewayBackend
name: github-api
backend:
tls: {}
EOFStep 2: Create the composable MCP target
Create an EnterpriseAgentgatewayBackend resource that defines the composed tool that you want to expose to users. This example defines a github-summary tool that fetches a GitHub user’s profile and their public repositories in two HTTP steps, then synthesizes a greeting from both results.
kubectl apply -f- <<EOF
apiVersion: enterpriseagentgateway.solo.io/v1alpha1
kind: EnterpriseAgentgatewayBackend
metadata:
name: composable-mcp
namespace: default
spec:
entMcp:
targets:
- name: github-summary
custom:
description: "Fetch a GitHub user's public profile and list a few of their repositories."
inputSchema:
type: object
additionalProperties: false
required: [name]
properties:
name:
type: string
description: "GitHub username"
steps:
- name: user
http:
backendRef:
group: enterpriseagentgateway.solo.io
kind: EnterpriseAgentgatewayBackend
name: github-api
method: GET
path: '"/users/" + input.name'
headers:
- name: User-Agent
value: '"agentgateway-composable-mcp"'
- name: Accept
value: '"application/vnd.github+json"'
- name: repos
http:
backendRef:
group: enterpriseagentgateway.solo.io
kind: EnterpriseAgentgatewayBackend
name: github-api
method: GET
path: '"/users/" + input.name + "/repos?per_page=5"'
headers:
- name: User-Agent
value: '"agentgateway-composable-mcp"'
- name: Accept
value: '"application/vnd.github+json"'
output: |
"Hello " + output.user.login
+ "! You have " + string(output.user.public_repos) + " public repos."
+ " A few of them: " + output.repos.map(r, r.name).join(", ") + "."
EOF| Setting | Description |
|---|---|
entMcp.targets[].custom | Declares a composable MCP target. The target is exposed as a single MCP tool to downstream clients. |
custom.description | Tool description advertised to downstream MCP clients in tools/list. |
custom.inputSchema | Required. JSON Schema for the tool’s input parameters. Every incoming tool call is validated against this schema before any step runs. This example requires the GitHub username to be sent in a name input parameter. |
custom.steps | Ordered list of HTTP and MCP steps. You can define 1–64 steps per target. Each step’s JSON response is stored under output.<step_name>. |
custom.steps[].http | An HTTP step. Required: backendRef. Optional: method (defaults to GET), path (CEL), body (CEL), headers (each value is CEL). |
custom.steps[].mcp | An MCP step. Required: backendRef, tool. Optional: arguments (CEL expression that evaluates to a JSON object). |
custom.output | CEL expression evaluated after all steps complete. The result becomes the tool’s return value that the MCP client sees. The expression refers to earlier step responses with output.<step_name>.<field>, where <step_name> matches the name of an entry in custom.steps and <field> is a key from that step’s JSON response. For example, output.user.login reads the login field from the response of the step named user. To learn more about CEL expressions in composable MCP, see the CEL expressions section. |
Step 3: Route to the composable target
Create an HTTPRoute that routes incoming MCP traffic to the composable EnterpriseAgentgatewayBackend.
kubectl apply -f- <<EOF
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: composable-mcp
namespace: default
spec:
parentRefs:
- name: agentgateway-proxy
namespace: agentgateway-system
rules:
- matches:
- path:
type: PathPrefix
value: /mcp
backendRefs:
- name: composable-mcp
group: enterpriseagentgateway.solo.io
kind: EnterpriseAgentgatewayBackend
EOFStep 4: Verify the composable tool
Send MCP requests through the gateway to verify that the composable tool works.
Get the agentgateway address.
export INGRESS_GW_ADDRESS=$(kubectl get gateway agentgateway-proxy -n agentgateway-system -o=jsonpath="{.status.addresses[0].value}") echo $INGRESS_GW_ADDRESSkubectl port-forward deployment/agentgateway-proxy -n agentgateway-system 8080:80export INGRESS_GW_ADDRESS=localhost:8080Initialize an MCP session.
curl -sD - "http://${INGRESS_GW_ADDRESS}/mcp" \ -H "Content-Type: application/json" \ -H "Accept: application/json, text/event-stream" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "initialize", "params": { "protocolVersion": "2025-03-26", "capabilities": {}, "clientInfo": {"name": "test", "version": "1.0"} } }'Example output: In the response headers, note the
mcp-session-idvalue.HTTP/1.1 200 OK content-type: text/event-stream cache-control: no-cache mcp-session-id: eyJ0Ij... transfer-encoding: chunked date: Thu, 14 May 2026 20:38:05 GMT data: {"jsonrpc":"2.0","id":1,"result":{"protocolVersion":"2025-11-25","capabilities":{"tools":{}},"serverInfo":{"name":"rmcp","version":"1.5.0"}}}Save the session ID as an environment variable.
export SESSION_ID=eyJ0Ij...List the available tools.
curl -s "http://${INGRESS_GW_ADDRESS}/mcp" \ -H "Content-Type: application/json" \ -H "Accept: application/json, text/event-stream" \ -H "Mcp-Session-Id: $SESSION_ID" \ -d '{"jsonrpc": "2.0", "id": 2, "method": "tools/list", "params": {}}'Example output: Verify that
github-summaryappears in the tools list with the input schema you defined.data: {"jsonrpc":"2.0","id":2,"result":{"tools":[{"name":"github-summary","description":"Fetch a GitHub user's public profile and list a few of their repositories.","inputSchema":{"additionalProperties":false,"properties":{"name":{"description":"GitHub username","type":"string"}},"required":["name"],"type":"object"}}]}}Call the composable tool. Make sure to enter all required input parameters in the
paramsblock. In this example, you provide the GitHub username in thenamefield as defined in your composable tool that you created earlier. Verify that the response contains a greeting message that combines the fields from both steps that you defined in the composable tool.curl -s "http://${INGRESS_GW_ADDRESS}/mcp" \ -H "Content-Type: application/json" \ -H "Accept: application/json, text/event-stream" \ -H "Mcp-Session-Id: $SESSION_ID" \ -d '{ "jsonrpc": "2.0", "id": 3, "method": "tools/call", "params": { "name": "github-summary", "arguments": {"name": "octocat"} } }'Example output:
data: {"jsonrpc":"2.0","id":3,"result":{"content":[{"type":"text","text":"Hello octocat! You have 8 public repos. A few of them: boysenberry-repo-1, git-consortium, hello-worId, Hello-World, linguist."}],"isError":false}}
Step reference
Review the following reference information for the steps in your composable MCP target on the EnterpriseAgentgatewayBackend resource.
HTTP steps
An HTTP step makes a REST API call. Responses must be JSON. Non-2xx responses fail the step. The step’s JSON response is bound to output.<step_name> for later steps and the final output expression.
An HTTP step picks an upstream with a backendRef. The referenced object can be a Kubernetes Service, an upstream AgentgatewayBackend, or an EnterpriseAgentgatewayBackend resource with a static or aws spec. Inline policies on the referenced backend, such as TLS, retries, or auth apply to the request.
Reference a Kubernetes Service in the same namespace. The port field is required.
- name: internal-lookup
http:
backendRef:
group: ""
kind: Service
name: users-svc
port: 8080
method: POST
path: '"/lookup"'
body: '{"id": input.user_id}'Reference an upstream AgentgatewayBackend resource. The port is resolved from the backend resource; do not set a port here.
- name: internal-api
http:
backendRef:
group: agentgateway.dev
kind: AgentgatewayBackend
name: internal-api
method: GET
path: '"/items/" + input.id'Reference an EnterpriseAgentgatewayBackend resource with a static or aws spec. The port is resolved from the backend; do not set a port here.
- name: github
http:
backendRef:
group: enterpriseagentgateway.solo.io
kind: EnterpriseAgentgatewayBackend
name: github-api
method: GET
path: '"/users/" + input.name'| Field | Description |
|---|---|
backendRef.group | Required. "" for Service, agentgateway.dev for AgentgatewayBackend, or enterpriseagentgateway.solo.io for EnterpriseAgentgatewayBackend. |
backendRef.kind | Required. Must match the group: Service, AgentgatewayBackend, or EnterpriseAgentgatewayBackend. |
backendRef.name | Required. Name of the referenced resource in the same namespace. |
backendRef.port | Required when kind is Service. Must not be set otherwise. |
method | HTTP method. One of GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS. Defaults to GET. |
path | CEL expression for the request path. Defaults to "/". |
body | CEL expression for the request body. |
headers | List of headers, up to 32 entries. Each header has a name (string) and a value that is a CEL expression. |
MCP steps
An MCP step calls a tool on another MCP server and uses its response as the step output. The upstream is picked with a backendRef that points at an MCP-typed AgentgatewayBackend or EnterpriseAgentgatewayBackend resource. To reach an MCP server that is fronted by a Kubernetes Service, create an MCP backend that points at the Service first, then reference that backend in the MCP step.
An MCP backend resource can expose multiple MCP server targets (each entry under mcp.targets[] or entMcp.targets[]). The fields on the MCP step let you drill down to a single tool call as follows:
backendRef.name: The name of the MCP backend resource.backendRef.target: The name of a target inside the referenced backend. Optional. If omitted, the gateway treats the whole backend as a single streamable-HTTP MCP server.tool: The name of the MCP tool to call on the selected target.
The MCP step’s response is either the upstream tools/call result’s structuredContent (if present), or the first text content parsed as JSON. If neither of them are returned, the response is set to null.
Reference a specific target on an MCP-typed backend with target. Dispatch happens in-process without a network hop.
- name: time
mcp:
backendRef:
group: enterpriseagentgateway.solo.io
kind: EnterpriseAgentgatewayBackend
name: upstream-mcp
target: time
tool: get_current_time
arguments: '{"timezone": has(input.timezone) ? input.timezone : "UTC"}'Reference an MCP backend without selecting a target. The gateway treats the entire backend as a single streamable-HTTP MCP server.
- name: search
mcp:
backendRef:
group: agentgateway.dev
kind: AgentgatewayBackend
name: search-mcp-backend
tool: search
arguments: '{"q": input.query}'| Field | Description |
|---|---|
backendRef.group | Required. agentgateway.dev for AgentgatewayBackend, or enterpriseagentgateway.solo.io for EnterpriseAgentgatewayBackend. |
backendRef.kind | Required. Must match the group: AgentgatewayBackend or EnterpriseAgentgatewayBackend. The referenced backend must be MCP-typed. |
backendRef.name | Required. Name of the referenced backend in the same namespace. |
backendRef.target | Optional. Name of a specific target on the referenced MCP backend. If omitted, the backend is treated as a single streamable-HTTP MCP server. |
tool | Required. The name of the MCP tool to call on the upstream server. |
arguments | CEL expression that evaluates to a JSON object. Passed as the arguments field when calling the upstream MCP tool. |
CEL expressions
CEL expressions are used in HTTP path, body, and header value fields; MCP arguments; and the target-level output.
Available variables
Composable MCP steps use a separate CEL context from policy CEL expressions. The following variables are available:
| Variable | Type | Description |
|---|---|---|
input | object | The tool call arguments from the downstream client, validated against the inputSchema. |
output | object | An object keyed by step name. For example, output.user.login reads the login field from the user step’s JSON response. Only steps that have already run are available. |
request | object | The incoming downstream HTTP request (headers, method, path). |
jwt | object | Claims from the validated JWT token, if a JWT policy is attached to the downstream route. |
apiKey | object | The API key principal, if an API key policy is attached to the downstream route. |
Output behavior
Each step’s upstream response must be JSON, which is how step results become available to later steps and the final output expression. The final output expression itself, however, can evaluate to any CEL value (a string, object, list, number, or boolean). The shape of that final value controls what the downstream MCP client receives:
- String result: If the
outputexpression evaluates to a string (for example,"Hello " + output.user.login), the gateway returns it to the MCP client as a single text content item. - Any other value: If the
outputexpression evaluates to an object, list, number, or boolean (for example,{ "user": output.user.login, "repos": output.user.public_repos }), the gateway serializes the value to JSON and returns the JSON as a text content item. The same value is also attached asstructuredContentfor MCP clients that support the structured content extension.
Example expressions
The following examples walk through the output expression patterns that you commonly use to construct the tool response.
Example 1: Simple string concatenation
This expression returns a string that concatenates a greeting with the login field from the response of a step named user. The MCP client receives a single text content item.
output: '"Hello " + output.user.login'Example 2: Combining multiple step outputs
This is the expression used in the github-summary example earlier in this guide. To understand how the expression maps to the upstream response, consider the JSON that the GitHub API returns for the two HTTP steps when called with name: octocat.
The user step calls GET https://api.github.com/users/octocat, which returns a JSON object similar to the following (most fields omitted for clarity):
{
"login": "octocat",
"name": "The Octocat",
"public_repos": 8,
...
}The repos step calls GET https://api.github.com/users/octocat/repos?per_page=5, which returns a JSON array of repository objects:
[
{ "name": "Hello-World", ... },
{ "name": "Spoon-Knife", ... },
{ "name": "octocat.github.io", ... },
{ "name": "git-consortium", ... },
{ "name": "hello-worId", ... }
]The output expression then references each step’s response and transforms the data into the final greeting.
output: |
"Hello " + output.user.login
+ "! You have " + string(output.user.public_repos) + " public repos."
+ " A few of them: " + output.repos.map(r, r.name).join(", ") + "."In this expression:
output.user.loginreads theloginfield from theuserstep’s JSON response ("octocat").string(output.user.public_repos)readspublic_repos(8) and converts the integer to a string so it can be concatenated.output.repos.map(r, r.name)iterates over the array returned by thereposstep and maps each repository objectrto itsnamefield, producing the list["Hello-World", "Spoon-Knife", "octocat.github.io", "git-consortium", "hello-worId"]..join(", ")joins the list into a single comma-separated string.
The MCP client receives the resulting text:
Hello octocat! You have 8 public repos. A few of them: Hello-World, Spoon-Knife, octocat.github.io, git-consortium, hello-worId.
Example 3: Returning structured data
Instead of a string, the expression can evaluate to an object. The gateway serializes the object to JSON and also attaches it as structuredContent for MCP clients that support that extension.
output: |
{
"user": output.user.login,
"repos": output.user.public_repos,
"top_repos": output.repos.map(r, r.name)
}Sessions
MCP steps participate in the downstream session lifecycle. When the downstream client sends initialize, the gateway fans the handshake out to every MCP step in the pipeline so that upstream sessions are established before the tool is called.
Clients that skip the initialize step see the upstream’s own session error on the first tools/call.
Cleanup
You can remove the resources that you created in this guide.kubectl delete HTTPRoute composable-mcp -n default
kubectl delete EnterpriseAgentgatewayBackend composable-mcp -n default
kubectl delete EnterpriseAgentgatewayBackend github-api -n default
kubectl delete EnterpriseAgentgatewayPolicy github-api-tls -n default