liveBook · Manning

MCP resource

As explained in AI Agents in Action, Second Edition

An MCP resource is a data-bearing capability that an MCP server exposes for a client, agent, or language model to read.

An MCP resource is a data-bearing capability that an MCP server exposes for a client, agent, or language model to read. It can represent an external database, file, configuration, or another service-backed entity. Unlike a tool, which an agent invokes to perform an action, a resource is typically selected by a user or surfaced by the application for attachment to a conversation. section 3.1.3

Use the three MCP primitives as a simple division of responsibility:

  • Tools provide actionable capabilities and are generally model-controlled: the agent decides when to invoke them. section 3.1.3
  • Resources provide data or objects, such as files, databases, and configurations, and are typically user-controlled or application-controlled. section 3.1.3
  • Prompts provide reusable templates for interacting with workflows, tools, and resources. section 3.1.3

A standard connection to external data

Before MCP, an agent developer had to build separate integrations for each API, SDK, protocol, and result format. With MCP, a client connects to a server that wraps the underlying database, file service, or web API; the protocol supplies a uniform interface while security, authentication, error handling, versioning, and availability remain operational concerns. section 3.1.2 section 3.6

Figure 3.5 The main components of an MCP server include prompts, specialized system instructions, resources (used for access to files), configuration, databases, and tools, which are extensions of an internal agent’s ability to consume and use tools.

Use the component diagram to distinguish resources from tools and prompts and to see how files, configuration, and databases fit into an MCP server. section 3.1.3

How AI Agents in Action, Second Edition covers it

How deep it goes
Defines resources, contrasts them with tools and prompts, and stops short of detailed resource implementation.
Examples
Uses databases, files, configurations, web APIs, and service integrations as resource examples.
What you can do after
Evaluate whether data access belongs in a resource, tool, or prompt and understand its place in MCP architecture.
How it connects
Connects resources with MCP clients, servers, services, tools, prompts, and JSON-RPC 2.0.

Also explained in

Compare how 4 books explain MCP resource →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of AI Agents in Action, Second Edition. The section links point to the parts of the book it draws on.