MCP · Lesson 31 of 120
Resources
Data the app can read.
Tools do things. Resources are data. A resource is something the app can read, like a policy page or a store's details. Each one has an address, called a URI, like policy colon slash slash returns.

- Tools do
- Resources are data
- Each has a URI
A returns policy resource
The resource decorator takes a URI. The function returns the content. The client lists resources, then reads one by its URI. Run it. We see the policy's address, and its text.
resource.pypython
import asyncio
from mcp import Client
from mcp.server.mcpserver import MCPServer
mcp = MCPServer("northwind")
@mcp.resource("policy://returns")
def returns_policy() -> str:
"""Northwind's returns policy."""
return "You can return any unused item within 30 days of delivery."
async def main():
async with Client(mcp) as client:
print([str(r.uri) for r in (await client.list_resources()).resources])
result = await client.read_resource("policy://returns")
print(result.contents[0].text)
asyncio.run(main())Output
['policy://returns'] You can return any unused item within 30 days of delivery.
Tools and resources
A tool is chosen by the model, and may change things. A resource is usually chosen by the app or the user, and is read only. The host decides how to show resources, like a list the user can attach to the chat.
Tool
- Chosen by the modelCan change thingsHas inputs
Resource
- Chosen by app or userRead onlyHas a URI
Summary
Resources are read only data, each with a URI, listed and read by the client. Next, resource templates.
Key takeaways- @mcp.resource
- URI
- read_resource
Next up: Resource Templates — one pattern, many URIs