0Pricing
MCP Academy · Lesson

Resources: Data the Model Reads

Read-only context the AI can pull in.

Resources: Data the Model Reads is a free MCP Academy lesson on CoddyKit — lesson 2 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the MCP Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

The Second Primitive

After tools comes the resource: read-only data your server hands to the model as context, like a file, a record, or a config value. 📄

Resources Are for Reading

A resource never changes the world. It only exposes information the model can read, the way a GET request fetches a page without editing anything.

Every Resource Has a URI

Each resource is addressed by a URI, such as file:///notes.txt or config://app. The scheme and path tell clients exactly what they are asking for.

Declaring a Resource

In Python you mark a function with @mcp.resource() and pass its URI. The function returns the content whenever a client reads that URI.

@mcp.resource("config://version")
def get_version() -> str:
    return "1.0.0"

Content Comes Back as Text

What your resource returns becomes the content the model reads. Plain strings work great for notes, settings, or any small document.

MIME Types Describe Content

A resource also carries a MIME type like text/plain or application/json. It tells the client how to interpret the bytes it receives.

Application-Controlled, Not Model-Picked

Resources are usually application-controlled. The host app or user chooses which ones to attach, rather than the model grabbing them on its own.

Listing What's Available

A client can ask your server to list its resources. That discovery step lets a host show the user which documents it can pull into context.

Reading a Resource

To fetch one, the client sends a read request with the URI. Your server runs the matching function and returns the current content.

Think Files and Records

Good resources are things you'd want the AI to see but not run: a README, a database row, log output, or the latest settings.

Tool vs Resource

A simple test: if it does something, make it a tool; if it just provides information to read, make it a resource. Action versus context.

Quick Check

Let's confirm what a resource is for.

Recap: Resources

Great! A resource is read-only context with a URI and MIME type. Clients list and read them, and the model gains information without running anything. ✅

Frequently asked questions

Is the “Resources: Data the Model Reads” lesson free?

Yes — the full text of “Resources: Data the Model Reads” is free to read here on the web, and the MCP Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the MCP Academy course, upgrade to CoddyKit PRO.

What will I learn in “Resources: Data the Model Reads”?

Read-only context the AI can pull in. You practise MCP Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start MCP Academy?

No prior experience is required. MCP Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 2 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Resources: Data the Model Reads” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this MCP Academy lesson?

Yes. Every MCP Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Tools: Actions the Model Takes
  2. Resources: Data the Model Reads
  3. Prompts: Reusable Instructions
  4. Picking the Right Primitive
← Back to MCP Academy