Intermediate8 min
MCP Resources & Prompts
Beyond tools: MCP servers can expose resources (data files, DB records, API responses) and prompts (reusable templates) that agents can load on demand.
Quick Reference
- →Resources = data exposed by MCP servers — files, DB records, API responses as Blob objects
- →client.get_resources() returns a list of available resources with URIs and descriptions
- →client.read_resource(uri) fetches the actual content — text or binary
- →Prompts = reusable prompt templates with parameters exposed by MCP servers
- →client.get_prompts() lists available prompts; client.get_prompt(name, args) returns messages
- →Elicitation = MCP servers can request interactive user input during tool execution
MCP Resources
MCP resources are read-only data that servers expose to agents. Unlike tools (which execute functions), resources provide data — configuration files, database schemas, documentation, API responses. Agents can discover available resources and load them on demand.
Discovering and reading MCP resources
| Resource Type | URI Pattern | Example Content |
|---|---|---|
| Database schema | db://schema/{table} | CREATE TABLE users (id INT, ...) |
| Config file | config://{name} | JSON/YAML configuration |
| Documentation | docs://{path} | Markdown documentation pages |
| API response | api://{endpoint} | Cached API response data |