How can you provide root information to an MCP server?
MCP Advanced: Roots, File System Access, Path Permissions, Security Boundaries
Audio flashcard · 0:27Nortren·
How can you provide root information to an MCP server?
0:27
You can provide root information in two ways. The first is through the list_roots method that the server calls on the client, which returns the currently configured root directories. The second is by injecting root paths directly into prompts or tool descriptions so Claude knows where to look without making a separate call. The choice depends on your application architecture. Dynamic roots that can change during a session use the list_roots approach, while static roots that are always the same can be hardcoded into the server configuration.
modelcontextprotocol.io