Skip to main content
Welcome back — in this lesson we focus on application-controlled resources in the shipment-tracker server and how they are registered, exposed, and inspected with the MCP Inspector. We will:
  • Start the server (stdio mode for the demo).
  • Observe the MCP handshake and the resources/list exchange in the Inspector.
  • Examine how a resource is declared in the server code and what it returns.
Start the server (stdio is used for this demo):
When the server starts you will see the MCP handshake and initialization sequence in the Inspector. The client requests resources/list; the server responds with a resource entry describing a fleet summary resource. The Inspector displays the resource entry with a short description and a MIME type of text/plain. The resource is exposed under a URI like shipment://fleet/summary. The server stores a text representation for that URI which the client can read on demand. Example content returned by the resource (as shown by the Inspector):
What do resources actually do?
  • Resources are application-controlled, read-only artifacts. The host (your application) decides what to read and when to provide their contents to a model.
  • The client asks the server for a list of available resources. The client then fetches a resource and supplies its contents to the model when relevant to the task.
  • Resource reads must be side-effect free. If reading something mutates state, it should be implemented as a tool (not a resource).
Resources are read-only, application-controlled artifacts. They provide contextual data to the model but are never automatically accessed by the model itself.

Inspecting the registration and server configuration

The server registers itself with the MCP runtime using mcp.json (stdio example):
In server.py we register an application resource with a URI using @server.resource(...). Below is the relevant fragment showing the resource registration and the server run logic:
Why this code matters
  • The decorator @server.resource("shipment://fleet/summary") registers the resource URI with the server so clients can discover it via resources/list.
  • fleet_summary() iterates over the SHIPMENTS fixture, tallies statuses, and returns a plain-text summary. This returned string is exactly what clients (and the Inspector) see when requesting the resource.
  • Because the function returns a static/plain text summary (no side effects), it fits the resource model. Any version that mutates state should instead be a tool.
Quick resource summary (at-a-glance) Notes about running the server and fetching the resource
  • Default (stdio): run without flags to integrate with the MCP Inspector and demo client.
  • HTTP mode: run with --http to serve MCP over HTTP. This sets json_response=True so curl and the Inspector’s Network tab show a readable body rather than an SSE stream.
Example: fetch the resource over HTTP (when server started with --http):
Protocol-era recap
  • Historically, resources are explicitly application-controlled: the host decides when to fetch them and when to supply them to the model. The model does not autonomously fetch resources from the server — the client mediates access.
Next steps
  • In later lessons we’ll examine handlers and explore the trace_journey tool inserted into server.py. Tools are the mechanism the model CAN reach for (they are not passive, read-only artifacts).
Links and references

Watch Video