Authorize a modern Model Context Protocol (MCP) tool call.
Model Context Protocol (MCP) connects artificial intelligence (AI) applications to tools and resources. This lesson uses the modern 2026-07-28 Streamable Hypertext Transfer Protocol (HTTP) and authorization model.
Why this lesson?
An AI application connects to a remote order tool using modern stateless MCP. It must discover OAuth configuration, obtain a token for that exact resource, and authorize each tool call.
Learning goal and prerequisites
Probe the protected MCP endpoint
A modern MCP request is self-contained; there is no initialize handshake or protocol session. The client probes the server and, without a token, receives an OAuth challenge that points to Protected Resource Metadata and names the scope needed for this operation.
Inspect request, response, and claims
Try a failure scenario
↳ Change a condition
Read the detailed explanation
Why it exists, how it works, and where it fits
Model Context Protocol (MCP) lets an artificial intelligence (AI) application discover and call tools or resources provided by another server. Those tools may read private data or perform real actions. The fact that a model chose a tool is not proof that the user or application is authorized to use it, so MCP still needs normal security boundaries.
A modern remote MCP client first learns how the protected server is authorized. The server can publish Protected Resource Metadata that identifies the resource and its authorization server. The client obtains an OAuth access token for that exact MCP resource, using the authorization flow and client-registration model supported by the deployment.
With the 2026-07-28 protocol model, remote requests are self-contained rather than depending on an initialize handshake or protocol session identifier. Streamable Hypertext Transfer Protocol (HTTP) carries the request. Optional routing headers can help gateways understand the operation, while the JavaScript Object Notation (JSON) request body remains authoritative.
Before running a tool, the MCP server validates the token and authorizes the specific operation. It may reject a request with insufficient_scope when more permission is required. This separation matters: the AI model can propose an action, but the MCP server and underlying resource remain responsible for deciding whether that action is allowed.
Investigation
Inspect the traffic, select a diagnosis in the checkpoint, then reveal the repair.
Check your understanding
Pass the lesson quiz
Answer every question correctly to unlock the next lesson. Retry as often as you need.