Whatever message this page gives is out now! Go check it out!

Roots

Last update:
May 18, 2026
Define resource boundaries for security, performance, and context switching.
Roots inform servers about relevant resource locations the client can access. They define URI boundaries for:
  • Security: limiting directories, tenants, or systems in-scope
  • Performance: preventing scanning of irrelevant resource spaces
  • Context switching: switching tenant or project context
Root structure: { uri: "file:///...", name: "Test Cases" }
  1. Add a root.
    ADDITIONAL INFORMATION:
mcpClient.addRoot("file:///home/user/testcases", "Test Cases");
  1. Get a specific root.
    ADDITIONAL INFORMATION:
root = mcpClient.getRoot("file:///home/user/testcases");
  1. Returns: { uri: "file:///...", name: "Test Cases" }
  2. List all roots.
    ADDITIONAL INFORMATION:
roots = mcpClient.listRoots();
  1. Returns: { roots: [{ uri: "...", name: "..." }] }
  2. Remove a root.
    ADDITIONAL INFORMATION:
mcpClient.removeRoot("file:///home/user/testcases");
  1. Notify server of root changes.
    ADDITIONAL INFORMATION:
mcpClient.rootsListChangedNotification();
Result
Your MCP client now manages secure resource boundaries effectively.

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page