MCP multiplexing
Federate tools of multiple MCP servers on the agentgateway by using MCP multiplexing.
Configure the agentgateway
-
Create a multiplex configuration for your agentgateway. In this example, the agentgateway is configured as follows:
- Listener: An HTTP listener is configured and bound on port 3000. It includes a basic route that matches all traffic to an MCP backend.
- Backend: The backend defines two targets:
time
andeverything
. Note that the target names cannot include underscores (_
). These targets are exposed together a single MCP server to clients.
cat <<EOF > config.yaml binds: - port: 3000 listeners: - routes: - backends: - mcp: name: default targets: - name: time stdio: cmd: uvx args: ["mcp-server-time"] - name: everything stdio: cmd: npx args: ["@modelcontextprotocol/server-everything"] EOF
-
Run the agentgateway.
agentgateway -f config.yaml