How does the resource request and response cycle work in MCP?
Defining MCP Resources for Data Access
Audio flashcard · 0:33Nortren·
How does the resource request and response cycle work in MCP?
0:33
Resources follow a request-response pattern. When your client needs data, it sends a read resource request with a URI that identifies which resource it wants. The MCP server processes that request and returns the data inside a read resource result. The flow looks like this: your application code asks the MCP client for a resource, the MCP client forwards the request to the MCP server, the server processes the URI, runs the appropriate function you registered, and returns the result back through the client to your code. From your application's perspective, fetching a resource is just one function call.
modelcontextprotocol.io