MP-101 · Module 2

Resources

3 min read

Resources are read-only data sources that the AI model or the application can access through MCP. While tools are actions — things the model does — resources are data — things the model reads. A resource is identified by a URI, just like a web page. The scheme tells you where the data lives: file:// for local files, https:// for web resources, postgres:// for database tables, or any custom scheme a server defines. The resource content can be text, JSON, binary data, or any format the server provides.

Resources support two access patterns. Direct resources have a fixed URI that the client can request at any time — like a specific file or configuration document. Resource templates use URI patterns with parameters, letting the client construct URIs dynamically — like "db://tables/{table_name}/schema" where {table_name} is filled in at request time. This gives the model structured access to large data surfaces without enumerating every possible resource upfront.

Subscriptions add a real-time dimension. A client can subscribe to a resource and receive notifications when the data changes. This is how MCP handles live data — log files that grow, database tables that update, configuration that changes. The server pushes a notification, the client decides whether to re-read the resource, and the model gets fresh data without polling. For infrastructure work, this is the feature that makes MCP a monitoring tool, not just a query tool.

  1. Static Resources Fixed URIs like file:///etc/config.json or docs://api-reference. The client requests them directly. Good for configuration, documentation, and reference data that changes infrequently.
  2. Dynamic Resource Templates URI patterns like logs://{service}/{date} that the client fills in at request time. Good for large data surfaces where enumerating every resource is impractical — database tables, log streams, user profiles.
  3. Subscriptions The client subscribes to a resource URI. When the data changes, the server sends a notification. The client re-reads the resource. Good for monitoring, live dashboards, and any data that updates frequently.