Safeguard
AI Security•

Do MCP roots restrict which files a server can read?

No. MCP roots are informational, not access control, and servers are not forced to stay inside them. Here is what to use instead to limit file access.

Safeguard Security Team
3 min read

No. MCP roots tell a server which directories the client considers relevant, but the spec calls them informational guidance rather than an access-control mechanism, and the protocol does not enforce that servers stay inside them. To limit file access you need operating system or sandbox controls.

What roots are

A root is a file URI, such as a project folder, that the client shares with a server so the server can focus its work. A workspace picker in an editor is a typical source. The server can ask for the list and use it to decide where to look.

Nothing in that exchange stops a local server process from opening other paths. A server that runs as your user has your user's file access, whatever it was told about roots.

What the spec asks of each side

For clients, the draft says they must expose only roots with appropriate permissions, validate root URIs to prevent path traversal, implement access controls and monitor root accessibility. They should ask for consent before sharing roots.

For servers, it says they should respect root boundaries and validate paths against the roots they were given. That is a request for good behaviour, not a lock.

Roots versus real controls

QuestionRootsSandbox or OS permission
Tells the server where to focusYesNo
Stops a read outside the folderNoYes
Works against a malicious serverNoYes, if configured well
Needs the server to cooperateYesNo

If a server is not trusted, roots give you nothing. If it is trusted, roots are a convenience that also reduces accidents.

How to actually limit file access

  1. Run local servers in a container or application sandbox with only the needed folder mounted.
  2. Mount read only when the task does not need to write.
  3. Keep home directories, SSH keys and cloud credentials out of the mount.
  4. Use a dedicated low privilege user for server processes where you can.
  5. Log file operations so an unexpected read stands out.

Status note

The draft marks roots as deprecated as of protocol version 2026-07-28. It suggests passing directories or files through tool parameters, resource URIs or server configuration instead. Either way, the rule is the same: configuration and sandboxing decide access, not a hint sent over the protocol.

Safeguard includes asset discovery and agent identity, which help you see which agents and servers exist before you decide what to sandbox. A free scan is at https://gold.safeguard.sh/scan.

Quick check

Can a client ignore roots?

Yes. Clients decide what to share, and the protocol says roots are guidance. A server can also ignore them.

Is a read only root possible?

Roots carry a location and a name, not a permission. Read only access has to come from how the server is run, such as a read only mount.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.