Follow Discord
Sweep 20 Nov 2026 · 19:55Z Build v2.1.330 547 read Stable v2.1.323 Latest v2.1.330 Next v2.1.330 Feeds RSS JSON llms.txt llms-full.txt Unofficial
One capture · mcp

One read of Model Context Protocolmcp-20261116T043706Z

22 pages moved out of 360 read.

Pages moved 22 significant first
Pages read 360 in this capture
Captured 04:37 UTC
Corpus hash 369c5fb5166f corpus-hash

What this read moved

1-22 of 22

docs/2026-07-28/learn/architecture Changed · +31 / -18 lines

from line 82
8282 
8383* **Discovery**: Lets clients query a server's supported protocol versions, capabilities, and identity through the `server/discover` request
8484* **Server features**: Enables servers to provide core functionality including tools for AI actions, resources for context data, and prompts for interaction templates from and to the client
85* **Client features**: Enables servers to elicit input from the user. Sampling is [deprecated](https://modelcontextprotocol.io/specification/2026-07-28/deprecated.md) as of protocol version `2026-07-28`.
85* **Client features**: Enables servers to elicit input from the user.
8686* **Utility features**: Supports additional capabilities like notifications for real-time updates and progress tracking for long-running operations
8787 
8888#### Transport layer
from line 100
100100 
101101A core part of MCP is defining the schema and semantics between MCP clients and MCP servers. Developers will likely find the data layer — in particular, the set of [primitives](#primitives) — to be the most interesting part of MCP. It is the part of MCP that defines the ways developers can share context from MCP servers to MCP clients.
102102 
103MCP uses [JSON-RPC 2.0](https://www.jsonrpc.org/) as its underlying RPC protocol. Client and servers send requests to each other and respond accordingly. Notifications can be used when no response is required.
103MCP uses [JSON-RPC 2.0](https://www.jsonrpc.org/) as its underlying RPC protocol. Clients send requests and servers respond to them. Servers can request input from the client through the [Multi Round-Trip Requests](https://modelcontextprotocol.io/specification/2026-07-28/basic/patterns/mrtr.md) pattern. Notifications can be used when no response is required.
104104 
105105#### Statelessness and discovery
106106 
from line 116
116116* **Resources**: Data sources that provide contextual information to AI applications (e.g., file contents, database records, API responses)
117117* **Prompts**: Reusable templates that help structure interactions with language models (e.g., system prompts, few-shot examples)
118118 
119Each primitive type has associated methods for discovery (`*/list`), retrieval (`*/get`), and in some cases, execution (`tools/call`).
120MCP clients will use the `*/list` methods to discover available primitives. For example, a client can first list all available tools (`tools/list`) and then execute them. This design allows listings to be dynamic.
119Each primitive type has associated methods for discovery (`*/list`), and for either retrieval (`resources/read`, `prompts/get`) or execution (`tools/call`).
120MCP clients will use the `*/list` methods to discover available primitives. For example, a client can list the available tools (`tools/list`), provide them to a model, and execute the ones that the model calls (`tools/call`). This design allows listings to be dynamic.
121121 
122122As a concrete example, consider an MCP server that provides context about a database. It can expose tools for querying the database, a resource that contains the schema of the database, and a prompt that includes few-shot examples for interacting with the tools.
123123 
from line 129
129129 
130130Elicitation requests are delivered through the [Multi Round-Trip Requests](https://modelcontextprotocol.io/specification/2026-07-28/basic/patterns/mrtr.md) pattern, explained in the [elicitation overview](https://modelcontextprotocol.io/docs/2026-07-28/learn/client-concepts.md#elicitation).
131131 
132**Deprecated**: The following client primitives are deprecated as of protocol version `2026-07-28`.
132For more details about client primitives see [client concepts](https://modelcontextprotocol.io/docs/2026-07-28/learn/client-concepts.md).
133133 
134* **Sampling**: Allows servers to request language model completions from the client's AI application. This is useful when server authors want access to a language model, but want to stay model-independent and not include a language model SDK in their MCP server. Servers request completions with the `sampling/createMessage` method, also delivered through the Multi Round-Trip Requests pattern. New implementations should integrate directly with LLM provider APIs.
135* **Logging**: Enables servers to send log messages to clients for debugging and monitoring purposes. New implementations should log to `stderr` (stdio transport) or use OpenTelemetry.
134Roots and sampling, which are client features, and protocol logging, which is a server feature, are [deprecated](https://modelcontextprotocol.io/specification/2026-07-28/deprecated.md) as of protocol version `2026-07-28`. New implementations should use the following alternatives:
136135 
137For more details about client primitives see [client concepts](https://modelcontextprotocol.io/docs/2026-07-28/learn/client-concepts.md).
136* **Roots**: Pass directories or files through tool parameters, resource URIs, or server configuration.
137* **Sampling**: Integrate directly with LLM provider APIs. The protocol does not define a replacement for requesting completions through the client.
138* **Logging**: [Log to `stderr`](https://modelcontextprotocol.io/docs/2026-07-28/tools/debugging#implementing-logging) for stdio servers, or use [OpenTelemetry](https://opentelemetry.io/).
138139 
139140Besides server and client primitives, the protocol supports optional [extensions](https://modelcontextprotocol.io/extensions/overview.md) that build on the core protocol. For example, the [Tasks extension](https://modelcontextprotocol.io/extensions/tasks/overview.md) lets servers return a durable handle for long-running requests, so clients can poll for status and retrieve the result later.
140141 
from line 302
301302 }
302303 ],
303304 "ttlMs": 300000,
304 "cacheScope": "public"
305 "cacheScope": "public",
306 "_meta": {
307 "io.modelcontextprotocol/serverInfo": {
308 "name": "example-server",
309 "version": "1.0.0"
310 }
311 }
305312 }
306313}
307314```
from line 389
382389 "type": "text",
383390 "text": "Current weather in San Francisco: 68°F, partly cloudy with light winds from the west at 8 mph. Humidity: 65%"
384391 }
385 ]
392 ],
393 "_meta": {
394 "io.modelcontextprotocol/serverInfo": {
395 "name": "example-server",
396 "version": "1.0.0"
397 }
398 }
386399 }
387400}
388401```
from line 420
407420 
4084211. **`content` Array**: Tool responses return an array of content objects, allowing for rich, multi-format responses (text, images, resources, etc.)
409422 
4102. **Content Types**: Each content object has a `type` field. In this example, `"type": "text"` indicates plain text content, but MCP supports various content types for different use cases.
4232. **Content Types**: Each content object has a `type` field. In this example, `"type": "text"` indicates [text content](https://modelcontextprotocol.io/specification/2026-07-28/server/tools.md#text-content). Tool results can also contain [images](https://modelcontextprotocol.io/specification/2026-07-28/server/tools.md#image-content) (`image`), [audio](https://modelcontextprotocol.io/specification/2026-07-28/server/tools.md#audio-content) (`audio`), [resource links](https://modelcontextprotocol.io/specification/2026-07-28/server/tools.md#resource-links) (`resource_link`), and [embedded resources](https://modelcontextprotocol.io/specification/2026-07-28/server/tools.md#embedded-resources) (`resource`). Not every model accepts all of these types, so clients may need to handle content that their model does not support.
411424 
4123. **Structured Output**: The response provides actionable information that the AI application can use as context for language model interactions.
4253. **Structured Content** (optional): Tools can also return [structured content](https://modelcontextprotocol.io/specification/2026-07-28/server/tools.md#structured-content), a JSON value in the `structuredContent` field of the result. The tool in this example returns only text.
413426 
414This execution pattern allows AI applications to dynamically invoke server functionality and receive structured responses that can be integrated into conversations with language models.
427This execution pattern allows AI applications to dynamically invoke server functionality and receive responses that can be integrated into conversations with language models.
415428 
416429#### How This Works in AI Applications
417430 
from line 545
532545This notification system is crucial for several reasons:
533546 
5345471. **Dynamic Environments**: Tools may come and go based on server state, external dependencies, or user permissions
5352. **Efficiency**: Clients don't need to poll for changes; they're notified when updates occur
5363. **Consistency**: Ensures clients always have accurate information about available server capabilities
5482. **Efficiency**: Clients are notified when updates occur, so they can poll less often
5493. **Consistency**: Helps clients keep their view of available server capabilities up to date
5375504. **Real-time Collaboration**: Enables responsive AI applications that can adapt to changing contexts
538551 
539552This notification pattern extends beyond tools to other MCP primitives, enabling comprehensive real-time synchronization between clients and servers.

docs/2026-07-28/learn/client-concepts Changed · +149 / -188 lines

## Deprecated Features ### Roots #### Example: Travel Planning Workspace #### Design Philosophy ### Sampling #### Example: Flight Analysis Tool

from line 6
66 
77## Core Client Features
88 
9In addition to making use of context provided by servers, clients may provide several features to servers. These client features allow server authors to build richer interactions.
9In addition to making use of context provided by servers, clients can provide features to servers, such as [elicitation](https://modelcontextprotocol.io/specification/2026-07-28/client/elicitation.md). These allow server authors to build richer interactions.
1010 
11| Feature | Explanation | Example |
12| - | - | - |
13| **Elicitation** | Elicitation enables servers to request specific information from users during interactions, providing a structured way for servers to gather information on demand. | A server booking travel may ask for the user's preferences on airplane seats, room type or their contact number to finalize a booking. |
14| **Roots** | Roots allow clients to specify which directories servers should focus on, communicating intended scope through a coordination mechanism. Roots are [deprecated](https://modelcontextprotocol.io/specification/2026-07-28/deprecated.md) as of protocol version `2026-07-28`. | A server for booking travel may be given access to a specific directory, from which it can read a user's calendar. |
15| **Sampling** | Sampling allows servers to request LLM completions through the client, enabling an agentic workflow. This approach puts the client in complete control of user permissions and security measures. Sampling is deprecated as of protocol version `2026-07-28`. | A server for booking travel may send a list of flights to an LLM and request that the LLM pick the best flight for the user. |
16 
1711### Elicitation
1812 
19Elicitation enables servers to request specific information from users during interactions, creating more dynamic and responsive workflows.
13Elicitation enables servers to request specific information from users during interactions, creating more dynamic and responsive workflows. For example, a server booking travel may ask for the user's preferences on airplane seats, room type or their contact number to finalize a booking.
2014 
2115#### Overview
2216 
from line 23
2923 
3024Elicitation follows the [Multi Round-Trip Requests](https://modelcontextprotocol.io/specification/2026-07-28/basic/patterns/mrtr.md) (MRTR) pattern. When a server needs user input while processing a request such as `tools/call`, it responds with an `InputRequiredResult` whose `inputRequests` field carries one or more `elicitation/create` requests. The client gathers the input and retries the original request, attaching the collected `inputResponses` and echoing back any `requestState` the server included.
3125 
26Clients declare the modes they support in the `elicitation` capability of each request, and servers must not use any other mode. An empty object (`{}`) declares form mode only, while `{ "form": {}, "url": {} }` declares both.
27 
3228**Elicitation flow:**
3329 
3430```mermaid theme={null}
from line 50
5450 
5551The flow enables dynamic information gathering. Servers can request specific data when needed, users provide information through appropriate UI, and servers complete the retried request with the newly acquired context.
5652 
57**Elicitation request example (delivered inside `InputRequiredResult.inputRequests`):**
53**Elicitation example:**
5854 
59```typescript theme={null}
55The following messages continue building on the [travel planning scenario](https://modelcontextprotocol.io/docs/2026-07-28/learn/server-concepts.md#the-complete-flow). The client calls the `bookVacation` tool:
56 
57```json theme={null}
6058{
61 method: "elicitation/create",
62 params: {
63 mode: "form",
64 message: "Please confirm your Barcelona vacation booking details:",
65 requestedSchema: {
66 type: "object",
67 properties: {
68 confirmBooking: {
69 type: "boolean",
70 description: "Confirm the booking (Flights + Hotel = $3,000)"
71 },
72 seatPreference: {
73 type: "string",
74 enum: ["window", "aisle", "no preference"],
75 description: "Preferred seat type for flights"
76 },
77 roomType: {
78 type: "string",
79 enum: ["sea view", "city view", "garden view"],
80 description: "Preferred room type at hotel"
81 },
82 travelInsurance: {
83 type: "boolean",
84 default: false,
85 description: "Add travel insurance ($150)"
86 }
59 "jsonrpc": "2.0",
60 "id": 1,
61 "method": "tools/call",
62 "params": {
63 "name": "bookVacation",
64 "arguments": {
65 "outboundFlight": "EX101",
66 "returnFlight": "EX102",
67 "hotelId": "beachfront-hotel"
68 },
69 "_meta": {
70 "io.modelcontextprotocol/protocolVersion": "2026-07-28",
71 "io.modelcontextprotocol/clientInfo": {
72 "name": "example-client",
73 "version": "1.0.0"
8774 },
88 required: ["confirmBooking"]
75 "io.modelcontextprotocol/clientCapabilities": {
76 "elicitation": {}
77 }
8978 }
9079 }
9180}
9281```
9382 
94#### Example: Holiday Booking Approval
83The server needs the user to confirm the booking, so it responds with an `InputRequiredResult`. Its `resultType` of `"input_required"` indicates that the client must provide additional input before the server can complete the request:
9584 
96A travel booking server demonstrates elicitation's power through the final booking confirmation process. When a user has selected their ideal vacation package to Barcelona, the server needs to gather final approval and any missing details before proceeding.
97 
98The server elicits booking confirmation with a structured request that includes the trip summary (Barcelona flights June 15-22, beachfront hotel, total \$3,000) and fields for any additional preferences—such as seat selection, room type, or travel insurance options.
99 
100As the booking progresses, the server elicits contact information needed to complete the reservation. It might ask for traveler details for flight bookings, special requests for the hotel, or emergency contact information.
101 
102#### User Interaction Model
103 
104Elicitation interactions are designed to be clear, contextual, and respectful of user autonomy:
105 
106**Request presentation**: Clients display elicitation requests with clear context about which server is asking, why the information is needed, and how it will be used. The request message explains the purpose while the schema provides structure and validation.
107 
108**Response options**: Users can provide the requested information through appropriate UI controls (text fields, dropdowns, checkboxes), decline to provide information with optional explanation, or cancel the entire operation. Clients validate responses against the provided schema before returning them to servers.
109 
110**URL handling**: For URL mode, clients show the full URL and gather explicit consent before opening it, and never fetch the URL automatically. The client only learns whether the user consented. The interaction itself stays between the user and the target site.
111 
112**Privacy considerations**: Servers must not use form mode to request sensitive information such as passwords, API keys, access tokens, or payment credentials. Those interactions belong in URL mode, which keeps the data out of band so it never passes through the client or the LLM context. Clients warn about suspicious requests and let users review form data before sending.
113 
114### Roots
115 
116> [!WARNING]
117>
118> Roots are [deprecated](https://modelcontextprotocol.io/specification/2026-07-28/deprecated.md) as of protocol
119> version `2026-07-28` and scheduled for removal. New implementations should
120> pass directories or files via tool parameters, resource URIs, or server
121> configuration instead.
122 
123Roots define filesystem boundaries for server operations, allowing clients to specify which directories servers should focus on.
124 
125#### Overview
126 
127Roots are a mechanism for clients to communicate filesystem access boundaries to servers. They consist of file URIs that indicate directories where servers can operate, helping servers understand the scope of available files and folders. While roots communicate intended boundaries, they do not enforce security restrictions. Actual security must be enforced at the operating system level, via file permissions and/or sandboxing.
128 
129**Root structure:**
130 
13185```json theme={null}
13286{
133 "uri": "file:///Users/agent/travel-planning",
134 "name": "Travel Planning Workspace"
87 "jsonrpc": "2.0",
88 "id": 1,
89 "result": {
90 "resultType": "input_required",
91 "inputRequests": {
92 "bookingConfirmation": {
93 "method": "elicitation/create",
94 "params": {
95 "mode": "form",
96 "message": "Please confirm your Barcelona vacation booking: flights June 15-22, beachfront hotel, total $3,000.",
97 "requestedSchema": {
98 "type": "object",
99 "properties": {
100 "confirmBooking": {
101 "type": "boolean",
102 "description": "Confirm the booking (Flights + Hotel = $3,000)"
103 },
104 "seatPreference": {
105 "type": "string",
106 "enum": ["window", "aisle", "no preference"],
107 "description": "Preferred seat type for flights"
108 },
109 "roomType": {
110 "type": "string",
111 "enum": ["sea view", "city view", "garden view"],
112 "description": "Preferred room type at hotel"
113 },
114 "travelInsurance": {
115 "type": "boolean",
116 "default": false,
117 "description": "Add travel insurance ($150)"
118 }
119 },
120 "required": ["confirmBooking"]
121 }
122 }
123 }
124 },
125 "requestState": "opaque-string-from-the-server",
126 "_meta": {
127 "io.modelcontextprotocol/serverInfo": {
128 "name": "travel-server",
129 "version": "1.0.0"
130 }
131 }
132 }
135133}
136134```
137135 
138Roots are exclusively filesystem paths and always use the `file://` URI scheme. They help servers understand project boundaries, workspace organization, and accessible directories. The roots list can change as users work with different projects or folders. Servers pick up the updated boundaries the next time they request the roots list.
136After the user fills in the form, the client retries the call with a new `id`. The retry carries the user's answers in `inputResponses`, under the same `bookingConfirmation` key as the server's request, and the exact `requestState` value from the result:
139137 
140#### Example: Travel Planning Workspace
141 
142A travel agent working with multiple client trips benefits from roots to organize filesystem access. Consider a workspace with different directories for various aspects of travel planning.
143 
144The client provides filesystem roots to the travel planning server:
145 
146* `file:///Users/agent/travel-planning` - Main workspace containing all travel files
147* `file:///Users/agent/travel-templates` - Reusable itinerary templates and resources
148* `file:///Users/agent/client-documents` - Client passports and travel documents
149 
150When the agent creates a Barcelona itinerary, well-behaved servers respect these boundaries—accessing templates, saving the new itinerary, and referencing client documents within the specified roots. Servers typically access files within roots by using relative paths from the root directories or by utilizing file search tools that respect the root boundaries.
151 
152If the agent opens an archive folder like `file:///Users/agent/archive/2023-trips`, the client adds it to the roots list, and the server sees the new boundary on its next `roots/list` request.
153 
154For a complete implementation of a server that respects roots, see the [filesystem server](https://github.com/modelcontextprotocol/servers/tree/main/src/filesystem) in the official servers repository.
155 
156#### Design Philosophy
157 
158Roots serve as a coordination mechanism between clients and servers, not a security boundary. The specification requires that servers "SHOULD respect root boundaries," and not that they "MUST enforce" them, because servers run code the client cannot control.
159 
160Roots work best when servers are trusted or vetted, users understand their advisory nature, and the goal is preventing accidents rather than stopping malicious behavior. They excel at context scoping (telling servers where to focus), accident prevention (helping well-behaved servers stay in bounds), and workflow organization (such as managing project boundaries automatically).
161 
162#### User Interaction Model
163 
164Roots are typically managed automatically by host applications based on user actions, though some applications may expose manual root management:
165 
166**Automatic root detection**: When users open folders, clients automatically expose them as roots. Opening a travel workspace allows the client to expose that directory as a root, helping servers understand which itineraries and documents are in scope for the current work.
167 
168**Manual root configuration**: Advanced users can specify roots through configuration. For example, adding `/travel-templates` for reusable resources while excluding directories with financial records.
169 
170### Sampling
171 
172> [!WARNING]
173>
174> Sampling is [deprecated](https://modelcontextprotocol.io/specification/2026-07-28/deprecated.md) as of protocol
175> version `2026-07-28` and scheduled for removal. New implementations should
176> integrate directly with LLM provider APIs instead.
177 
178Sampling allows servers to request language model completions through the client, enabling agentic behaviors while maintaining security and user control.
179 
180#### Overview
181 
182Sampling enables servers to perform AI-dependent tasks without directly integrating with or paying for AI models. Instead, servers can request that the client—which already has AI model access—handle these tasks on their behalf. This approach puts the client in complete control of user permissions and security measures. Because sampling requests occur within the context of other operations—like a tool analyzing data—and are processed as separate model calls, they maintain clear boundaries between different contexts, allowing for more efficient use of the context window.
183 
184Sampling follows the same [Multi Round-Trip Requests](https://modelcontextprotocol.io/specification/2026-07-28/basic/patterns/mrtr.md) flow described under [elicitation](#elicitation), with the `InputRequiredResult` carrying a `sampling/createMessage` request.
185 
186Servers can also request tool use during sampling by including a `tools` array and an optional `toolChoice` field in the request. The tool definitions are scoped to that sampling request and do not need to correspond to tools the server exposes. Clients declare support through the `sampling.tools` capability, and servers must not send tool-enabled sampling requests to clients that have not declared it. See [sampling](https://modelcontextprotocol.io/specification/2026-07-28/client/sampling.md#tools-in-sampling) in the specification for details.
187 
188**Sampling flow:**
189 
190```mermaid theme={null}
191sequenceDiagram
192 participant LLM
193 participant User
194 participant Client
195 participant Server
196 
197 Client->>Server: tools/call (id: 1)
198 Note over Server: Server needs an LLM completion
199 Server-->>Client: InputRequiredResult with sampling/createMessage request
200 
201 Note over Client,User: Human-in-the-loop review
202 Client->>User: Present request for approval
203 User-->>Client: Review and approve/modify
204 
205 Note over Client,LLM: Model interaction
206 Client->>LLM: Forward approved request
207 LLM-->>Client: Return generation
208 
209 Note over Client,User: Response review
210 Client->>User: Present response for approval
211 User-->>Client: Review and approve/modify
212 
213 Note over Client,Server: Retry request with approved response
214 Client->>Server: tools/call (id: 2, inputResponses)
215 Server-->>Client: Final result
138```json theme={null}
139{
140 "jsonrpc": "2.0",
141 "id": 2,
142 "method": "tools/call",
143 "params": {
144 "name": "bookVacation",
145 "arguments": {
146 "outboundFlight": "EX101",
147 "returnFlight": "EX102",
148 "hotelId": "beachfront-hotel"
149 },
150 "inputResponses": {
151 "bookingConfirmation": {
152 "action": "accept",
153 "content": {
154 "confirmBooking": true,
155 "seatPreference": "window",
156 "roomType": "sea view",
157 "travelInsurance": false
158 }
159 }
160 },
161 "requestState": "opaque-string-from-the-server",
162 "_meta": {
163 "io.modelcontextprotocol/protocolVersion": "2026-07-28",
164 "io.modelcontextprotocol/clientInfo": {
165 "name": "example-client",
166 "version": "1.0.0"
167 },
168 "io.modelcontextprotocol/clientCapabilities": {
169 "elicitation": {}
170 }
171 }
172 }
173}
216174```
217175 
218The flow ensures security through multiple human-in-the-loop checkpoints. Users review and can modify both the initial request and the generated response before the client retries the original request with it.
176The server completes the booking and returns a `CallToolResult`. Its `resultType` of `"complete"` indicates that the request completed successfully:
219177 
220**Request parameters example:**
221 
222```typescript theme={null}
178```json theme={null}
223179{
224 messages: [
225 {
226 role: "user",
227 content: {
228 type: "text",
229 text: "Analyze these flight options and recommend the best choice:\n" +
230 "[47 flights with prices, times, airlines, and layovers]\n" +
231 "User preferences: morning departure, max 1 layover"
180 "jsonrpc": "2.0",
181 "id": 2,
182 "result": {
183 "resultType": "complete",
184 "content": [
185 {
186 "type": "text",
187 "text": "Booked flights EX101 and EX102 and a sea view room at the beachfront hotel."
232188 }
189 ],
190 "_meta": {
191 "io.modelcontextprotocol/serverInfo": {
192 "name": "travel-server",
193 "version": "1.0.0"
194 }
233195 }
234 ],
235 modelPreferences: {
236 hints: [{
237 name: "claude-sonnet" // Prefer Sonnet-class models
238 }],
239 costPriority: 0.3, // Less concerned about API cost
240 speedPriority: 0.2, // Can wait for thorough analysis
241 intelligencePriority: 0.9 // Need complex trade-off evaluation
242 },
243 systemPrompt: "You are a travel expert helping users find the best flights based on their preferences",
244 maxTokens: 1500
196 }
245197}
246198```
247199 
248#### Example: Flight Analysis Tool
200#### Example: Holiday Booking Approval
249201 
250Consider a travel booking server with a tool called `findBestFlight` that uses sampling to analyze available flights and recommend the optimal choice. When a user asks "Book me the best flight to Barcelona next month," the tool needs AI assistance to evaluate complex trade-offs.
202A travel booking server demonstrates elicitation's power through the final booking confirmation process. When a user has selected their ideal vacation package to Barcelona, the server needs to gather final approval and any missing details before proceeding.
251203 
252The tool queries airline APIs and gathers 47 flight options. It then requests AI assistance to analyze these options: "Analyze these flight options and recommend the best choice: \[47 flights with prices, times, airlines, and layovers] User preferences: morning departure, max 1 layover."
204The server elicits booking confirmation with a structured request that includes the trip summary (Barcelona flights June 15-22, beachfront hotel, total \$3,000) and fields for any additional preferences—such as seat selection, room type, or travel insurance options.
253205 
254The client initiates the sampling request, allowing the AI to evaluate trade-offs—like cheaper red-eye flights versus convenient morning departures. The tool uses this analysis to present the top three recommendations.
206As the booking progresses, the server elicits contact information needed to complete the reservation. It might ask for traveler details for flight bookings, special requests for the hotel, or emergency contact information.
255207 
256208#### User Interaction Model
257209 
258While not a requirement, sampling is designed to allow human-in-the-loop control. Users can maintain oversight through several mechanisms:
210Elicitation interactions are designed to be clear, contextual, and respectful of user autonomy:
259211 
260**Approval controls**: Sampling requests may require explicit user consent. Clients can show what the server wants to analyze and why. Users can approve, deny, or modify requests.
212**Request presentation**: Clients display elicitation requests with clear context about which server is asking, why the information is needed, and how it will be used. The request message explains the purpose while the schema provides structure and validation.
261213 
262**Transparency features**: Clients can display the exact prompt, model selection, and token limits, allowing users to review AI responses before they return to the server.
214**Response options**: Users can provide the requested information through appropriate UI controls (text fields, dropdowns, checkboxes), explicitly decline to provide it, or dismiss the request without making a choice. These map to the `accept`, `decline`, and `cancel` actions. Clients validate responses against the provided schema before returning them to servers.
263215 
264**Configuration options**: Users can set model preferences, configure auto-approval for trusted operations, or require approval for everything. Clients may provide options to redact sensitive information.
216**URL handling**: For URL mode, clients show the full URL and gather explicit consent before opening it, and never fetch the URL automatically. The client only learns whether the user consented. The interaction itself stays between the user and the target site.
265217 
266**Security considerations**: Both clients and servers must handle sensitive data appropriately during sampling. Clients should implement rate limiting and validate all message content. The human-in-the-loop design ensures that server-requested AI interactions cannot compromise security or access sensitive data without explicit user consent.
218**Privacy considerations**: Servers must not use form mode to request sensitive information such as passwords, API keys, access tokens, or payment credentials. Those interactions belong in URL mode, which keeps the data out of band so it never passes through the client or the LLM context. Clients warn about suspicious requests and let users review form data before sending.
219 
220## Deprecated Features
221 
222> [!WARNING]
223>
224> Roots and sampling are [deprecated](https://modelcontextprotocol.io/specification/2026-07-28/deprecated.md) as of protocol version `2026-07-28` and scheduled for removal. New implementations should use the following alternatives:
225>
226> * **Roots**: Pass directories or files through tool parameters, resource URIs, or server configuration.
227> * **Sampling**: Integrate directly with LLM provider APIs. The protocol does not define a replacement for requesting completions through the client.
267228 

docs/2026-07-28/learn/server-concepts Changed · +360 / -81 lines

The two sides of this change are more than 400 edits apart, too far apart to line up, so this is the differ's own diff of it and the words inside a line are not marked.

from line 14
1414| **Resources** | Passive data sources that provide read-only access to information for context, such as file contents, database schemas, or API documentation. | Retrieve documents Access knowledge bases Read calendars | Application |
1515| **Prompts** | Pre-built instruction templates that tell the model to work with specific tools and resources. | Plan a vacation Summarize my meetings Draft an email | User |
1616 
17We will use a hypothetical scenario to demonstrate the role of each of these features, and show how they can work together.
17We will use a hypothetical scenario to demonstrate the role of each of these features, and show how they can work together. Examples with a `jsonrpc` field are complete messages, and the rest are excerpts.
18 
19Every request carries the [protocol version and client capabilities](https://modelcontextprotocol.io/docs/2026-07-28/learn/architecture.md#statelessness-and-discovery) in `_meta`, and every result has a [`resultType`](https://modelcontextprotocol.io/specification/2026-07-28/basic/index#responses).
1820 
1921### Tools
2022 
from line 33
3133| `tools/list` | Discover available tools | Array of tool definitions with schemas |
3234| `tools/call` | Execute a specific tool | Tool execution result |
3335 
34**Example tool definition:**
35 
36```typescript theme={null}
37{
38 name: "searchFlights",
39 description: "Search for available flights",
40 inputSchema: {
41 type: "object",
42 properties: {
43 origin: { type: "string", description: "Departure city" },
44 destination: { type: "string", description: "Arrival city" },
45 date: { type: "string", format: "date", description: "Travel date" }
46 },
47 required: ["origin", "destination", "date"]
36**Example tool definition, as returned by `tools/list`:**
37 
38```json theme={null}
39{
40 "name": "searchFlights",
41 "title": "Search Flights",
42 "description": "Search for available flights",
43 "inputSchema": {
44 "type": "object",
45 "properties": {
46 "origin": { "type": "string", "description": "Departure city" },
47 "destination": { "type": "string", "description": "Arrival city" },
48 "date": {
49 "type": "string",
50 "format": "date",
51 "description": "Travel date"
52 }
53 },
54 "required": ["origin", "destination", "date"]
55 },
56 "outputSchema": {
57 "type": "object",
58 "properties": {
59 "flights": {
60 "type": "array",
61 "items": {
62 "type": "object",
63 "properties": {
64 "flightNumber": { "type": "string" },
65 "priceUsd": { "type": "number" }
66 },
67 "required": ["flightNumber", "priceUsd"]
68 }
69 }
70 },
71 "required": ["flights"]
4872 }
4973}
5074```
from line 79
5579 
5680**Flight Search**
5781 
58```
59searchFlights(origin: "NYC", destination: "Barcelona", date: "2024-06-15")
60```
61 
62Queries multiple airlines and returns structured flight options.
82Queries multiple airlines and returns structured flight options. The arguments in the `tools/call` request conform to the tool's `inputSchema`:
83 
84```json theme={null}
85{
86 "jsonrpc": "2.0",
87 "id": 1,
88 "method": "tools/call",
89 "params": {
90 "name": "searchFlights",
91 "arguments": {
92 "origin": "New York",
93 "destination": "Barcelona",
94 "date": "2027-06-15"
95 },
96 "_meta": {
97 "io.modelcontextprotocol/protocolVersion": "2026-07-28",
98 "io.modelcontextprotocol/clientInfo": {
99 "name": "example-client",
100 "version": "1.0.0"
101 },
102 "io.modelcontextprotocol/clientCapabilities": { "elicitation": {} }
103 }
104 }
105}
106```
107 
108The result's `structuredContent` conforms to the tool's `outputSchema`. For backwards compatibility, the result also includes the serialized JSON as text:
109 
110```json theme={null}
111{
112 "jsonrpc": "2.0",
113 "id": 1,
114 "result": {
115 "resultType": "complete",
116 "content": [
117 {
118 "type": "text",
119 "text": "{\"flights\":[{\"flightNumber\":\"EX101\",\"priceUsd\":640}]}"
120 }
121 ],
122 "structuredContent": {
123 "flights": [{ "flightNumber": "EX101", "priceUsd": 640 }]
124 },
125 "_meta": {
126 "io.modelcontextprotocol/serverInfo": {
127 "name": "travel-server",
128 "version": "1.0.0"
129 }
130 }
131 }
132}
133```
134 
135The other tools are called the same way, with their own `name` and `arguments`.
63136 
64137**Calendar Blocking**
65138 
66```
67createCalendarEvent(title: "Barcelona Trip", startDate: "2024-06-15", endDate: "2024-06-22")
68```
69 
70139Marks the travel dates in the user's calendar.
71140 
141```json theme={null}
142{
143 "name": "createCalendarEvent",
144 "arguments": {
145 "title": "Barcelona Trip",
146 "startDate": "2027-06-15",
147 "endDate": "2027-06-22"
148 }
149}
150```
151 
72152**Email notification**
73153 
74```
75sendEmail(to: "[email protected]", subject: "Out of Office", body: "...")
76```
77 
78154Sends an automated out-of-office message to colleagues.
155 
156```json theme={null}
157{
158 "name": "sendEmail",
159 "arguments": {
160 "to": "[email protected]",
161 "subject": "Out of Office",
162 "body": "I am out of the office from June 15 to June 22."
163 }
164}
165```
79166 
80167#### User Interaction Model
81168 
from line 183
96183 
97184Resources expose data from files, APIs, databases, or any other source that an AI needs to understand context. Applications can access this information directly and decide how to use it - whether that's selecting relevant portions, searching with embeddings, or passing it all to the model.
98185 
99Each resource has a unique URI (e.g., `file:///path/to/document.md`) and declares its MIME type for appropriate content handling.
186Each resource has a unique URI (e.g., `file:///path/to/document.md`) and can declare its MIME type for appropriate content handling.
100187 
101188Resources support two discovery patterns:
102189 
103* **Direct Resources** - fixed URIs that point to specific data. Example: `calendar://events/2024` - returns calendar availability for 2024
104* **Resource Templates** - dynamic URIs with parameters for flexible queries. Example:
105 * `travel://activities/{city}/{category}` - returns activities by city and category
106 * `travel://activities/barcelona/museums` - returns all museums in Barcelona
107 
108Resource Templates include metadata such as title, description, and expected MIME type, making them discoverable and self-documenting.
190* **Direct Resources** - fixed URIs that point to specific data. Example: `calendar://events/2027-06` - returns calendar availability for June 2027
191* **Resource Templates** - parameterized URIs for flexible queries. Example: `travel://activities/{city}/{category}` - returns activities by city and category. For example, `travel://activities/Barcelona/museums` returns all museums in Barcelona
192 
193Resource Templates can include metadata such as title, description, and expected MIME type, making them discoverable and self-documenting.
109194 
110195**Protocol operations:**
111196 
from line 199
114199| `resources/list` | List available direct resources | Array of resource descriptors |
115200| `resources/templates/list` | Discover resource templates | Array of resource template definitions |
116201| `resources/read` | Retrieve resource contents | Resource data with metadata |
202| `completion/complete` | Suggest parameter values | Array of suggested values |
117203| `subscriptions/listen` | Monitor resource changes | Stream of update notifications |
118204 
119To watch specific resources for changes, a client sends a [`subscriptions/listen`](https://modelcontextprotocol.io/specification/2026-07-28/basic/patterns/subscriptions) request with the resource URIs listed in the `resourceSubscriptions` filter. The server delivers `notifications/resources/updated` on the resulting stream whenever a watched resource changes.
205To watch specific resources for changes, a client sends a [`subscriptions/listen`](https://modelcontextprotocol.io/specification/2026-07-28/basic/patterns/subscriptions) request with the resource URIs listed in the `resourceSubscriptions` filter. Servers that support update notifications for individual resources declare `"subscribe": true` in their `resources` capability. The server delivers `notifications/resources/updated` on the resulting stream whenever a watched resource changes.
120206 
121207#### Example: Getting Travel Planning Context
122208 
123209Continuing with the travel planning example, resources provide the AI application with access to relevant information:
124210 
125* **Calendar data** (`calendar://events/2024`) - Checks user availability
211* **Calendar data** (`calendar://events/2027-06`) - Checks user availability
126212* **Travel documents** (`file:///Documents/Travel/passport.pdf`) - Accesses important documents
127* **Previous itineraries** (`trips://history/barcelona-2023`) - References past trips and preferences
213* **Travel preferences** (`travel://preferences/europe`) - Looks up preferred airlines and hotel types
214* **Previous itineraries** (`travel://past-trips/spain-2023`) - References past trips
215* **Weather forecast** (`weather://forecast/Barcelona/2027-06-15`) - Looks up the weather for a travel date
128216 
129217The AI application retrieves these resources and decides how to process them, whether selecting a subset of data using embeddings or keyword search, or passing raw data directly to the model.
130218 
131In this case, it provides calendar data, weather information, and travel preferences to the model, enabling it to check availability, look up weather patterns, and reference past travel preferences.
132 
133**Resource Template Examples:**
219In this case, it provides calendar data, weather information, travel preferences, and past trips to the model, enabling it to check availability, look up weather patterns, and follow the user's preferences.
220 
221The AI application reads each resource with a `resources/read` request:
222 
223```json theme={null}
224{
225 "jsonrpc": "2.0",
226 "id": 2,
227 "method": "resources/read",
228 "params": {
229 "uri": "calendar://events/2027-06",
230 "_meta": {
231 "io.modelcontextprotocol/protocolVersion": "2026-07-28",
232 "io.modelcontextprotocol/clientInfo": {
233 "name": "example-client",
234 "version": "1.0.0"
235 },
236 "io.modelcontextprotocol/clientCapabilities": {
237 "elicitation": {}
238 }
239 }
240 }
241}
242```
243 
244The result contains the resource contents and two [caching hints](https://modelcontextprotocol.io/specification/2026-07-28/server/utilities/caching.md). `ttlMs` is how long the client may consider the result fresh, in milliseconds, and a `cacheScope` of `"private"` means that caches must not share it across authorization contexts:
245 
246```json theme={null}
247{
248 "jsonrpc": "2.0",
249 "id": 2,
250 "result": {
251 "resultType": "complete",
252 "contents": [
253 {
254 "uri": "calendar://events/2027-06",
255 "mimeType": "application/json",
256 "text": "{\"busy\":[{\"startDate\":\"2027-06-03\",\"endDate\":\"2027-06-04\"}]}"
257 }
258 ],
259 "ttlMs": 60000,
260 "cacheScope": "private",
261 "_meta": {
262 "io.modelcontextprotocol/serverInfo": {
263 "name": "calendar-email-server",
264 "version": "1.0.0"
265 }
266 }
267 }
268}
269```
270 
271**Resource template examples:**
272 
273From a weather server:
134274 
135275```json theme={null}
136276{
from line 280
140280 "description": "Get weather forecast for any city and date",
141281 "mimeType": "application/json"
142282}
143 
283```
284 
285From a travel server:
286 
287```json theme={null}
144288{
145289 "uriTemplate": "travel://flights/{origin}/{destination}",
146290 "name": "flight-search",
147291 "title": "Flight Search",
148 "description": "Search available flights between cities",
292 "description": "Search available flights between two airports",
149293 "mimeType": "application/json"
150294}
151295```
152296 
153These templates enable flexible queries. For weather data, users can access forecasts for any city/date combination. For flights, they can search routes between any two airports. When a user has input "NYC" as the `origin` airport and begins to input "Bar" as the `destination` airport, the system can suggest "Barcelona (BCN)" or "Barbados (BGI)".
297These templates enable flexible queries. For weather data, users can access forecasts for any city/date combination. For flights, they can search routes between any two airports.
154298 
155299#### Parameter Completion
156300 
157Dynamic resources support parameter completion. For example:
158 
159* Typing "Par" as input for `weather://forecast/{city}` might suggest "Paris" or "Park City"
160* Typing "JFK" for `flights://search/{airport}` might suggest "JFK - John F. Kennedy International"
301Servers that declare the `completions` capability can suggest values for template parameters. For example:
302 
303* Typing "Par" for `city` in `weather://forecast/{city}/{date}` might suggest "Paris" or "Park City"
304* Typing "JF" for `origin` in `travel://flights/{origin}/{destination}` might suggest "JFK"
305 
306When a template has multiple parameters, clients should include the values that are already resolved in `context.arguments`, so the server can narrow its suggestions. Here, the user has chosen `JFK` as the `origin` and typed "Bar" for the `destination`:
307 
308```json theme={null}
309{
310 "jsonrpc": "2.0",
311 "id": 3,
312 "method": "completion/complete",
313 "params": {
314 "ref": {
315 "type": "ref/resource",
316 "uri": "travel://flights/{origin}/{destination}"
317 },
318 "argument": {
319 "name": "destination",
320 "value": "Bar"
321 },
322 "context": {
323 "arguments": {
324 "origin": "JFK"
325 }
326 },
327 "_meta": {
328 "io.modelcontextprotocol/protocolVersion": "2026-07-28",
329 "io.modelcontextprotocol/clientInfo": {
330 "name": "example-client",
331 "version": "1.0.0"
332 },
333 "io.modelcontextprotocol/clientCapabilities": { "elicitation": {} }
334 }
335 }
336}
337```
338 
339The server suggests the airport codes for Barcelona and Barbados, which both have flights from JFK:
340 
341```json theme={null}
342{
343 "jsonrpc": "2.0",
344 "id": 3,
345 "result": {
346 "resultType": "complete",
347 "completion": {
348 "values": ["BCN", "BGI"],
349 "total": 2,
350 "hasMore": false
351 },
352 "_meta": {
353 "io.modelcontextprotocol/serverInfo": {
354 "name": "travel-server",
355 "version": "1.0.0"
356 }
357 }
358 }
359}
360```
161361 
162362The system helps discover valid values without requiring exact format knowledge.
163363 
from line 384
184384 
185385| Method | Purpose | Returns |
186386| - | - | - |
187| `prompts/list` | Discover available prompts | Array of prompt descriptors |
188| `prompts/get` | Retrieve prompt details | Full prompt definition with arguments |
387| `prompts/list` | Discover available prompts | Array of prompt definitions, including the arguments each one accepts |
388| `prompts/get` | Retrieve a prompt | Array of prompt messages |
389| `completion/complete` | Suggest argument values | Array of suggested values |
189390 
190391#### Example: Streamlined Workflows
191392 
192393Prompts provide structured templates for common tasks. In the travel planning context:
193394 
194**"Plan a vacation" prompt:**
395**"Plan a vacation" prompt, as returned by `prompts/list`:**
195396 
196397```json theme={null}
197398{
from line 400
199400 "title": "Plan a vacation",
200401 "description": "Guide through vacation planning process",
201402 "arguments": [
202 { "name": "destination", "type": "string", "required": true },
203 { "name": "duration", "type": "number", "description": "days" },
204 { "name": "budget", "type": "number", "required": false },
205 { "name": "interests", "type": "array", "items": { "type": "string" } }
403 {
404 "name": "origin",
405 "description": "City to depart from",
406 "required": true
407 },
408 {
409 "name": "destination",
410 "description": "City to visit",
411 "required": true
412 },
413 {
414 "name": "departureDate",
415 "description": "First day of the trip, as YYYY-MM-DD",
416 "required": true
417 },
418 {
419 "name": "returnDate",
420 "description": "Last day of the trip, as YYYY-MM-DD",
421 "required": true
422 },
423 {
424 "name": "budget",
425 "description": "Total budget in USD",
426 "required": false
427 },
428 {
429 "name": "travelers",
430 "description": "Number of travelers",
431 "required": false
432 },
433 {
434 "name": "interests",
435 "description": "Comma-separated list of interests"
436 }
206437 ]
207438}
208439```
209440 
441Prompt arguments don't have types. Every value is sent as a string, so use `description` to specify the expected format. Arguments are optional unless `required` is `true`.
442 
210443Rather than unstructured natural language input, the prompt system enables:
211444 
2124451. Selection of the "Plan a vacation" template
2132. Structured input: Barcelona, 7 days, \$3000, \["beaches", "architecture", "food"]
4462. Structured input: New York to Barcelona, June 15-22, \$3000, 2 travelers, interested in beaches, architecture, and food
2144473. Consistent workflow execution based on the template
215448 
216449#### User Interaction Model
from line 478
245478 
2464791. **User invokes a prompt with parameters:**
247480 
481 The user picks "Plan a vacation" and fills in its arguments. The client sends a `prompts/get` request to the Travel Server:
482 
248483 ```json theme={null}
249484 {
250 "prompt": "plan-vacation",
251 "arguments": {
252 "destination": "Barcelona",
253 "departure_date": "2024-06-15",
254 "return_date": "2024-06-22",
255 "budget": 3000,
256 "travelers": 2
485 "jsonrpc": "2.0",
486 "id": 4,
487 "method": "prompts/get",
488 "params": {
489 "name": "plan-vacation",
490 "arguments": {
491 "origin": "New York",
492 "destination": "Barcelona",
493 "departureDate": "2027-06-15",
494 "returnDate": "2027-06-22",
495 "budget": "3000",
496 "travelers": "2",
497 "interests": "beaches, architecture, food"
498 },
499 "_meta": {
500 "io.modelcontextprotocol/protocolVersion": "2026-07-28",
501 "io.modelcontextprotocol/clientInfo": {
502 "name": "example-client",
503 "version": "1.0.0"
504 },
505 "io.modelcontextprotocol/clientCapabilities": { "elicitation": {} }
506 }
257507 }
258508 }
259509 ```
260510 
511 The server returns messages that the AI application adds to the conversation:
512 
513 ```json theme={null}
514 {
515 "jsonrpc": "2.0",
516 "id": 4,
517 "result": {
518 "resultType": "complete",
519 "description": "Guide through vacation planning process",
520 "messages": [
521 {
522 "role": "user",
523 "content": {
524 "type": "text",
525 "text": "Plan a vacation from New York to Barcelona for 2 travelers, from 2027-06-15 to 2027-06-22, with a total budget of $3000. Interests: beaches, architecture, food.\n\nUse the calendar, travel preferences, and past trips provided as context. Search for flights and hotels within the budget, and check the weather for the travel dates. Propose one package. After the user agrees, book it, add the trip to the calendar, and email a confirmation."
526 }
527 }
528 ],
529 "_meta": {
530 "io.modelcontextprotocol/serverInfo": {
531 "name": "travel-server",
532 "version": "1.0.0"
533 }
534 }
535 }
536 }
537 ```
538 
2615392. **User selects resources to include:**
262 * `calendar://my-calendar/June-2024` (from Calendar Server)
540 * `calendar://events/2027-06` (from Calendar/Email Server)
263541 * `travel://preferences/europe` (from Travel Server)
264 * `travel://past-trips/Spain-2023` (from Travel Server)
542 * `travel://past-trips/spain-2023` (from Travel Server)
265543 
2665443. **AI processes the request using tools:**
267545 
268 The AI first reads all selected resources to gather context - identifying available dates from the calendar, learning preferred airlines and hotel types from travel preferences, and discovering previously enjoyed locations from past trips.
269 
270 Using this context, the AI then executes the prompt provided by the AI application. In our example, the AI application exposes the weather tools from the connected MCP weather server to the model. Because weather can affect travel plans, the AI chooses to call `checkWeather()` when interpreting the prompt.
271 
272 As a result the AI executes a series of tools:
273 
274 * `searchFlights()` - Queries airlines for NYC to Barcelona flights
275 * `checkWeather()` - Retrieves climate forecasts for travel dates
276 
277 The AI then uses this information to create the booking and following steps, requesting approval from the user where necessary:
278 
279 * `bookHotel()` - Finds hotels within the specified budget
280 * `createCalendarEvent()` - Adds the trip to the user's calendar
281 * `sendEmail()` - Sends confirmation with trip details
282 
283**The result:** Through multiple MCP servers, the user researched and booked a Barcelona trip tailored to their schedule. The "Plan a Vacation" prompt guided the AI to combine Resources (calendar availability and travel history) with Tools (searching flights, booking hotels, updating calendars) across different servers—gathering context and executing the booking. A task that could have taken hours was completed in minutes using MCP.
546 The AI application first reads all selected resources to gather context for the model - identifying available dates from the calendar, learning preferred airlines and hotel types from travel preferences, and discovering previously enjoyed locations from past trips.
547 
548 Using this context, the model then follows the prompt provided by the Travel Server. The AI application exposes the tools from all three servers to the model, so a prompt from the Travel Server can lead the model to call `checkWeather` on the Weather Server.
549 
550 As a result, the model calls a series of tools:
551 
552 * `searchFlights` (from Travel Server) - Queries airlines for New York to Barcelona flights
553 * `searchHotels` (from Travel Server) - Finds hotels within the specified budget
554 * `checkWeather` (from Weather Server) - Retrieves climate forecasts for travel dates
555 
556 The model then uses this information to create the booking and following steps, with the AI application requesting approval from the user where necessary:
557 
558 * `bookVacation` (from Travel Server) - Books the flights and hotel. The server asks the user to confirm the booking through [elicitation](https://modelcontextprotocol.io/docs/2026-07-28/learn/client-concepts.md#elicitation)
559 * `createCalendarEvent` (from Calendar/Email Server) - Adds the trip to the user's calendar
560 * `sendEmail` (from Calendar/Email Server) - Sends confirmation with trip details
561 
562**The result:** Through multiple MCP servers, the user researched and booked a Barcelona trip tailored to their schedule. The "Plan a vacation" prompt guided the AI to combine Resources (calendar availability and travel history) with Tools (searching flights and hotels, booking them, updating the calendar) across different servers—gathering context and executing the booking. A task that could have taken hours was completed in minutes using MCP.
284563 

docs/2026-07-28/tools/debugging Changed · +22 / -21 lines

from line 18
1818 notification stream. This should be your first stop.
19192. **Server logging**: structured logs to stderr (stdio transport) or via
2020 [OpenTelemetry](https://opentelemetry.io/) (all transports).
21 [Logging](https://modelcontextprotocol.io/specification/2026-07-28/server/utilities/logging.md) over the protocol
22 (`notifications/message`) is deprecated as of protocol version `2026-07-28`.
21 Logging over the protocol (`notifications/message`) is
22 [deprecated](https://modelcontextprotocol.io/specification/2026-07-28/deprecated.md) as of protocol version `2026-07-28`.
23233. **Client developer tools**: most MCP clients expose logs and connection
2424 state. See [Debugging in Claude Desktop](#debugging-in-claude-desktop)
2525 below for one example, or consult your client's documentation.
from line 45
4545tooling (curl, browser DevTools Network panel) to inspect requests and SSE
4646streams.
4747 
48> [!WARNING]
49>
50> The `notifications/message` mechanism below is deprecated as of protocol
51> version `2026-07-28`. It remains available during the deprecation window.
52 
5348For all [transports](https://modelcontextprotocol.io/specification/latest/basic/transports.md), record what the
54server is doing as it runs:
49server is doing as it runs. For example, to write to stderr:
5550 
5651```python Python theme={null}
5752import logging
from line 66
7166```
7267 
7368```typescript TypeScript theme={null}
74await server.sendLoggingMessage({
75 level: "info",
76 data: "Server started successfully",
77});
78```
69import { McpServer } from "@modelcontextprotocol/server";
70import { z } from "zod";
7971 
80MCP defines eight
81[RFC 5424 severity levels](https://modelcontextprotocol.io/specification/latest/server/utilities/logging.md#log-levels)
82(`debug` through `emergency`). Clients opt in to log messages per request by
83setting the
84[`io.modelcontextprotocol/logLevel`](https://modelcontextprotocol.io/specification/2026-07-28/server/utilities/logging#per-request-log-level)
85field in the request's `_meta`. Servers must not send `notifications/message`
86for requests that omit this field.
72const server = new McpServer({ name: "reports", version: "1.0.0" });
73 
74server.registerTool(
75 "fetch_report",
76 {
77 description: "Fetch a report by id.",
78 inputSchema: z.object({ reportId: z.string() }),
79 },
80 async ({ reportId }) => {
81 console.error(`Fetching report ${reportId}`);
82 return {
83 content: [{ type: "text", text: `Report ${reportId} is ready.` }],
84 };
85 },
86);
87```
8788 
8889Important events to log:
8990 

docs/2026-07-28/tutorials/security/authorization Changed · +15 / -32 lines

### Dynamic Client Registration

from line 39
3939 M-->>C: authorization_servers, scopes_supported
4040 C->>A: GET authorization server metadata
4141 A-->>C: Endpoints and capabilities
42 Note over C,A: Client identifies itself:<br/>pre-registered ID, metadata document, or DCR
42 Note over C,A: Client identifies itself:<br/>pre-registered ID or metadata document
4343 Note over C: Record the issuer
4444 C->>B: Open authorization URL<br/>(PKCE challenge, resource, scope)
4545 B->>A: User logs in and consents
from line 194
194194| - | - |
195195| **Pre-registration** | The client already has credentials for this authorization server |
196196| **Client ID Metadata Documents** | Client and server have no prior relationship (most common) |
197| **Dynamic Client Registration** | Deprecated. For authorization servers that don't support Client ID Metadata Documents |
198197 
199A client that supports all three should try them in that order. If none is available, it should ask the user to enter the client information. See [Client Registration](https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization/client-registration.md).
198A client that supports both should try them in that order. If neither is available, it should ask the user to enter the client ID, and the client secret if there is one, of a client registered with the authorization server. See [Client Registration](https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization/client-registration.md).
200199 
200> [!WARNING]
201>
202> Dynamic Client Registration (DCR) is [deprecated](https://modelcontextprotocol.io/specification/2026-07-28/deprecated.md) as of protocol version `2026-07-28`. New implementations should use [Client ID Metadata Documents](#client-id-metadata-documents) (CIMD) instead.
203>
204> Existing clients can [fall back to DCR](https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization/client-registration.md#dynamic-client-registration) before asking the user for a client ID and secret. This is applicable if the authorization server doesn't support CIMD and allows clients to register at runtime through its `registration_endpoint`.
205 
201206### Client ID Metadata Documents
202207 
203208With a [Client ID Metadata Document](https://datatracker.ietf.org/doc/html/draft-ietf-oauth-client-id-metadata-document-00) (CIMD), the client uses an HTTPS URL as its `client_id` and hosts a JSON document there. The authorization server fetches the document and validates it when it receives an authorization request.
from line 226
221226 
222227The client ID is set up in advance, along with credentials if they're needed. They can be built into the client or entered by the user.
223228 
224### Dynamic Client Registration
229Credentials belong to the authorization server that issued them. Clients must store them by `issuer` and never use them with another one. See [Authorization Server Binding](https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization/client-registration.md#authorization-server-binding).
225230 
226> [!WARNING]
227>
228> Dynamic Client Registration (DCR) is deprecated. New implementations should
229> use Client ID Metadata Documents instead. DCR remains available for backwards
230> compatibility with authorization servers that don't support them.
231 
232With [DCR](https://datatracker.ietf.org/doc/html/rfc7591), the client posts its metadata to the authorization server's `registration_endpoint` and receives a client ID. Clients must include an appropriate `application_type`:
233 
234```json theme={null}
235{
236 "client_name": "Example MCP Client",
237 "redirect_uris": ["http://127.0.0.1:8090/callback"],
238 "grant_types": ["authorization_code", "refresh_token"],
239 "response_types": ["code"],
240 "token_endpoint_auth_method": "none",
241 "application_type": "native"
242}
243```
244 
245Pre-registered and DCR credentials belong to the authorization server that issued them. Clients must store them by `issuer` and never use them with another one. See [Authorization Server Binding](https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization/client-registration.md#authorization-server-binding).
246 
247231## Choosing an Authorization Server
248232 
249Use an existing identity provider or authorization server product. Client registration happens between the client and the authorization server, so your MCP server needs no CIMD or DCR code.
233Use an existing identity provider or authorization server product. Client registration happens between the client and the authorization server, so your MCP server needs no registration code.
250234 
251235Check these points before you choose one:
252236 
from line 714
730714 
731715Also open your `METADATA_URL` and check that it contains `code_challenge_methods_supported`. Some clients work without it and others refuse to connect.
732716 
733Then run the full flow with the [MCP Inspector](https://modelcontextprotocol.io/docs/2026-07-28/tools/inspector/authorization.md), which needs Node.js 22.19 or later. The command below opens a browser for login and calls the tool:
717Then run the full flow with the [MCP Inspector](https://modelcontextprotocol.io/docs/2026-07-28/tools/inspector/authorization.md), which needs Node.js 22.23.4+, 24.22.1+, or 26.12.1+. The command below runs the login flow and calls the tool:
734718 
735719```bash theme={null}
736720npx @modelcontextprotocol/inspector --cli http://localhost:3000/mcp --transport http \
from line 725
741725 
742726`--protocol-era modern` makes the Inspector use the 2026-07-28 protocol.
743727 
744The Inspector's redirect URI is `http://127.0.0.1:6276/oauth/callback`. `--client-metadata-url` is the URL of a metadata document that you host, with this redirect URI in its `redirect_uris`. If your authorization server supports DCR and accepts registration from your machine, you can leave this option out. For a pre-registered client, register the redirect URI and use `--client-id` instead, with `--client-secret` if the client has a secret.
728By default, the Inspector's redirect URI is `http://127.0.0.1:6276/oauth/callback` (change it with `--callback-url`; it must be a loopback address). `--client-metadata-url` is the URL of a metadata document that you host, with this redirect URI in its `redirect_uris`. The authorization server must be able to fetch it. For a pre-registered client, register the redirect URI and use `--client-id` instead, with `--client-secret` if the client has a secret.
745729 
746730You can also connect from a client such as [Visual Studio Code](https://code.visualstudio.com). Run **MCP: Add Server** from the Command Palette, choose HTTP, and enter `http://localhost:3000/mcp`.
747731 
from line 737
753737> * **The metadata document is invalid.** Its `client_id` must be identical to its URL, including any trailing slash. The redirect URI in the request must be in `redirect_uris`. Authorization servers should accept any port for a loopback IP address, but some compare the port too.
754738> * **The authorization server rejects the `resource` value.** Register your server's URL exactly as clients send it, including the path and any trailing slash. The error might be `invalid_target`.
755739> * **The Inspector prints `auth_required` after a successful login.** Your server refused the new token. The command prints the same message for a `401` and a `403`. To see which one it is, send the token with `curl -i -X POST http://localhost:3000/mcp -H "Content-Type: application/json" -H "Authorization: Bearer <token>"`.
756> * **The Inspector still fails after you fix the configuration.** It keeps tokens and registered clients between runs. Add `--relogin` to discard them.
740> * **The Inspector still fails after you fix the configuration.** It keeps tokens and client details between runs. Add `--relogin` to discard them.
757741> * **Every token gets a `401`.** Decode a test token. `iss` must be exactly the same as `ISSUER`, and `aud` must contain exactly the expected audience, `http://localhost:3000/mcp` in the examples. If the token isn't a JWT, see [Opaque Tokens](#opaque-tokens). Check too that the clocks of the two servers agree.
758742> * **Every token gets a `403`.** If the response has an `insufficient_scope` error, the token's `scope` claim doesn't contain `mcp:tools`. Some authorization servers use a claim such as `scp`, or an array instead of a string. Change the code that reads the claim. If the token uses a shorter name than clients request, convert it to the full name there. If there is no such error, the `Host` or `Origin` header might have been refused. For a refused `Host`, the Python SDK answers `421` and ASP.NET Core answers `400`.
759743> * **The client refuses to start the flow.** Check that the authorization server metadata has `code_challenge_methods_supported` and that its `issuer` matches the PRM document.
from line 761
777761* **Return `5xx` during an outage**. If your server can't reach the JWKS or introspection endpoint, return a `5xx` status, as the TypeScript and Python examples do. The C# example does this only until it has downloaded the keys once. A `401` makes users log in again, and that doesn't fix the problem.
778762* **Separate client and server credentials**. Don't use your MCP server's introspection credentials in end-user flows.
779763* **Don't log credentials**. Remove `Authorization` headers, tokens, authorization codes, and secrets from your logs. Return generic errors to clients and keep the details in your own logs.
780* **Restrict Dynamic Client Registration**. Anyone can register with an open `registration_endpoint`, so add controls such as trusted hosts and rate limits.
764* **Restrict Dynamic Client Registration**. If your authorization server supports [DCR](#client-registration-approaches) with an open `registration_endpoint`, anyone can register a client. Disable DCR if your clients don't depend on it. Otherwise, restrict registration with controls such as trusted hosts and rate limits.
781765 
782766## Related Standards and Documentation
783767 
from line 774
790774* **[RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707)**: Resource Indicators
791775* **[RFC 9207](https://datatracker.ietf.org/doc/html/rfc9207)**: Authorization Server Issuer Identification
792776* **[OAuth Client ID Metadata Document](https://datatracker.ietf.org/doc/html/draft-ietf-oauth-client-id-metadata-document-00)**: Client IDs that are URLs
793* **[RFC 7591](https://datatracker.ietf.org/doc/html/rfc7591)**: Dynamic Client Registration
794777* **[RFC 6750](https://datatracker.ietf.org/doc/html/rfc6750)**: Bearer Token Usage
795778 
796779For more details, see:

docs/draft/learn/architecture Changed · +31 / -18 lines

from line 82
8282 
8383* **Discovery**: Lets clients query a server's supported protocol versions, capabilities, and identity through the `server/discover` request
8484* **Server features**: Enables servers to provide core functionality including tools for AI actions, resources for context data, and prompts for interaction templates from and to the client
85* **Client features**: Enables servers to elicit input from the user. Sampling is [deprecated](https://modelcontextprotocol.io/specification/draft/deprecated.md) as of protocol version `2026-07-28`.
85* **Client features**: Enables servers to elicit input from the user.
8686* **Utility features**: Supports additional capabilities like notifications for real-time updates and progress tracking for long-running operations
8787 
8888#### Transport layer
from line 100
100100 
101101A core part of MCP is defining the schema and semantics between MCP clients and MCP servers. Developers will likely find the data layer — in particular, the set of [primitives](#primitives) — to be the most interesting part of MCP. It is the part of MCP that defines the ways developers can share context from MCP servers to MCP clients.
102102 
103MCP uses [JSON-RPC 2.0](https://www.jsonrpc.org/) as its underlying RPC protocol. Client and servers send requests to each other and respond accordingly. Notifications can be used when no response is required.
103MCP uses [JSON-RPC 2.0](https://www.jsonrpc.org/) as its underlying RPC protocol. Clients send requests and servers respond to them. Servers can request input from the client through the [Multi Round-Trip Requests](https://modelcontextprotocol.io/specification/draft/basic/patterns/mrtr.md) pattern. Notifications can be used when no response is required.
104104 
105105#### Statelessness and discovery
106106 
from line 116
116116* **Resources**: Data sources that provide contextual information to AI applications (e.g., file contents, database records, API responses)
117117* **Prompts**: Reusable templates that help structure interactions with language models (e.g., system prompts, few-shot examples)
118118 
119Each primitive type has associated methods for discovery (`*/list`), retrieval (`*/get`), and in some cases, execution (`tools/call`).
120MCP clients will use the `*/list` methods to discover available primitives. For example, a client can first list all available tools (`tools/list`) and then execute them. This design allows listings to be dynamic.
119Each primitive type has associated methods for discovery (`*/list`), and for either retrieval (`resources/read`, `prompts/get`) or execution (`tools/call`).
120MCP clients will use the `*/list` methods to discover available primitives. For example, a client can list the available tools (`tools/list`), provide them to a model, and execute the ones that the model calls (`tools/call`). This design allows listings to be dynamic.
121121 
122122As a concrete example, consider an MCP server that provides context about a database. It can expose tools for querying the database, a resource that contains the schema of the database, and a prompt that includes few-shot examples for interacting with the tools.
123123 
from line 129
129129 
130130Elicitation requests are delivered through the [Multi Round-Trip Requests](https://modelcontextprotocol.io/specification/draft/basic/patterns/mrtr.md) pattern, explained in the [elicitation overview](https://modelcontextprotocol.io/docs/draft/learn/client-concepts.md#elicitation).
131131 
132**Deprecated**: The following client primitives are deprecated as of protocol version `2026-07-28`.
132For more details about client primitives see [client concepts](https://modelcontextprotocol.io/docs/draft/learn/client-concepts.md).
133133 
134* **Sampling**: Allows servers to request language model completions from the client's AI application. This is useful when server authors want access to a language model, but want to stay model-independent and not include a language model SDK in their MCP server. Servers request completions with the `sampling/createMessage` method, also delivered through the Multi Round-Trip Requests pattern. New implementations should integrate directly with LLM provider APIs.
135* **Logging**: Enables servers to send log messages to clients for debugging and monitoring purposes. New implementations should log to `stderr` (stdio transport) or use OpenTelemetry.
134Roots and sampling, which are client features, and protocol logging, which is a server feature, are [deprecated](https://modelcontextprotocol.io/specification/draft/deprecated.md) as of protocol version `2026-07-28`. New implementations should use the following alternatives:
136135 
137For more details about client primitives see [client concepts](https://modelcontextprotocol.io/docs/draft/learn/client-concepts.md).
136* **Roots**: Pass directories or files through tool parameters, resource URIs, or server configuration.
137* **Sampling**: Integrate directly with LLM provider APIs. The protocol does not define a replacement for requesting completions through the client.
138* **Logging**: [Log to `stderr`](https://modelcontextprotocol.io/docs/draft/tools/debugging#implementing-logging) for stdio servers, or use [OpenTelemetry](https://opentelemetry.io/).
138139 
139140Besides server and client primitives, the protocol supports optional [extensions](https://modelcontextprotocol.io/extensions/overview.md) that build on the core protocol. For example, the [Tasks extension](https://modelcontextprotocol.io/extensions/tasks/overview.md) lets servers return a durable handle for long-running requests, so clients can poll for status and retrieve the result later.
140141 
from line 302
301302 }
302303 ],
303304 "ttlMs": 300000,
304 "cacheScope": "public"
305 "cacheScope": "public",
306 "_meta": {
307 "io.modelcontextprotocol/serverInfo": {
308 "name": "example-server",
309 "version": "1.0.0"
310 }
311 }
305312 }
306313}
307314```
from line 389
382389 "type": "text",
383390 "text": "Current weather in San Francisco: 68°F, partly cloudy with light winds from the west at 8 mph. Humidity: 65%"
384391 }
385 ]
392 ],
393 "_meta": {
394 "io.modelcontextprotocol/serverInfo": {
395 "name": "example-server",
396 "version": "1.0.0"
397 }
398 }
386399 }
387400}
388401```
from line 420
407420 
4084211. **`content` Array**: Tool responses return an array of content objects, allowing for rich, multi-format responses (text, images, resources, etc.)
409422 
4102. **Content Types**: Each content object has a `type` field. In this example, `"type": "text"` indicates plain text content, but MCP supports various content types for different use cases.
4232. **Content Types**: Each content object has a `type` field. In this example, `"type": "text"` indicates [text content](https://modelcontextprotocol.io/specification/draft/server/tools.md#text-content). Tool results can also contain [images](https://modelcontextprotocol.io/specification/draft/server/tools.md#image-content) (`image`), [audio](https://modelcontextprotocol.io/specification/draft/server/tools.md#audio-content) (`audio`), [resource links](https://modelcontextprotocol.io/specification/draft/server/tools.md#resource-links) (`resource_link`), and [embedded resources](https://modelcontextprotocol.io/specification/draft/server/tools.md#embedded-resources) (`resource`). Not every model accepts all of these types, so clients may need to handle content that their model does not support.
411424 
4123. **Structured Output**: The response provides actionable information that the AI application can use as context for language model interactions.
4253. **Structured Content** (optional): Tools can also return [structured content](https://modelcontextprotocol.io/specification/draft/server/tools.md#structured-content), a JSON value in the `structuredContent` field of the result. The tool in this example returns only text.
413426 
414This execution pattern allows AI applications to dynamically invoke server functionality and receive structured responses that can be integrated into conversations with language models.
427This execution pattern allows AI applications to dynamically invoke server functionality and receive responses that can be integrated into conversations with language models.
415428 
416429#### How This Works in AI Applications
417430 
from line 545
532545This notification system is crucial for several reasons:
533546 
5345471. **Dynamic Environments**: Tools may come and go based on server state, external dependencies, or user permissions
5352. **Efficiency**: Clients don't need to poll for changes; they're notified when updates occur
5363. **Consistency**: Ensures clients always have accurate information about available server capabilities
5482. **Efficiency**: Clients are notified when updates occur, so they can poll less often
5493. **Consistency**: Helps clients keep their view of available server capabilities up to date
5375504. **Real-time Collaboration**: Enables responsive AI applications that can adapt to changing contexts
538551 
539552This notification pattern extends beyond tools to other MCP primitives, enabling comprehensive real-time synchronization between clients and servers.

docs/draft/learn/client-concepts Changed · +149 / -188 lines

## Deprecated Features ### Roots #### Example: Travel Planning Workspace #### Design Philosophy ### Sampling #### Example: Flight Analysis Tool

from line 6
66 
77## Core Client Features
88 
9In addition to making use of context provided by servers, clients may provide several features to servers. These client features allow server authors to build richer interactions.
9In addition to making use of context provided by servers, clients can provide features to servers, such as [elicitation](https://modelcontextprotocol.io/specification/draft/client/elicitation.md). These allow server authors to build richer interactions.
1010 
11| Feature | Explanation | Example |
12| - | - | - |
13| **Elicitation** | Elicitation enables servers to request specific information from users during interactions, providing a structured way for servers to gather information on demand. | A server booking travel may ask for the user's preferences on airplane seats, room type or their contact number to finalize a booking. |
14| **Roots** | Roots allow clients to specify which directories servers should focus on, communicating intended scope through a coordination mechanism. Roots are [deprecated](https://modelcontextprotocol.io/specification/draft/deprecated.md) as of protocol version `2026-07-28`. | A server for booking travel may be given access to a specific directory, from which it can read a user's calendar. |
15| **Sampling** | Sampling allows servers to request LLM completions through the client, enabling an agentic workflow. This approach puts the client in complete control of user permissions and security measures. Sampling is deprecated as of protocol version `2026-07-28`. | A server for booking travel may send a list of flights to an LLM and request that the LLM pick the best flight for the user. |
16 
1711### Elicitation
1812 
19Elicitation enables servers to request specific information from users during interactions, creating more dynamic and responsive workflows.
13Elicitation enables servers to request specific information from users during interactions, creating more dynamic and responsive workflows. For example, a server booking travel may ask for the user's preferences on airplane seats, room type or their contact number to finalize a booking.
2014 
2115#### Overview
2216 
from line 23
2923 
3024Elicitation follows the [Multi Round-Trip Requests](https://modelcontextprotocol.io/specification/draft/basic/patterns/mrtr.md) (MRTR) pattern. When a server needs user input while processing a request such as `tools/call`, it responds with an `InputRequiredResult` whose `inputRequests` field carries one or more `elicitation/create` requests. The client gathers the input and retries the original request, attaching the collected `inputResponses` and echoing back any `requestState` the server included.
3125 
26Clients declare the modes they support in the `elicitation` capability of each request, and servers must not use any other mode. An empty object (`{}`) declares form mode only, while `{ "form": {}, "url": {} }` declares both.
27 
3228**Elicitation flow:**
3329 
3430```mermaid theme={null}
from line 50
5450 
5551The flow enables dynamic information gathering. Servers can request specific data when needed, users provide information through appropriate UI, and servers complete the retried request with the newly acquired context.
5652 
57**Elicitation request example (delivered inside `InputRequiredResult.inputRequests`):**
53**Elicitation example:**
5854 
59```typescript theme={null}
55The following messages continue building on the [travel planning scenario](https://modelcontextprotocol.io/docs/draft/learn/server-concepts.md#the-complete-flow). The client calls the `bookVacation` tool:
56 
57```json theme={null}
6058{
61 method: "elicitation/create",
62 params: {
63 mode: "form",
64 message: "Please confirm your Barcelona vacation booking details:",
65 requestedSchema: {
66 type: "object",
67 properties: {
68 confirmBooking: {
69 type: "boolean",
70 description: "Confirm the booking (Flights + Hotel = $3,000)"
71 },
72 seatPreference: {
73 type: "string",
74 enum: ["window", "aisle", "no preference"],
75 description: "Preferred seat type for flights"
76 },
77 roomType: {
78 type: "string",
79 enum: ["sea view", "city view", "garden view"],
80 description: "Preferred room type at hotel"
81 },
82 travelInsurance: {
83 type: "boolean",
84 default: false,
85 description: "Add travel insurance ($150)"
86 }
59 "jsonrpc": "2.0",
60 "id": 1,
61 "method": "tools/call",
62 "params": {
63 "name": "bookVacation",
64 "arguments": {
65 "outboundFlight": "EX101",
66 "returnFlight": "EX102",
67 "hotelId": "beachfront-hotel"
68 },
69 "_meta": {
70 "io.modelcontextprotocol/protocolVersion": "2026-07-28",
71 "io.modelcontextprotocol/clientInfo": {
72 "name": "example-client",
73 "version": "1.0.0"
8774 },
88 required: ["confirmBooking"]
75 "io.modelcontextprotocol/clientCapabilities": {
76 "elicitation": {}
77 }
8978 }
9079 }
9180}
9281```
9382 
94#### Example: Holiday Booking Approval
83The server needs the user to confirm the booking, so it responds with an `InputRequiredResult`. Its `resultType` of `"input_required"` indicates that the client must provide additional input before the server can complete the request:
9584 
96A travel booking server demonstrates elicitation's power through the final booking confirmation process. When a user has selected their ideal vacation package to Barcelona, the server needs to gather final approval and any missing details before proceeding.
97 
98The server elicits booking confirmation with a structured request that includes the trip summary (Barcelona flights June 15-22, beachfront hotel, total \$3,000) and fields for any additional preferences—such as seat selection, room type, or travel insurance options.
99 
100As the booking progresses, the server elicits contact information needed to complete the reservation. It might ask for traveler details for flight bookings, special requests for the hotel, or emergency contact information.
101 
102#### User Interaction Model
103 
104Elicitation interactions are designed to be clear, contextual, and respectful of user autonomy:
105 
106**Request presentation**: Clients display elicitation requests with clear context about which server is asking, why the information is needed, and how it will be used. The request message explains the purpose while the schema provides structure and validation.
107 
108**Response options**: Users can provide the requested information through appropriate UI controls (text fields, dropdowns, checkboxes), decline to provide information with optional explanation, or cancel the entire operation. Clients validate responses against the provided schema before returning them to servers.
109 
110**URL handling**: For URL mode, clients show the full URL and gather explicit consent before opening it, and never fetch the URL automatically. The client only learns whether the user consented. The interaction itself stays between the user and the target site.
111 
112**Privacy considerations**: Servers must not use form mode to request sensitive information such as passwords, API keys, access tokens, or payment credentials. Those interactions belong in URL mode, which keeps the data out of band so it never passes through the client or the LLM context. Clients warn about suspicious requests and let users review form data before sending.
113 
114### Roots
115 
116> [!WARNING]
117>
118> Roots are [deprecated](https://modelcontextprotocol.io/specification/draft/deprecated.md) as of protocol version
119> `2026-07-28` and scheduled for removal. New implementations should pass
120> directories or files via tool parameters, resource URIs, or server
121> configuration instead.
122 
123Roots define filesystem boundaries for server operations, allowing clients to specify which directories servers should focus on.
124 
125#### Overview
126 
127Roots are a mechanism for clients to communicate filesystem access boundaries to servers. They consist of file URIs that indicate directories where servers can operate, helping servers understand the scope of available files and folders. While roots communicate intended boundaries, they do not enforce security restrictions. Actual security must be enforced at the operating system level, via file permissions and/or sandboxing.
128 
129**Root structure:**
130 
13185```json theme={null}
13286{
133 "uri": "file:///Users/agent/travel-planning",
134 "name": "Travel Planning Workspace"
87 "jsonrpc": "2.0",
88 "id": 1,
89 "result": {
90 "resultType": "input_required",
91 "inputRequests": {
92 "bookingConfirmation": {
93 "method": "elicitation/create",
94 "params": {
95 "mode": "form",
96 "message": "Please confirm your Barcelona vacation booking: flights June 15-22, beachfront hotel, total $3,000.",
97 "requestedSchema": {
98 "type": "object",
99 "properties": {
100 "confirmBooking": {
101 "type": "boolean",
102 "description": "Confirm the booking (Flights + Hotel = $3,000)"
103 },
104 "seatPreference": {
105 "type": "string",
106 "enum": ["window", "aisle", "no preference"],
107 "description": "Preferred seat type for flights"
108 },
109 "roomType": {
110 "type": "string",
111 "enum": ["sea view", "city view", "garden view"],
112 "description": "Preferred room type at hotel"
113 },
114 "travelInsurance": {
115 "type": "boolean",
116 "default": false,
117 "description": "Add travel insurance ($150)"
118 }
119 },
120 "required": ["confirmBooking"]
121 }
122 }
123 }
124 },
125 "requestState": "opaque-string-from-the-server",
126 "_meta": {
127 "io.modelcontextprotocol/serverInfo": {
128 "name": "travel-server",
129 "version": "1.0.0"
130 }
131 }
132 }
135133}
136134```
137135 
138Roots are exclusively filesystem paths and always use the `file://` URI scheme. They help servers understand project boundaries, workspace organization, and accessible directories. The roots list can change as users work with different projects or folders. Servers pick up the updated boundaries the next time they request the roots list.
136After the user fills in the form, the client retries the call with a new `id`. The retry carries the user's answers in `inputResponses`, under the same `bookingConfirmation` key as the server's request, and the exact `requestState` value from the result:
139137 
140#### Example: Travel Planning Workspace
141 
142A travel agent working with multiple client trips benefits from roots to organize filesystem access. Consider a workspace with different directories for various aspects of travel planning.
143 
144The client provides filesystem roots to the travel planning server:
145 
146* `file:///Users/agent/travel-planning` - Main workspace containing all travel files
147* `file:///Users/agent/travel-templates` - Reusable itinerary templates and resources
148* `file:///Users/agent/client-documents` - Client passports and travel documents
149 
150When the agent creates a Barcelona itinerary, well-behaved servers respect these boundaries—accessing templates, saving the new itinerary, and referencing client documents within the specified roots. Servers typically access files within roots by using relative paths from the root directories or by utilizing file search tools that respect the root boundaries.
151 
152If the agent opens an archive folder like `file:///Users/agent/archive/2023-trips`, the client adds it to the roots list, and the server sees the new boundary on its next `roots/list` request.
153 
154For a complete implementation of a server that respects roots, see the [filesystem server](https://github.com/modelcontextprotocol/servers/tree/main/src/filesystem) in the official servers repository.
155 
156#### Design Philosophy
157 
158Roots serve as a coordination mechanism between clients and servers, not a security boundary. The specification requires that servers "SHOULD respect root boundaries," and not that they "MUST enforce" them, because servers run code the client cannot control.
159 
160Roots work best when servers are trusted or vetted, users understand their advisory nature, and the goal is preventing accidents rather than stopping malicious behavior. They excel at context scoping (telling servers where to focus), accident prevention (helping well-behaved servers stay in bounds), and workflow organization (such as managing project boundaries automatically).
161 
162#### User Interaction Model
163 
164Roots are typically managed automatically by host applications based on user actions, though some applications may expose manual root management:
165 
166**Automatic root detection**: When users open folders, clients automatically expose them as roots. Opening a travel workspace allows the client to expose that directory as a root, helping servers understand which itineraries and documents are in scope for the current work.
167 
168**Manual root configuration**: Advanced users can specify roots through configuration. For example, adding `/travel-templates` for reusable resources while excluding directories with financial records.
169 
170### Sampling
171 
172> [!WARNING]
173>
174> Sampling is [deprecated](https://modelcontextprotocol.io/specification/draft/deprecated.md) as of protocol
175> version `2026-07-28` and scheduled for removal. New implementations should
176> integrate directly with LLM provider APIs instead.
177 
178Sampling allows servers to request language model completions through the client, enabling agentic behaviors while maintaining security and user control.
179 
180#### Overview
181 
182Sampling enables servers to perform AI-dependent tasks without directly integrating with or paying for AI models. Instead, servers can request that the client—which already has AI model access—handle these tasks on their behalf. This approach puts the client in complete control of user permissions and security measures. Because sampling requests occur within the context of other operations—like a tool analyzing data—and are processed as separate model calls, they maintain clear boundaries between different contexts, allowing for more efficient use of the context window.
183 
184Sampling follows the same [Multi Round-Trip Requests](https://modelcontextprotocol.io/specification/draft/basic/patterns/mrtr.md) flow described under [elicitation](#elicitation), with the `InputRequiredResult` carrying a `sampling/createMessage` request.
185 
186Servers can also request tool use during sampling by including a `tools` array and an optional `toolChoice` field in the request. The tool definitions are scoped to that sampling request and do not need to correspond to tools the server exposes. Clients declare support through the `sampling.tools` capability, and servers must not send tool-enabled sampling requests to clients that have not declared it. See [sampling](https://modelcontextprotocol.io/specification/draft/client/sampling.md#tools-in-sampling) in the specification for details.
187 
188**Sampling flow:**
189 
190```mermaid theme={null}
191sequenceDiagram
192 participant LLM
193 participant User
194 participant Client
195 participant Server
196 
197 Client->>Server: tools/call (id: 1)
198 Note over Server: Server needs an LLM completion
199 Server-->>Client: InputRequiredResult with sampling/createMessage request
200 
201 Note over Client,User: Human-in-the-loop review
202 Client->>User: Present request for approval
203 User-->>Client: Review and approve/modify
204 
205 Note over Client,LLM: Model interaction
206 Client->>LLM: Forward approved request
207 LLM-->>Client: Return generation
208 
209 Note over Client,User: Response review
210 Client->>User: Present response for approval
211 User-->>Client: Review and approve/modify
212 
213 Note over Client,Server: Retry request with approved response
214 Client->>Server: tools/call (id: 2, inputResponses)
215 Server-->>Client: Final result
138```json theme={null}
139{
140 "jsonrpc": "2.0",
141 "id": 2,
142 "method": "tools/call",
143 "params": {
144 "name": "bookVacation",
145 "arguments": {
146 "outboundFlight": "EX101",
147 "returnFlight": "EX102",
148 "hotelId": "beachfront-hotel"
149 },
150 "inputResponses": {
151 "bookingConfirmation": {
152 "action": "accept",
153 "content": {
154 "confirmBooking": true,
155 "seatPreference": "window",
156 "roomType": "sea view",
157 "travelInsurance": false
158 }
159 }
160 },
161 "requestState": "opaque-string-from-the-server",
162 "_meta": {
163 "io.modelcontextprotocol/protocolVersion": "2026-07-28",
164 "io.modelcontextprotocol/clientInfo": {
165 "name": "example-client",
166 "version": "1.0.0"
167 },
168 "io.modelcontextprotocol/clientCapabilities": {
169 "elicitation": {}
170 }
171 }
172 }
173}
216174```
217175 
218The flow ensures security through multiple human-in-the-loop checkpoints. Users review and can modify both the initial request and the generated response before the client retries the original request with it.
176The server completes the booking and returns a `CallToolResult`. Its `resultType` of `"complete"` indicates that the request completed successfully:
219177 
220**Request parameters example:**
221 
222```typescript theme={null}
178```json theme={null}
223179{
224 messages: [
225 {
226 role: "user",
227 content: {
228 type: "text",
229 text: "Analyze these flight options and recommend the best choice:\n" +
230 "[47 flights with prices, times, airlines, and layovers]\n" +
231 "User preferences: morning departure, max 1 layover"
180 "jsonrpc": "2.0",
181 "id": 2,
182 "result": {
183 "resultType": "complete",
184 "content": [
185 {
186 "type": "text",
187 "text": "Booked flights EX101 and EX102 and a sea view room at the beachfront hotel."
232188 }
189 ],
190 "_meta": {
191 "io.modelcontextprotocol/serverInfo": {
192 "name": "travel-server",
193 "version": "1.0.0"
194 }
233195 }
234 ],
235 modelPreferences: {
236 hints: [{
237 name: "claude-sonnet" // Prefer Sonnet-class models
238 }],
239 costPriority: 0.3, // Less concerned about API cost
240 speedPriority: 0.2, // Can wait for thorough analysis
241 intelligencePriority: 0.9 // Need complex trade-off evaluation
242 },
243 systemPrompt: "You are a travel expert helping users find the best flights based on their preferences",
244 maxTokens: 1500
196 }
245197}
246198```
247199 
248#### Example: Flight Analysis Tool
200#### Example: Holiday Booking Approval
249201 
250Consider a travel booking server with a tool called `findBestFlight` that uses sampling to analyze available flights and recommend the optimal choice. When a user asks "Book me the best flight to Barcelona next month," the tool needs AI assistance to evaluate complex trade-offs.
202A travel booking server demonstrates elicitation's power through the final booking confirmation process. When a user has selected their ideal vacation package to Barcelona, the server needs to gather final approval and any missing details before proceeding.
251203 
252The tool queries airline APIs and gathers 47 flight options. It then requests AI assistance to analyze these options: "Analyze these flight options and recommend the best choice: \[47 flights with prices, times, airlines, and layovers] User preferences: morning departure, max 1 layover."
204The server elicits booking confirmation with a structured request that includes the trip summary (Barcelona flights June 15-22, beachfront hotel, total \$3,000) and fields for any additional preferences—such as seat selection, room type, or travel insurance options.
253205 
254The client initiates the sampling request, allowing the AI to evaluate trade-offs—like cheaper red-eye flights versus convenient morning departures. The tool uses this analysis to present the top three recommendations.
206As the booking progresses, the server elicits contact information needed to complete the reservation. It might ask for traveler details for flight bookings, special requests for the hotel, or emergency contact information.
255207 
256208#### User Interaction Model
257209 
258While not a requirement, sampling is designed to allow human-in-the-loop control. Users can maintain oversight through several mechanisms:
210Elicitation interactions are designed to be clear, contextual, and respectful of user autonomy:
259211 
260**Approval controls**: Sampling requests may require explicit user consent. Clients can show what the server wants to analyze and why. Users can approve, deny, or modify requests.
212**Request presentation**: Clients display elicitation requests with clear context about which server is asking, why the information is needed, and how it will be used. The request message explains the purpose while the schema provides structure and validation.
261213 
262**Transparency features**: Clients can display the exact prompt, model selection, and token limits, allowing users to review AI responses before they return to the server.
214**Response options**: Users can provide the requested information through appropriate UI controls (text fields, dropdowns, checkboxes), explicitly decline to provide it, or dismiss the request without making a choice. These map to the `accept`, `decline`, and `cancel` actions. Clients validate responses against the provided schema before returning them to servers.
263215 
264**Configuration options**: Users can set model preferences, configure auto-approval for trusted operations, or require approval for everything. Clients may provide options to redact sensitive information.
216**URL handling**: For URL mode, clients show the full URL and gather explicit consent before opening it, and never fetch the URL automatically. The client only learns whether the user consented. The interaction itself stays between the user and the target site.
265217 
266**Security considerations**: Both clients and servers must handle sensitive data appropriately during sampling. Clients should implement rate limiting and validate all message content. The human-in-the-loop design ensures that server-requested AI interactions cannot compromise security or access sensitive data without explicit user consent.
218**Privacy considerations**: Servers must not use form mode to request sensitive information such as passwords, API keys, access tokens, or payment credentials. Those interactions belong in URL mode, which keeps the data out of band so it never passes through the client or the LLM context. Clients warn about suspicious requests and let users review form data before sending.
219 
220## Deprecated Features
221 
222> [!WARNING]
223>
224> Roots and sampling are [deprecated](https://modelcontextprotocol.io/specification/draft/deprecated.md) as of protocol version `2026-07-28` and scheduled for removal. New implementations should use the following alternatives:
225>
226> * **Roots**: Pass directories or files through tool parameters, resource URIs, or server configuration.
227> * **Sampling**: Integrate directly with LLM provider APIs. The protocol does not define a replacement for requesting completions through the client.
267228 

docs/draft/learn/server-concepts Changed · +360 / -81 lines

The two sides of this change are more than 400 edits apart, too far apart to line up, so this is the differ's own diff of it and the words inside a line are not marked.

from line 14
1414| **Resources** | Passive data sources that provide read-only access to information for context, such as file contents, database schemas, or API documentation. | Retrieve documents Access knowledge bases Read calendars | Application |
1515| **Prompts** | Pre-built instruction templates that tell the model to work with specific tools and resources. | Plan a vacation Summarize my meetings Draft an email | User |
1616 
17We will use a hypothetical scenario to demonstrate the role of each of these features, and show how they can work together.
17We will use a hypothetical scenario to demonstrate the role of each of these features, and show how they can work together. Examples with a `jsonrpc` field are complete messages, and the rest are excerpts.
18 
19Every request carries the [protocol version and client capabilities](https://modelcontextprotocol.io/docs/draft/learn/architecture.md#statelessness-and-discovery) in `_meta`, and every result has a [`resultType`](https://modelcontextprotocol.io/specification/draft/basic/index#responses).
1820 
1921### Tools
2022 
from line 33
3133| `tools/list` | Discover available tools | Array of tool definitions with schemas |
3234| `tools/call` | Execute a specific tool | Tool execution result |
3335 
34**Example tool definition:**
35 
36```typescript theme={null}
37{
38 name: "searchFlights",
39 description: "Search for available flights",
40 inputSchema: {
41 type: "object",
42 properties: {
43 origin: { type: "string", description: "Departure city" },
44 destination: { type: "string", description: "Arrival city" },
45 date: { type: "string", format: "date", description: "Travel date" }
46 },
47 required: ["origin", "destination", "date"]
36**Example tool definition, as returned by `tools/list`:**
37 
38```json theme={null}
39{
40 "name": "searchFlights",
41 "title": "Search Flights",
42 "description": "Search for available flights",
43 "inputSchema": {
44 "type": "object",
45 "properties": {
46 "origin": { "type": "string", "description": "Departure city" },
47 "destination": { "type": "string", "description": "Arrival city" },
48 "date": {
49 "type": "string",
50 "format": "date",
51 "description": "Travel date"
52 }
53 },
54 "required": ["origin", "destination", "date"]
55 },
56 "outputSchema": {
57 "type": "object",
58 "properties": {
59 "flights": {
60 "type": "array",
61 "items": {
62 "type": "object",
63 "properties": {
64 "flightNumber": { "type": "string" },
65 "priceUsd": { "type": "number" }
66 },
67 "required": ["flightNumber", "priceUsd"]
68 }
69 }
70 },
71 "required": ["flights"]
4872 }
4973}
5074```
from line 79
5579 
5680**Flight Search**
5781 
58```
59searchFlights(origin: "NYC", destination: "Barcelona", date: "2024-06-15")
60```
61 
62Queries multiple airlines and returns structured flight options.
82Queries multiple airlines and returns structured flight options. The arguments in the `tools/call` request conform to the tool's `inputSchema`:
83 
84```json theme={null}
85{
86 "jsonrpc": "2.0",
87 "id": 1,
88 "method": "tools/call",
89 "params": {
90 "name": "searchFlights",
91 "arguments": {
92 "origin": "New York",
93 "destination": "Barcelona",
94 "date": "2027-06-15"
95 },
96 "_meta": {
97 "io.modelcontextprotocol/protocolVersion": "2026-07-28",
98 "io.modelcontextprotocol/clientInfo": {
99 "name": "example-client",
100 "version": "1.0.0"
101 },
102 "io.modelcontextprotocol/clientCapabilities": { "elicitation": {} }
103 }
104 }
105}
106```
107 
108The result's `structuredContent` conforms to the tool's `outputSchema`. For backwards compatibility, the result also includes the serialized JSON as text:
109 
110```json theme={null}
111{
112 "jsonrpc": "2.0",
113 "id": 1,
114 "result": {
115 "resultType": "complete",
116 "content": [
117 {
118 "type": "text",
119 "text": "{\"flights\":[{\"flightNumber\":\"EX101\",\"priceUsd\":640}]}"
120 }
121 ],
122 "structuredContent": {
123 "flights": [{ "flightNumber": "EX101", "priceUsd": 640 }]
124 },
125 "_meta": {
126 "io.modelcontextprotocol/serverInfo": {
127 "name": "travel-server",
128 "version": "1.0.0"
129 }
130 }
131 }
132}
133```
134 
135The other tools are called the same way, with their own `name` and `arguments`.
63136 
64137**Calendar Blocking**
65138 
66```
67createCalendarEvent(title: "Barcelona Trip", startDate: "2024-06-15", endDate: "2024-06-22")
68```
69 
70139Marks the travel dates in the user's calendar.
71140 
141```json theme={null}
142{
143 "name": "createCalendarEvent",
144 "arguments": {
145 "title": "Barcelona Trip",
146 "startDate": "2027-06-15",
147 "endDate": "2027-06-22"
148 }
149}
150```
151 
72152**Email notification**
73153 
74```
75sendEmail(to: "[email protected]", subject: "Out of Office", body: "...")
76```
77 
78154Sends an automated out-of-office message to colleagues.
155 
156```json theme={null}
157{
158 "name": "sendEmail",
159 "arguments": {
160 "to": "[email protected]",
161 "subject": "Out of Office",
162 "body": "I am out of the office from June 15 to June 22."
163 }
164}
165```
79166 
80167#### User Interaction Model
81168 
from line 183
96183 
97184Resources expose data from files, APIs, databases, or any other source that an AI needs to understand context. Applications can access this information directly and decide how to use it - whether that's selecting relevant portions, searching with embeddings, or passing it all to the model.
98185 
99Each resource has a unique URI (e.g., `file:///path/to/document.md`) and declares its MIME type for appropriate content handling.
186Each resource has a unique URI (e.g., `file:///path/to/document.md`) and can declare its MIME type for appropriate content handling.
100187 
101188Resources support two discovery patterns:
102189 
103* **Direct Resources** - fixed URIs that point to specific data. Example: `calendar://events/2024` - returns calendar availability for 2024
104* **Resource Templates** - dynamic URIs with parameters for flexible queries. Example:
105 * `travel://activities/{city}/{category}` - returns activities by city and category
106 * `travel://activities/barcelona/museums` - returns all museums in Barcelona
107 
108Resource Templates include metadata such as title, description, and expected MIME type, making them discoverable and self-documenting.
190* **Direct Resources** - fixed URIs that point to specific data. Example: `calendar://events/2027-06` - returns calendar availability for June 2027
191* **Resource Templates** - parameterized URIs for flexible queries. Example: `travel://activities/{city}/{category}` - returns activities by city and category. For example, `travel://activities/Barcelona/museums` returns all museums in Barcelona
192 
193Resource Templates can include metadata such as title, description, and expected MIME type, making them discoverable and self-documenting.
109194 
110195**Protocol operations:**
111196 
from line 199
114199| `resources/list` | List available direct resources | Array of resource descriptors |
115200| `resources/templates/list` | Discover resource templates | Array of resource template definitions |
116201| `resources/read` | Retrieve resource contents | Resource data with metadata |
202| `completion/complete` | Suggest parameter values | Array of suggested values |
117203| `subscriptions/listen` | Monitor resource changes | Stream of update notifications |
118204 
119To watch specific resources for changes, a client sends a [`subscriptions/listen`](https://modelcontextprotocol.io/specification/draft/basic/patterns/subscriptions) request with the resource URIs listed in the `resourceSubscriptions` filter. The server delivers `notifications/resources/updated` on the resulting stream whenever a watched resource changes.
205To watch specific resources for changes, a client sends a [`subscriptions/listen`](https://modelcontextprotocol.io/specification/draft/basic/patterns/subscriptions) request with the resource URIs listed in the `resourceSubscriptions` filter. Servers that support update notifications for individual resources declare `"subscribe": true` in their `resources` capability. The server delivers `notifications/resources/updated` on the resulting stream whenever a watched resource changes.
120206 
121207#### Example: Getting Travel Planning Context
122208 
123209Continuing with the travel planning example, resources provide the AI application with access to relevant information:
124210 
125* **Calendar data** (`calendar://events/2024`) - Checks user availability
211* **Calendar data** (`calendar://events/2027-06`) - Checks user availability
126212* **Travel documents** (`file:///Documents/Travel/passport.pdf`) - Accesses important documents
127* **Previous itineraries** (`trips://history/barcelona-2023`) - References past trips and preferences
213* **Travel preferences** (`travel://preferences/europe`) - Looks up preferred airlines and hotel types
214* **Previous itineraries** (`travel://past-trips/spain-2023`) - References past trips
215* **Weather forecast** (`weather://forecast/Barcelona/2027-06-15`) - Looks up the weather for a travel date
128216 
129217The AI application retrieves these resources and decides how to process them, whether selecting a subset of data using embeddings or keyword search, or passing raw data directly to the model.
130218 
131In this case, it provides calendar data, weather information, and travel preferences to the model, enabling it to check availability, look up weather patterns, and reference past travel preferences.
132 
133**Resource Template Examples:**
219In this case, it provides calendar data, weather information, travel preferences, and past trips to the model, enabling it to check availability, look up weather patterns, and follow the user's preferences.
220 
221The AI application reads each resource with a `resources/read` request:
222 
223```json theme={null}
224{
225 "jsonrpc": "2.0",
226 "id": 2,
227 "method": "resources/read",
228 "params": {
229 "uri": "calendar://events/2027-06",
230 "_meta": {
231 "io.modelcontextprotocol/protocolVersion": "2026-07-28",
232 "io.modelcontextprotocol/clientInfo": {
233 "name": "example-client",
234 "version": "1.0.0"
235 },
236 "io.modelcontextprotocol/clientCapabilities": {
237 "elicitation": {}
238 }
239 }
240 }
241}
242```
243 
244The result contains the resource contents and two [caching hints](https://modelcontextprotocol.io/specification/draft/server/utilities/caching.md). `ttlMs` is how long the client may consider the result fresh, in milliseconds, and a `cacheScope` of `"private"` means that caches must not share it across authorization contexts:
245 
246```json theme={null}
247{
248 "jsonrpc": "2.0",
249 "id": 2,
250 "result": {
251 "resultType": "complete",
252 "contents": [
253 {
254 "uri": "calendar://events/2027-06",
255 "mimeType": "application/json",
256 "text": "{\"busy\":[{\"startDate\":\"2027-06-03\",\"endDate\":\"2027-06-04\"}]}"
257 }
258 ],
259 "ttlMs": 60000,
260 "cacheScope": "private",
261 "_meta": {
262 "io.modelcontextprotocol/serverInfo": {
263 "name": "calendar-email-server",
264 "version": "1.0.0"
265 }
266 }
267 }
268}
269```
270 
271**Resource template examples:**
272 
273From a weather server:
134274 
135275```json theme={null}
136276{
from line 280
140280 "description": "Get weather forecast for any city and date",
141281 "mimeType": "application/json"
142282}
143 
283```
284 
285From a travel server:
286 
287```json theme={null}
144288{
145289 "uriTemplate": "travel://flights/{origin}/{destination}",
146290 "name": "flight-search",
147291 "title": "Flight Search",
148 "description": "Search available flights between cities",
292 "description": "Search available flights between two airports",
149293 "mimeType": "application/json"
150294}
151295```
152296 
153These templates enable flexible queries. For weather data, users can access forecasts for any city/date combination. For flights, they can search routes between any two airports. When a user has input "NYC" as the `origin` airport and begins to input "Bar" as the `destination` airport, the system can suggest "Barcelona (BCN)" or "Barbados (BGI)".
297These templates enable flexible queries. For weather data, users can access forecasts for any city/date combination. For flights, they can search routes between any two airports.
154298 
155299#### Parameter Completion
156300 
157Dynamic resources support parameter completion. For example:
158 
159* Typing "Par" as input for `weather://forecast/{city}` might suggest "Paris" or "Park City"
160* Typing "JFK" for `flights://search/{airport}` might suggest "JFK - John F. Kennedy International"
301Servers that declare the `completions` capability can suggest values for template parameters. For example:
302 
303* Typing "Par" for `city` in `weather://forecast/{city}/{date}` might suggest "Paris" or "Park City"
304* Typing "JF" for `origin` in `travel://flights/{origin}/{destination}` might suggest "JFK"
305 
306When a template has multiple parameters, clients should include the values that are already resolved in `context.arguments`, so the server can narrow its suggestions. Here, the user has chosen `JFK` as the `origin` and typed "Bar" for the `destination`:
307 
308```json theme={null}
309{
310 "jsonrpc": "2.0",
311 "id": 3,
312 "method": "completion/complete",
313 "params": {
314 "ref": {
315 "type": "ref/resource",
316 "uri": "travel://flights/{origin}/{destination}"
317 },
318 "argument": {
319 "name": "destination",
320 "value": "Bar"
321 },
322 "context": {
323 "arguments": {
324 "origin": "JFK"
325 }
326 },
327 "_meta": {
328 "io.modelcontextprotocol/protocolVersion": "2026-07-28",
329 "io.modelcontextprotocol/clientInfo": {
330 "name": "example-client",
331 "version": "1.0.0"
332 },
333 "io.modelcontextprotocol/clientCapabilities": { "elicitation": {} }
334 }
335 }
336}
337```
338 
339The server suggests the airport codes for Barcelona and Barbados, which both have flights from JFK:
340 
341```json theme={null}
342{
343 "jsonrpc": "2.0",
344 "id": 3,
345 "result": {
346 "resultType": "complete",
347 "completion": {
348 "values": ["BCN", "BGI"],
349 "total": 2,
350 "hasMore": false
351 },
352 "_meta": {
353 "io.modelcontextprotocol/serverInfo": {
354 "name": "travel-server",
355 "version": "1.0.0"
356 }
357 }
358 }
359}
360```
161361 
162362The system helps discover valid values without requiring exact format knowledge.
163363 
from line 384
184384 
185385| Method | Purpose | Returns |
186386| - | - | - |
187| `prompts/list` | Discover available prompts | Array of prompt descriptors |
188| `prompts/get` | Retrieve prompt details | Full prompt definition with arguments |
387| `prompts/list` | Discover available prompts | Array of prompt definitions, including the arguments each one accepts |
388| `prompts/get` | Retrieve a prompt | Array of prompt messages |
389| `completion/complete` | Suggest argument values | Array of suggested values |
189390 
190391#### Example: Streamlined Workflows
191392 
192393Prompts provide structured templates for common tasks. In the travel planning context:
193394 
194**"Plan a vacation" prompt:**
395**"Plan a vacation" prompt, as returned by `prompts/list`:**
195396 
196397```json theme={null}
197398{
from line 400
199400 "title": "Plan a vacation",
200401 "description": "Guide through vacation planning process",
201402 "arguments": [
202 { "name": "destination", "type": "string", "required": true },
203 { "name": "duration", "type": "number", "description": "days" },
204 { "name": "budget", "type": "number", "required": false },
205 { "name": "interests", "type": "array", "items": { "type": "string" } }
403 {
404 "name": "origin",
405 "description": "City to depart from",
406 "required": true
407 },
408 {
409 "name": "destination",
410 "description": "City to visit",
411 "required": true
412 },
413 {
414 "name": "departureDate",
415 "description": "First day of the trip, as YYYY-MM-DD",
416 "required": true
417 },
418 {
419 "name": "returnDate",
420 "description": "Last day of the trip, as YYYY-MM-DD",
421 "required": true
422 },
423 {
424 "name": "budget",
425 "description": "Total budget in USD",
426 "required": false
427 },
428 {
429 "name": "travelers",
430 "description": "Number of travelers",
431 "required": false
432 },
433 {
434 "name": "interests",
435 "description": "Comma-separated list of interests"
436 }
206437 ]
207438}
208439```
209440 
441Prompt arguments don't have types. Every value is sent as a string, so use `description` to specify the expected format. Arguments are optional unless `required` is `true`.
442 
210443Rather than unstructured natural language input, the prompt system enables:
211444 
2124451. Selection of the "Plan a vacation" template
2132. Structured input: Barcelona, 7 days, \$3000, \["beaches", "architecture", "food"]
4462. Structured input: New York to Barcelona, June 15-22, \$3000, 2 travelers, interested in beaches, architecture, and food
2144473. Consistent workflow execution based on the template
215448 
216449#### User Interaction Model
from line 478
245478 
2464791. **User invokes a prompt with parameters:**
247480 
481 The user picks "Plan a vacation" and fills in its arguments. The client sends a `prompts/get` request to the Travel Server:
482 
248483 ```json theme={null}
249484 {
250 "prompt": "plan-vacation",
251 "arguments": {
252 "destination": "Barcelona",
253 "departure_date": "2024-06-15",
254 "return_date": "2024-06-22",
255 "budget": 3000,
256 "travelers": 2
485 "jsonrpc": "2.0",
486 "id": 4,
487 "method": "prompts/get",
488 "params": {
489 "name": "plan-vacation",
490 "arguments": {
491 "origin": "New York",
492 "destination": "Barcelona",
493 "departureDate": "2027-06-15",
494 "returnDate": "2027-06-22",
495 "budget": "3000",
496 "travelers": "2",
497 "interests": "beaches, architecture, food"
498 },
499 "_meta": {
500 "io.modelcontextprotocol/protocolVersion": "2026-07-28",
501 "io.modelcontextprotocol/clientInfo": {
502 "name": "example-client",
503 "version": "1.0.0"
504 },
505 "io.modelcontextprotocol/clientCapabilities": { "elicitation": {} }
506 }
257507 }
258508 }
259509 ```
260510 
511 The server returns messages that the AI application adds to the conversation:
512 
513 ```json theme={null}
514 {
515 "jsonrpc": "2.0",
516 "id": 4,
517 "result": {
518 "resultType": "complete",
519 "description": "Guide through vacation planning process",
520 "messages": [
521 {
522 "role": "user",
523 "content": {
524 "type": "text",
525 "text": "Plan a vacation from New York to Barcelona for 2 travelers, from 2027-06-15 to 2027-06-22, with a total budget of $3000. Interests: beaches, architecture, food.\n\nUse the calendar, travel preferences, and past trips provided as context. Search for flights and hotels within the budget, and check the weather for the travel dates. Propose one package. After the user agrees, book it, add the trip to the calendar, and email a confirmation."
526 }
527 }
528 ],
529 "_meta": {
530 "io.modelcontextprotocol/serverInfo": {
531 "name": "travel-server",
532 "version": "1.0.0"
533 }
534 }
535 }
536 }
537 ```
538 
2615392. **User selects resources to include:**
262 * `calendar://my-calendar/June-2024` (from Calendar Server)
540 * `calendar://events/2027-06` (from Calendar/Email Server)
263541 * `travel://preferences/europe` (from Travel Server)
264 * `travel://past-trips/Spain-2023` (from Travel Server)
542 * `travel://past-trips/spain-2023` (from Travel Server)
265543 
2665443. **AI processes the request using tools:**
267545 
268 The AI first reads all selected resources to gather context - identifying available dates from the calendar, learning preferred airlines and hotel types from travel preferences, and discovering previously enjoyed locations from past trips.
269 
270 Using this context, the AI then executes the prompt provided by the AI application. In our example, the AI application exposes the weather tools from the connected MCP weather server to the model. Because weather can affect travel plans, the AI chooses to call `checkWeather()` when interpreting the prompt.
271 
272 As a result the AI executes a series of tools:
273 
274 * `searchFlights()` - Queries airlines for NYC to Barcelona flights
275 * `checkWeather()` - Retrieves climate forecasts for travel dates
276 
277 The AI then uses this information to create the booking and following steps, requesting approval from the user where necessary:
278 
279 * `bookHotel()` - Finds hotels within the specified budget
280 * `createCalendarEvent()` - Adds the trip to the user's calendar
281 * `sendEmail()` - Sends confirmation with trip details
282 
283**The result:** Through multiple MCP servers, the user researched and booked a Barcelona trip tailored to their schedule. The "Plan a Vacation" prompt guided the AI to combine Resources (calendar availability and travel history) with Tools (searching flights, booking hotels, updating calendars) across different servers—gathering context and executing the booking. A task that could have taken hours was completed in minutes using MCP.
546 The AI application first reads all selected resources to gather context for the model - identifying available dates from the calendar, learning preferred airlines and hotel types from travel preferences, and discovering previously enjoyed locations from past trips.
547 
548 Using this context, the model then follows the prompt provided by the Travel Server. The AI application exposes the tools from all three servers to the model, so a prompt from the Travel Server can lead the model to call `checkWeather` on the Weather Server.
549 
550 As a result, the model calls a series of tools:
551 
552 * `searchFlights` (from Travel Server) - Queries airlines for New York to Barcelona flights
553 * `searchHotels` (from Travel Server) - Finds hotels within the specified budget
554 * `checkWeather` (from Weather Server) - Retrieves climate forecasts for travel dates
555 
556 The model then uses this information to create the booking and following steps, with the AI application requesting approval from the user where necessary:
557 
558 * `bookVacation` (from Travel Server) - Books the flights and hotel. The server asks the user to confirm the booking through [elicitation](https://modelcontextprotocol.io/docs/draft/learn/client-concepts.md#elicitation)
559 * `createCalendarEvent` (from Calendar/Email Server) - Adds the trip to the user's calendar
560 * `sendEmail` (from Calendar/Email Server) - Sends confirmation with trip details
561 
562**The result:** Through multiple MCP servers, the user researched and booked a Barcelona trip tailored to their schedule. The "Plan a vacation" prompt guided the AI to combine Resources (calendar availability and travel history) with Tools (searching flights and hotels, booking them, updating the calendar) across different servers—gathering context and executing the booking. A task that could have taken hours was completed in minutes using MCP.
284563 

docs/draft/tools/debugging Changed · +22 / -21 lines

from line 18
1818 notification stream. This should be your first stop.
19192. **Server logging**: structured logs to stderr (stdio transport) or via
2020 [OpenTelemetry](https://opentelemetry.io/) (all transports).
21 [Logging](https://modelcontextprotocol.io/specification/draft/server/utilities/logging.md) over the protocol
22 (`notifications/message`) is deprecated as of protocol version `2026-07-28`.
21 Logging over the protocol (`notifications/message`) is
22 [deprecated](https://modelcontextprotocol.io/specification/draft/deprecated.md) as of protocol version `2026-07-28`.
23233. **Client developer tools**: most MCP clients expose logs and connection
2424 state. See [Debugging in Claude Desktop](#debugging-in-claude-desktop)
2525 below for one example, or consult your client's documentation.
from line 45
4545tooling (curl, browser DevTools Network panel) to inspect requests and SSE
4646streams.
4747 
48> [!WARNING]
49>
50> The `notifications/message` mechanism below is deprecated as of protocol
51> version `2026-07-28`. It remains available during the deprecation window.
52 
5348For all [transports](https://modelcontextprotocol.io/specification/latest/basic/transports.md), record what the
54server is doing as it runs:
49server is doing as it runs. For example, to write to stderr:
5550 
5651```python Python theme={null}
5752import logging
from line 66
7166```
7267 
7368```typescript TypeScript theme={null}
74await server.sendLoggingMessage({
75 level: "info",
76 data: "Server started successfully",
77});
78```
69import { McpServer } from "@modelcontextprotocol/server";
70import { z } from "zod";
7971 
80MCP defines eight
81[RFC 5424 severity levels](https://modelcontextprotocol.io/specification/latest/server/utilities/logging.md#log-levels)
82(`debug` through `emergency`). Clients opt in to log messages per request by
83setting the
84[`io.modelcontextprotocol/logLevel`](https://modelcontextprotocol.io/specification/draft/server/utilities/logging#per-request-log-level)
85field in the request's `_meta`. Servers must not send `notifications/message`
86for requests that omit this field.
72const server = new McpServer({ name: "reports", version: "1.0.0" });
73 
74server.registerTool(
75 "fetch_report",
76 {
77 description: "Fetch a report by id.",
78 inputSchema: z.object({ reportId: z.string() }),
79 },
80 async ({ reportId }) => {
81 console.error(`Fetching report ${reportId}`);
82 return {
83 content: [{ type: "text", text: `Report ${reportId} is ready.` }],
84 };
85 },
86);
87```
8788 
8889Important events to log:
8990 

docs/draft/tutorials/security/authorization Changed · +15 / -32 lines

### Dynamic Client Registration

from line 39
3939 M-->>C: authorization_servers, scopes_supported
4040 C->>A: GET authorization server metadata
4141 A-->>C: Endpoints and capabilities
42 Note over C,A: Client identifies itself:<br/>pre-registered ID, metadata document, or DCR
42 Note over C,A: Client identifies itself:<br/>pre-registered ID or metadata document
4343 Note over C: Record the issuer
4444 C->>B: Open authorization URL<br/>(PKCE challenge, resource, scope)
4545 B->>A: User logs in and consents
from line 194
194194| - | - |
195195| **Pre-registration** | The client already has credentials for this authorization server |
196196| **Client ID Metadata Documents** | Client and server have no prior relationship (most common) |
197| **Dynamic Client Registration** | Deprecated. For authorization servers that don't support Client ID Metadata Documents |
198197 
199A client that supports all three should try them in that order. If none is available, it should ask the user to enter the client information. See [Client Registration](https://modelcontextprotocol.io/specification/draft/basic/authorization/client-registration.md).
198A client that supports both should try them in that order. If neither is available, it should ask the user to enter the client ID, and the client secret if there is one, of a client registered with the authorization server. See [Client Registration](https://modelcontextprotocol.io/specification/draft/basic/authorization/client-registration.md).
200199 
200> [!WARNING]
201>
202> Dynamic Client Registration (DCR) is [deprecated](https://modelcontextprotocol.io/specification/draft/deprecated.md) as of protocol version `2026-07-28`. New implementations should use [Client ID Metadata Documents](#client-id-metadata-documents) (CIMD) instead.
203>
204> Existing clients can [fall back to DCR](https://modelcontextprotocol.io/specification/draft/basic/authorization/client-registration.md#dynamic-client-registration) before asking the user for a client ID and secret. This is applicable if the authorization server doesn't support CIMD and allows clients to register at runtime through its `registration_endpoint`.
205 
201206### Client ID Metadata Documents
202207 
203208With a [Client ID Metadata Document](https://datatracker.ietf.org/doc/html/draft-ietf-oauth-client-id-metadata-document-03) (CIMD), the client uses an HTTPS URL as its `client_id` and hosts a JSON document there. The authorization server fetches the document and validates it when it receives an authorization request.
from line 226
221226 
222227The client ID is set up in advance, along with credentials if they're needed. They can be built into the client or entered by the user.
223228 
224### Dynamic Client Registration
229Credentials belong to the authorization server that issued them. Clients must store them by `issuer` and never use them with another one. See [Authorization Server Binding](https://modelcontextprotocol.io/specification/draft/basic/authorization/client-registration.md#authorization-server-binding).
225230 
226> [!WARNING]
227>
228> Dynamic Client Registration (DCR) is deprecated. New implementations should
229> use Client ID Metadata Documents instead. DCR remains available for backwards
230> compatibility with authorization servers that don't support them.
231 
232With [DCR](https://datatracker.ietf.org/doc/html/rfc7591), the client posts its metadata to the authorization server's `registration_endpoint` and receives a client ID. Clients must include an appropriate `application_type`:
233 
234```json theme={null}
235{
236 "client_name": "Example MCP Client",
237 "redirect_uris": ["http://127.0.0.1:8090/callback"],
238 "grant_types": ["authorization_code", "refresh_token"],
239 "response_types": ["code"],
240 "token_endpoint_auth_method": "none",
241 "application_type": "native"
242}
243```
244 
245Pre-registered and DCR credentials belong to the authorization server that issued them. Clients must store them by `issuer` and never use them with another one. See [Authorization Server Binding](https://modelcontextprotocol.io/specification/draft/basic/authorization/client-registration.md#authorization-server-binding).
246 
247231## Choosing an Authorization Server
248232 
249Use an existing identity provider or authorization server product. Client registration happens between the client and the authorization server, so your MCP server needs no CIMD or DCR code.
233Use an existing identity provider or authorization server product. Client registration happens between the client and the authorization server, so your MCP server needs no registration code.
250234 
251235Check these points before you choose one:
252236 
from line 714
730714 
731715Also open your `METADATA_URL` and check that it contains `code_challenge_methods_supported`. Some clients work without it and others refuse to connect.
732716 
733Then run the full flow with the [MCP Inspector](https://modelcontextprotocol.io/docs/draft/tools/inspector/authorization.md), which needs Node.js 22.19 or later. The command below opens a browser for login and calls the tool:
717Then run the full flow with the [MCP Inspector](https://modelcontextprotocol.io/docs/draft/tools/inspector/authorization.md), which needs Node.js 22.23.4+, 24.22.1+, or 26.12.1+. The command below runs the login flow and calls the tool:
734718 
735719```bash theme={null}
736720npx @modelcontextprotocol/inspector --cli http://localhost:3000/mcp --transport http \
from line 725
741725 
742726`--protocol-era modern` makes the Inspector use the 2026-07-28 protocol.
743727 
744The Inspector's redirect URI is `http://127.0.0.1:6276/oauth/callback`. `--client-metadata-url` is the URL of a metadata document that you host, with this redirect URI in its `redirect_uris`. If your authorization server supports DCR and accepts registration from your machine, you can leave this option out. For a pre-registered client, register the redirect URI and use `--client-id` instead, with `--client-secret` if the client has a secret.
728By default, the Inspector's redirect URI is `http://127.0.0.1:6276/oauth/callback` (change it with `--callback-url`; it must be a loopback address). `--client-metadata-url` is the URL of a metadata document that you host, with this redirect URI in its `redirect_uris`. The authorization server must be able to fetch it. For a pre-registered client, register the redirect URI and use `--client-id` instead, with `--client-secret` if the client has a secret.
745729 
746730You can also connect from a client such as [Visual Studio Code](https://code.visualstudio.com). Run **MCP: Add Server** from the Command Palette, choose HTTP, and enter `http://localhost:3000/mcp`.
747731 
from line 737
753737> * **The metadata document is invalid.** Its `client_id` must be identical to its URL, including any trailing slash. The redirect URI in the request must be in `redirect_uris`. Authorization servers should accept any port for a loopback IP address, but some compare the port too.
754738> * **The authorization server rejects the `resource` value.** Register your server's URL exactly as clients send it, including the path and any trailing slash. The error might be `invalid_target`.
755739> * **The Inspector prints `auth_required` after a successful login.** Your server refused the new token. The command prints the same message for a `401` and a `403`. To see which one it is, send the token with `curl -i -X POST http://localhost:3000/mcp -H "Content-Type: application/json" -H "Authorization: Bearer <token>"`.
756> * **The Inspector still fails after you fix the configuration.** It keeps tokens and registered clients between runs. Add `--relogin` to discard them.
740> * **The Inspector still fails after you fix the configuration.** It keeps tokens and client details between runs. Add `--relogin` to discard them.
757741> * **Every token gets a `401`.** Decode a test token. `iss` must be exactly the same as `ISSUER`, and `aud` must contain exactly the expected audience, `http://localhost:3000/mcp` in the examples. If the token isn't a JWT, see [Opaque Tokens](#opaque-tokens). Check too that the clocks of the two servers agree.
758742> * **Every token gets a `403`.** If the response has an `insufficient_scope` error, the token's `scope` claim doesn't contain `mcp:tools`. Some authorization servers use a claim such as `scp`, or an array instead of a string. Change the code that reads the claim. If the token uses a shorter name than clients request, convert it to the full name there. If there is no such error, the `Host` or `Origin` header might have been refused. For a refused `Host`, the Python SDK answers `421` and ASP.NET Core answers `400`.
759743> * **The client refuses to start the flow.** Check that the authorization server metadata has `code_challenge_methods_supported` and that its `issuer` matches the PRM document.
from line 761
777761* **Return `5xx` during an outage**. If your server can't reach the JWKS or introspection endpoint, return a `5xx` status, as the TypeScript and Python examples do. The C# example does this only until it has downloaded the keys once. A `401` makes users log in again, and that doesn't fix the problem.
778762* **Separate client and server credentials**. Don't use your MCP server's introspection credentials in end-user flows.
779763* **Don't log credentials**. Remove `Authorization` headers, tokens, authorization codes, and secrets from your logs. Return generic errors to clients and keep the details in your own logs.
780* **Restrict Dynamic Client Registration**. Anyone can register with an open `registration_endpoint`, so add controls such as trusted hosts and rate limits.
764* **Restrict Dynamic Client Registration**. If your authorization server supports [DCR](#client-registration-approaches) with an open `registration_endpoint`, anyone can register a client. Disable DCR if your clients don't depend on it. Otherwise, restrict registration with controls such as trusted hosts and rate limits.
781765 
782766## Related Standards and Documentation
783767 
from line 774
790774* **[RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707)**: Resource Indicators
791775* **[RFC 9207](https://datatracker.ietf.org/doc/html/rfc9207)**: Authorization Server Issuer Identification
792776* **[OAuth Client ID Metadata Document](https://datatracker.ietf.org/doc/html/draft-ietf-oauth-client-id-metadata-document-03)**: Client IDs that are URLs
793* **[RFC 7591](https://datatracker.ietf.org/doc/html/rfc7591)**: Dynamic Client Registration
794777* **[RFC 6750](https://datatracker.ietf.org/doc/html/rfc6750)**: Bearer Token Usage
795778 
796779For more details, see:

extensions/auth/enterprise-managed-authorization Changed · +8 / -1 lines

from line 107
107107 
1081082. **Support SSO** — users should authenticate to the MCP Client using the enterprise IdP. Save the Identity Assertion (either an OpenID ID Token or SAML assertion) issued during login for later use.
109109 
1103. **Handle ID-JAGs** — when the server indicates that enterprise-managed auth is required, request an ID-JAG token from the enterprise IdP's authorization endpoint using the previously obtained Identity Assertion. Exchange this ID-JAG for an access token from the MCP Authorization Server. Do not redirect the user to the MCP Authorization Server's authorization endpoint.
1103. **Handle ID-JAGs** — when the server indicates that enterprise-managed auth is required, request an ID-JAG from the enterprise IdP's token endpoint using the previously obtained Identity Assertion. This is a Token Exchange ([RFC 8693](https://datatracker.ietf.org/doc/html/rfc8693)) request with these parameters:
111 
112 * `requested_token_type`: `urn:ietf:params:oauth:token-type:id-jag`
113 * `subject_token` and `subject_token_type`: the Identity Assertion and its type. SAML clients can instead exchange the assertion for a Refresh Token and send that.
114 * `audience`: the issuer identifier of the MCP Authorization Server
115 * `resource`: the resource identifier of the MCP Server. This parameter is optional. If it is included, the access token issued for the ID-JAG is audience-restricted to that MCP Server. If it is omitted, the behavior depends on the authorization server. For example, the authorization server can use a default resource or reject the request with an [`invalid_target`](https://datatracker.ietf.org/doc/html/rfc8707#section-2) error.
116 
117 Exchange this ID-JAG for an access token from the MCP Authorization Server's token endpoint, using the `urn:ietf:params:oauth:grant-type:jwt-bearer` grant. Do not redirect the user to the MCP Authorization Server's authorization endpoint.
111118 
1121194. **Support organization configuration** — allow administrators to configure the enterprise IdP's endpoints, typically via organization-level settings rather than per-user settings.
113120 

extensions/auth/oauth-client-credentials Changed · +3 / -3 lines

from line 39
3939 participant AS as Authorization Server
4040 participant MCP as MCP Server
4141 
42 Client->>AS: POST /token<br/>grant_type=urn:ietf:params:<br/>oauth:grant-type:jwt-bearer<br/>assertion=<signed JWT>
42 Client->>AS: POST /token<br/>grant_type=client_credentials<br/>client_assertion_type=urn:ietf:params:<br/>oauth:client-assertion-type:jwt-bearer<br/>client_assertion=<signed JWT><br/>resource=<MCP server URI>
4343 AS-->>Client: access_token
4444 Client->>MCP: MCP request (Bearer token)
4545```
from line 48
4848 
4949* `iss`: Client ID (the issuer)
5050* `sub`: Client ID (subject being authenticated)
51* `aud`: Authorization server token endpoint URL
51* `aud`: Authorization server issuer identifier (the `issuer` value from its metadata), as the only value. [RFC 10070](https://www.rfc-editor.org/rfc/rfc10070.html) disallows the token endpoint URL, which RFC 7523 permitted
5252* `exp`: Expiration time
5353* `iat`: Issued-at time
5454 
from line 62
6262 participant AS as Authorization Server
6363 participant MCP as MCP Server
6464 
65 Client->>AS: POST /token<br/>grant_type=client_credentials<br/>client_id + client_secret
65 Client->>AS: POST /token<br/>grant_type=client_credentials<br/>client_id + client_secret<br/>resource=<MCP server URI>
6666 AS-->>Client: access_token
6767 Client->>MCP: MCP request (Bearer token)
6868```

specification/2026-07-28/basic/authorization/index Changed · +21 / -1 lines

from line 269
269269Example request:
270270 
271271```http theme={null}
272GET /mcp HTTP/1.1
272POST /mcp HTTP/1.1
273273Host: mcp.example.com
274274Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
275Content-Type: application/json
276Accept: application/json, text/event-stream
277MCP-Protocol-Version: 2026-07-28
278Mcp-Method: tools/list
279 
280{
281 "jsonrpc": "2.0",
282 "id": 1,
283 "method": "tools/list",
284 "params": {
285 "_meta": {
286 "io.modelcontextprotocol/protocolVersion": "2026-07-28",
287 "io.modelcontextprotocol/clientInfo": {
288 "name": "ExampleClient",
289 "version": "1.0.0"
290 },
291 "io.modelcontextprotocol/clientCapabilities": {}
292 }
293 }
294}
275295```
276296 
277297### Token Handling

specification/2026-07-28/index Changed · +4 / -2 lines

from line 72
7272 
7373Beyond the core protocol, MCP defines optional [extensions](https://modelcontextprotocol.io/extensions/overview.md)
7474that add modular, specialized, or experimental functionality. Extensions
75are always opt-in and require explicit support from both client and server, negotiated
76during initialization. Notable extensions include:
75are always opt-in and require explicit support from both client and server, [negotiated
76through capabilities](https://modelcontextprotocol.io/extensions/overview.md#negotiation) that clients declare on each
77request and servers declare in their `server/discover` result.
78Notable extensions include:
7779 
7880* **[Tasks](https://modelcontextprotocol.io/extensions/tasks/overview.md)**: Asynchronous execution of long-running
7981 operations, with polling, mid-flight input, and durable handles

specification/draft/basic/authorization/index Changed · +21 / -1 lines

from line 269
269269Example request:
270270 
271271```http theme={null}
272GET /mcp HTTP/1.1
272POST /mcp HTTP/1.1
273273Host: mcp.example.com
274274Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
275Content-Type: application/json
276Accept: application/json, text/event-stream
277MCP-Protocol-Version: 2026-07-28
278Mcp-Method: tools/list
279 
280{
281 "jsonrpc": "2.0",
282 "id": 1,
283 "method": "tools/list",
284 "params": {
285 "_meta": {
286 "io.modelcontextprotocol/protocolVersion": "2026-07-28",
287 "io.modelcontextprotocol/clientInfo": {
288 "name": "ExampleClient",
289 "version": "1.0.0"
290 },
291 "io.modelcontextprotocol/clientCapabilities": {}
292 }
293 }
294}
275295```
276296 
277297### Token Handling

specification/draft/index Changed · +4 / -2 lines

from line 72
7272 
7373Beyond the core protocol, MCP defines optional [extensions](https://modelcontextprotocol.io/extensions/overview.md)
7474that add modular, specialized, or experimental functionality. Extensions
75are always opt-in and require explicit support from both client and server, negotiated
76during initialization. Notable extensions include:
75are always opt-in and require explicit support from both client and server, [negotiated
76through capabilities](https://modelcontextprotocol.io/extensions/overview.md#negotiation) that clients declare on each
77request and servers declare in their `server/discover` result.
78Notable extensions include:
7779 
7880* **[Tasks](https://modelcontextprotocol.io/extensions/tasks/overview.md)**: Asynchronous execution of long-running
7981 operations, with polling, mid-flight input, and durable handles

docs/2026-07-28/tools/inspector Changed · +1 / -1 lines

from line 20
2020 
2121## Quickstart
2222 
23The Inspector requires **Node 22.19.0 or newer** and runs directly through `npx`. No installation is required:
23The Inspector requires **Node.js 22.23.4+, 24.22.1+, or 26.12.1+** and runs directly through `npx`. No installation is required:
2424 
2525> [tab] Web
2626>

docs/2026-07-28/tutorials/security/security_best_practices Changed · +4 / -0 lines

from line 33
3333combination of static client IDs, dynamic client registration, and
3434consent cookies.
3535 
36> [!NOTE]
37>
38> Dynamic Client Registration is [deprecated](https://modelcontextprotocol.io/specification/2026-07-28/deprecated.md) as of protocol version `2026-07-28`. The attack still applies to MCP proxy servers that support it.
39 
3640#### Terminology
3741 
3842**MCP Proxy Server**

docs/draft/tools/inspector Changed · +1 / -1 lines

from line 20
2020 
2121## Quickstart
2222 
23The Inspector requires **Node 22.19.0 or newer** and runs directly through `npx`. No installation is required:
23The Inspector requires **Node.js 22.23.4+, 24.22.1+, or 26.12.1+** and runs directly through `npx`. No installation is required:
2424 
2525> [tab] Web
2626>

docs/draft/tutorials/security/security_best_practices Changed · +4 / -0 lines

from line 33
3333combination of static client IDs, dynamic client registration, and
3434consent cookies.
3535 
36> [!NOTE]
37>
38> Dynamic Client Registration is [deprecated](https://modelcontextprotocol.io/specification/draft/deprecated.md) as of protocol version `2026-07-28`. The attack still applies to MCP proxy servers that support it.
39 
3640#### Terminology
3741 
3842**MCP Proxy Server**

extensions/client-matrix Changed · +1 / -1 lines

from line 41
4141 
4242> [!NOTE]
4343>
44> Auth extension support (OAuth Client Credentials and Enterprise-Managed Authorization) is tracked separately from the core MCP authorization features (DCR, CIMD). Check each extension's specification and the [ext-auth repository](https://github.com/modelcontextprotocol/ext-auth) for the latest implementation status.
44> Auth extension support (OAuth Client Credentials and Enterprise-Managed Authorization) is tracked separately from the core MCP authorization features. Check each extension's specification and the [ext-auth repository](https://github.com/modelcontextprotocol/ext-auth) for the latest implementation status.
4545 
4646## Adding extension support to your client
4747 

extensions/overview Changed · +1 / -3 lines

from line 233
233233 "params": {
234234 "protocolVersion": "2025-11-25",
235235 "capabilities": {
236 "roots": {
237 "listChanged": true
238 },
236 "elicitation": {},
239237 "extensions": {
240238 "io.modelcontextprotocol/ui": {
241239 "mimeTypes": ["text/html;profile=mcp-app"]
Feedback