What are MCP roots? Workspace hints for servers

By

MCP roots tell a server which files or directories matter to a client. Learn how coding tools use them, their limits, and the current migration guidance.

MCP roots are file URIs a client shares with a server to identify relevant files or directories. They help a server understand the workspace, while the server and operating system enforce access permissions.

Roots are deprecated in the current MCP specification. New implementations should pass paths through tool arguments, resource URIs, or server configuration. Stateless MCP explains the wider changes.

How MCP roots work

A supporting server requests the client’s list through roots/list. Each root has a URI and can have a display name.

An MCP server learns the client's workspaceThe server asks the client for roots. The client returns relevant file URIs. The server applies its own access policy when handling files.roots/listfile URIsServerClientServer access policyFilesystem

The roots specification calls roots informational guidance. A root URI does not create a filesystem sandbox.

In coding tools

Claude Code documents returning its launch directory and additional working directories in roots/list. Cursor lists Roots as supported.

The MCP guides for Codex and Grok Build do not document roots behavior. Check the client before relying on it.

Details checked against each vendor’s documentation in November 2026.

A concrete example

In the MCP filesystem walkthrough, the server was started with a practice directory. Claude Code supplied workspace roots, and that server replaced its configured folders with them.

The tutorial fixes this with the server’s --confine-roots flag. That flag lets client roots narrow the configured directories. It belongs to this filesystem server, so check another server’s own configuration before reusing it.

When to use it

Look for roots when a filesystem server sees a different directory than you expected. Compare the launch arguments, client workspace, and server policy.

For a new integration, follow the migration guidance and make the intended files or directories explicit.

Pitfalls

A root list describes the client’s workspace. A server can ignore it, and an unrestricted process can still access files permitted by its environment. Use sandboxing when you need an enforced process boundary.

Avoid granting a broad working directory just to make one tool call succeed. Check what the server will do with that directory first.

For a concrete app that connects coding tools to external operations, see Cloudflare Domains Toolkit. Its approval tutorial covers the separate checks needed before a purchase.

  • stdio (MCP transport): Stdio connects an MCP client to a server process through standard input and output. Learn when to use it, how coding tools configure it, and common mistakes.
  • Sandbox: An agent sandbox limits which files and hosts a coding agent's commands can reach. How the boundary works in Claude Code, Codex, Cursor and Grok Build.
  • MCP resources: MCP resources expose files, schemas, and other context through a server. Learn how clients read them, how Claude Code references them, and common pitfalls.

All AI glossary entries → · AI for coding hub →

Want me to talk about your product? You can sponsor this site.