Model Interaction Flow
End-to-end flow
Section titled “End-to-end flow”A typical tool-using interaction:
- Discovery — the client learns what the server offers. In the current spec (
2026-07-28) the client callsserver/discoverto get supported versions and capabilities, thentools/list,resources/list,prompts/list. There is noinitializehandshake anymore: protocol version, client info, and client capabilities travel as_metafields on every request. (In legacy revisions,2025-11-25and earlier, a connection started withinitialize→notifications/initialized.) - Context assembly — the host converts MCP tool definitions into the model’s native tool-calling format and includes them in the model request
- User prompt — the user asks something; the host sends the conversation plus available tools to the LLM
- Model decision — the model decides a tool is needed and emits a tool-use request
- Consent — the host checks policy / asks the user for approval
- Invocation — the client sends
tools/callto the server with the arguments - Execution — the server executes and returns a result (or an in-band error with
isError: true) - Response synthesis — the host feeds the tool result back to the model, which produces the final answer for the user
Sequence diagram
Section titled “Sequence diagram”sequenceDiagram participant U as User participant H as Host participant L as LLM participant C as Client participant S as Server C->>S: server/discover S-->>C: versions + capabilities C->>S: tools/list S-->>C: tool definitions U->>H: "What's the weather in Madrid?" H->>L: prompt + tool definitions L-->>H: tool_use: get_weather(location="Madrid") H->>U: approve? (consent) U-->>H: approved C->>S: tools/call get_weather S-->>C: result: temp 31, sunny H->>L: tool result L-->>H: "It's 31°C and sunny in Madrid." H-->>U: final answer
Important nuances
Section titled “Important nuances”- The model never talks to servers directly — the host/client mediates every call
- Discovery results can change at runtime; servers emit
notifications/tools/list_changed(and similar for resources/prompts). In the current spec the client must open asubscriptions/listenstream to receive them, then re-fetch the list - The host may loop the decision → consent → call → result steps multiple times (multi-step agentic workflows)
- Sampling reverses the direction: the server asks the client to run an LLM generation (
sampling/createMessage). Note that sampling is deprecated in2026-07-28, and server-initiated needs now arrive inside a reply asInputRequiredResult(the MRTR pattern) rather than as server-initiated requests
Key exam points
Section titled “Key exam points”- Order matters: discover → model selects tool → consent → call → result → final response
- The host translates between MCP tool definitions and the specific LLM’s tool-call format
- The LLM only sees tool names/descriptions/schemas — never the server implementation
Check your knowledge
Section titled “Check your knowledge”📝 Check your knowledge