MCP Academy · Lesson

Request the Client's Roots

Ask for the list of allowed working directories.

Now Let's Ask for Them

Knowing roots exist is step one. Step two is actually asking the client for its current list so your server can decide where to read or write. 📨

The Server Initiates

Here the direction flips: your server sends the request and the client answers. The method it calls is roots/list, asking for everything the client currently exposes.

{ "method": "roots/list" }

All lessons in this course

  1. What Roots Tell a Server
  2. Request the Client's Roots
  3. Negotiating Capabilities
  4. Respect Client Boundaries
← Back to MCP Academy