0Pricing
MCP Academy · Lekcja

Zasoby: dane odczytywane przez model

Kontekst tylko do odczytu, który AI może pobrać.

Zasoby: dane odczytywane przez model to bezpłatna lekcja MCP Academy na CoddyKit. To lekcja 2 z 4. Możesz przeczytać całą lekcję poniżej za darmo — a potem ćwiczyć ją interaktywnie w przeglądarce z wbudowanym edytorem kodu i tutorem AI dostępnym 24/7. To część ścieżki edukacyjnej MCP Academy, a Twój postęp synchronizuje się między webem a aplikacją CoddyKit. Kurs MCP Academy zawiera 4 lekcji w sumie.

Części tej lekcji nie zostały jeszcze przetłumaczone i są wyświetlane po angielsku.

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

Często zadawane pytania

Czy lekcja „Zasoby: dane odczytywane przez model” jest bezpłatna?

Tak — pełny tekst „Zasoby: dane odczytywane przez model” jest dostępny za darmo tutaj w sieci. Aby ćwiczyć ją interaktywnie (wbudowany edytor kodu i tutor AI dostępny 24/7) i odblokować resztę kursu MCP Academy, przejdź na CoddyKit PRO. Kurs MCP Academy zawiera 4 lekcji w sumie.

Co nauczysz się w „Zasoby: dane odczytywane przez model”?

Kontekst tylko do odczytu, który AI może pobrać. Ćwiczysz MCP Academy z praktycznym kodem, który uruchamiasz bezpośrednio w przeglądarce, a tutor AI dostępny 24/7 odpowiada na Twoje pytania podczas pracy nad lekcją.

Czy potrzebuję doświadczenia, aby zacząć MCP Academy?

Nie wymagamy żadnego doświadczenia. MCP Academy w CoddyKit jest strukturyzowany dla początkujących i zaawansowanych użytkowników, więc możesz zacząć tutaj lub od początku i uczyć się w swoim tempie. To lekcja 2 z 4.

Ile czasu zajmuje lekcja „Zasoby: dane odczytywane przez model”?

Większość lekcji CoddyKit trwa około 5–10 minut. Każda lekcja to mały, interaktywny krok, dzięki czemu robisz systematyczne postępy i zawsze wracasz dokładnie do tego samego miejsca — na webie i w aplikacji.

Czy mogę pisać i uruchamiać kod w tej lekcji MCP Academy?

Tak. Każda lekcja MCP Academy zawiera wbudowany edytor kodu, więc piszesz i uruchamiasz prawdziwy kod bezpośrednio w przeglądarce i od razu otrzymujesz sprzężenie zwrotne od AI — bez konfiguracji na komputerze.

Wszystkie lekcje w tym kursie

  1. Narzędzia: działania wykonywane przez model
  2. Zasoby: dane odczytywane przez model
  3. Prompty: instrukcje wielokrotnego użytku
  4. Wybór właściwego prymitywu
← Powrót do MCP Academy