You ask the host app
You type into the host app: a chat app, IDE or agent. The host runs the model and holds one MCP client connection per server it is configured to use.
Lab
Step through how an AI agent discovers and calls tools with the Model Context Protocol, and see what a gateway adds between the client and remote MCP servers.
◇ Illustrative messages. The JSON-RPC follows the shape of the MCP specification, but the servers, tools, tokens and timings are invented examples and nothing calls a real server.
The client talks to every server directly.
Sam, support agent. Token scopes: orders:readincidents:read
get_order_statusrefund_orderlist_incidentsrestart_serviceexport_contactssearch_notesYou type into the host app: a chat app, IDE or agent. The host runs the model and holds one MCP client connection per server it is configured to use.
Refund order 1042None. Each remote server keeps its own logs, if it keeps any, so there is no single record of who called which tool.
The Model Context Protocol (MCP) is an open standard for connecting AI applications to tools and data. Pick a task above and step through what actually travels over the wire, then switch on the gateway and run the same task again.
id and a method; every response carries the same id and either a result or an error; notifications have no id and get no reply.initialize with the protocol version it supports and its capabilities, the server answers with its own, and the client confirms with notifications/initialized before anything else.tools/list returns each tool's name, description and a JSON Schema for its inputs. The model only ever sees what the host passes on.tools/call on its behalf.Remote MCP servers are APIs, and they need the same controls as any other API. A gateway between the client and those servers gives you one place to:
Some limits are worth knowing. Local stdio servers run beside the host and never pass through a gateway, so they need their own controls. Tool annotations such as "destructive" are hints from the server, not enforcement. And hiding a tool is not the same as authorising it: in this example the refund tool stays listed and is stopped at call time, which some teams prefer so the model can explain why.
The servers, tools, tokens, timings and answers on this page are illustrative. Nothing connects to a real MCP server.
API Gateways for AI Workloads→How API gateways are evolving to handle the unique demands of LLM traffic — streaming, token limits, and semantic caching.