Streamable HTTP Transport

Streamable HTTP transport connects agentgateway to remote MCP servers over HTTP with streaming support for real-time responses.

Overview

Streamable HTTP transport is ideal when:

  • MCP servers run as standalone HTTP services
  • You need real-time streaming of responses
  • The server is accessible over the network
  • You want stateful sessions with the MCP server

Quick start

# Start an MCP server with streamable HTTP
PORT=3005 npx -y @modelcontextprotocol/server-everything streamableHttp

# Create config.yaml
cat <<EOF > config.yaml
# yaml-language-server: $schema=https://agentgateway.dev/schema/config
binds:
- port: 3000
  listeners:
  - routes:
    - policies:
        cors:
          allowOrigins:
            - "*"
          allowHeaders:
            - "*"
          exposeHeaders:
            - "Mcp-Session-Id"
      backends:
      - mcp:
          targets:
          - name: mcp
            mcp:
              host: http://localhost:3005/mcp/
EOF

# Run agentgateway
agentgateway -f config.yaml

Configuration

Configure a streamable HTTP MCP backend:

# yaml-language-server: $schema=https://agentgateway.dev/schema/config
binds:
- port: 3000
  listeners:
  - routes:
    - policies:
        cors:
          allowOrigins:
            - "*"
          allowHeaders:
            - "*"
          exposeHeaders:
            - "Mcp-Session-Id"
      backends:
      - mcp:
          targets:
          - name: remote-mcp
            mcp:
              host: http://mcp-server:8080/mcp/

Key configuration

SettingDescription
mcp.hostThe HTTP URL of the MCP server endpoint
cors.exposeHeadersMust include Mcp-Session-Id for session management

Example: Multiple MCP servers

Aggregate multiple remote MCP servers:

backends:
- mcp:
    targets:
    - name: server-a
      mcp:
        host: http://mcp-server-a:8080/mcp/
    - name: server-b
      mcp:
        host: http://mcp-server-b:8080/mcp/

Why use agentgateway?

Direct HTTP ConnectionWith agentgateway
Client manages connectionsGateway handles reconnection and buffering
No authenticationOAuth2, API keys, or custom auth
No access controlTool-level authorization
Single server per clientMultiple servers aggregated
No metricsFull observability with OpenTelemetry
Manual session handlingAutomatic session management

Verify access

  1. Open the agentgateway UI to view your configuration
  2. Go to Playground to test tools
  3. Click Connect to retrieve available tools from all configured servers
  4. Select a tool and click Run Tool to test

Learn more

Agentgateway assistant

Ask me anything about agentgateway configuration, features, or usage.

Note: AI-generated content might contain errors; please verify and test all returned information.

Tip: one topic per conversation gives the best results. Use the + button in the chat header to start a new conversation.

Switching topics? Starting a new conversation improves accuracy.
↑↓ navigate select esc dismiss

What could be improved?

Your feedback helps us improve assistant answers and identify docs gaps we should fix.

Need more help? Join us on Discord: https://discord.gg/y9efgEmppm

Want to use your own agent? Add the Solo MCP server to query our docs directly. Get started here: https://search.solo.io/.