0Pricing
MCP Academy · Lektion

Was Roots einem Server mitteilen

Ermitteln Sie, welche Ordner der Client verfügbar macht.

Was Roots einem Server mitteilen ist eine kostenlose MCP Academy-Lektion auf CoddyKit. Dies ist Lektion 1 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.

Servers Are a Little Blind

Your server runs as its own process, so it cannot just see the user's project. It needs the client to tell it which folders are fair game. That hint is called a root. 🧭

What a Root Really Is

A root is a single location a client says your server may work within, usually one project folder. It marks the edge of where you should reach.

Roots Are Usually file:// URIs

Most roots are file:// URIs pointing at a directory on disk. The scheme makes it explicit that you are looking at a local folder, not a web address.

file:///home/ada/projects/my-app

A Friendly Name Too

Each root can carry an optional name, a short label like "My App". It is just for humans, so logs and prompts read clearly instead of showing raw paths.

More Than One Root

A client can expose several roots at once, like a code folder plus a docs folder. Your server should treat the list as the full set of places it may touch.

Roots Are a Suggestion, Not a Cage

Roots are guidance, not hard enforcement by the protocol. They tell you where to focus, but it is on you to actually stay inside them. ✋

Why This Keeps Users Safe

Roots let a user say "work here, nowhere else." That scoping stops a server from wandering into private files far outside the project the user actually opened.

The Client Owns the List

The client decides what counts as a root, often from the workspace folder the user opened. Your server never sets its own roots; it only reads what it is given.

Roots Can Change

Roots are not frozen. If the user opens a new folder, the set changes, and a capable client can tell your server the list has been updated.

Not Every Client Has Them

Roots are an optional client feature. Some hosts offer them, some do not, so a well-built server works gracefully whether the list is full or empty.

How a Root Looks in JSON

On the wire a root entry is tiny: just a uri and an optional name. That small shape is all your server needs to know where it can operate.

{ "uri": "file:///home/ada/projects/my-app", "name": "My App" }

Quick Check

Make sure the purpose of a root is clear.

Recap: Roots in a Nutshell

You learned a root is a client-given location, often a file:// folder with an optional name, that scopes where your server should work. The client owns the list, and it can change. 🎯

Häufig gestellte Fragen

Ist die Lektion „Was Roots einem Server mitteilen“ kostenlos?

Ja — der vollständige Text von „Was Roots einem Server mitteilen“ 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 „Was Roots einem Server mitteilen“?

Ermitteln Sie, welche Ordner der Client verfügbar macht. 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 1 von 4.

Wie lange dauert die Lektion „Was Roots einem Server mitteilen“?

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. Was Roots einem Server mitteilen
  2. Die Roots des Clients anfordern
  3. Fähigkeiten aushandeln
  4. Grenzen des Clients respektieren
← Zurück zu MCP Academy