0Pricing
MCP Academy · Lektion

Ressourcen: Vom Modell gelesene Daten

Schreibgeschützter Kontext, den die KI abrufen kann.

Ressourcen: Vom Modell gelesene Daten ist eine kostenlose MCP Academy-Lektion auf CoddyKit. Dies ist Lektion 2 von 4. Du kannst die komplette Lektion unten kostenlos lesen – dann übst du sie direkt im Browser mit einem integrierten Code-Editor und einem KI-Tutor rund um die Uhr. Sie ist Teil des MCP Academy-Lernpfads, und dein Fortschritt wird über Web und CoddyKit-App synchronisiert. Der MCP Academy-Kurs umfasst insgesamt 4 Lektionen.

Teile dieser Lektion wurden noch nicht übersetzt und werden auf Englisch angezeigt.

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. ✅

Häufig gestellte Fragen

Ist die Lektion „Ressourcen: Vom Modell gelesene Daten“ kostenlos?

Ja — der vollständige Text von „Ressourcen: Vom Modell gelesene Daten“ ist hier im Web kostenlos zu lesen. Um sie interaktiv zu üben (integrierter Code-Editor und 24/7 KI-Tutor) und den Rest des MCP Academy-Kurses freizuschalten, upgrade auf CoddyKit PRO. Der MCP Academy-Kurs umfasst insgesamt 4 Lektionen.

Was lerne ich in „Ressourcen: Vom Modell gelesene Daten“?

Schreibgeschützter Kontext, den die KI abrufen kann. Du übst MCP Academy mit praktischem Code, den du direkt im Browser ausführst, und ein 24/7 KI-Tutor beantwortet deine Fragen während du die Lektion bearbeitest.

Brauche ich Erfahrung, um MCP Academy zu starten?

Keine Vorkenntnisse erforderlich. MCP Academy auf CoddyKit ist für Anfänger bis fortgeschrittene Lernende strukturiert, sodass du hier starten oder von Anfang an beginnen und in deinem eigenen Tempo voranschreiten kannst. Dies ist Lektion 2 von 4.

Wie lange dauert die Lektion „Ressourcen: Vom Modell gelesene Daten“?

Die meisten CoddyKit-Lektionen dauern etwa 5–10 Minuten. Jede ist kompakt und interaktiv, sodass du stetig Fortschritte machst und genau dort weitermachst, wo du aufgehört hast – im Web und in der App.

Kann ich in dieser MCP Academy-Lektion Code schreiben und ausführen?

Ja. Jede MCP Academy-Lektion enthält einen integrierten Code-Editor, sodass du echten Code direkt in deinem Browser schreibst und ausführst und sofort KI-Feedback erhältst — ohne lokale Einrichtung erforderlich.

Alle Lektionen in diesem Kurs

  1. Tools: Aktionen des Modells
  2. Ressourcen: Vom Modell gelesene Daten
  3. Prompts: Wiederverwendbare Anweisungen
  4. Das richtige Primitiv auswählen
← Zurück zu MCP Academy