# MCP Resource

> The MCP Resource is data exposed by an MCP server, such as a file or a record, that an AI application can read as context.

## What is a resource in MCP?

The read-only data that an MCP server exposes by URI, such as files, documents or database records. The application decides which resources to load into the model's context, unlike tools that the model calls itself.

- Topic: Model Context Protocol
- Type: concept

## Example

Wrong:

```json
{
  "uri": "report",
  "name": "report",
  "mimeType": "text/plain"
}
```

Right:

```json
{
  "uri": "file:///projects/app/README.md",
  "name": "README.md",
  "description": "Project overview and setup steps",
  "mimeType": "text/markdown"
}
```

A full stable URI, a description and a MIME type that matches the content let clients find and render the resource.

## Key points

- Resources expose only data the current user is allowed to read.
- Each resource has a stable URI and a MIME type that matches its content.

## Interview questions

### When should I use a resource instead of a tool in MCP?

Use a resource for data the app or user picks as context, like files or records. Use a tool when the model should decide to fetch or change something.

### What are MCP resource templates?

They describe a family of resources with a URI pattern, such as 'db://users/{id}', so clients can build URIs for specific items.

### Can MCP resources update?

Yes, servers can notify subscribed clients when a resource changes or when the list of resources changes.

## Related cards

- [MCP Server](https://wonderium.dev/ai/mcp-server.md)
- [MCP Tool](https://wonderium.dev/ai/mcp-tool.md)
- [Context Engineering](https://wonderium.dev/ai/context-engineering.md)

---

- Level: [Artificial Intelligence](https://wonderium.dev/ai.md)
- HTML version: https://wonderium.dev/ai/mcp-resource
- Last updated: 2026-11-25
