Roots support

From RedHatProductSecurity/prodsec-skills · View interactive version

Roots support is an AI agent skill from the GitHub repository RedHatProductSecurity/prodsec-skills. Enforce roots directive support in MCP servers. Use when building or reviewing MCP server filesystem access, directory scoping, or path boundary enforcement.

How to use this skill

Skill file

Roots Support for MCP Servers

Security Requirement

MCP servers MUST support the roots directive and respect root boundaries during all operations. The roots directive defines the allowed filesystem boundaries within which the MCP server can operate.

What Roots Provide

The roots mechanism allows MCP clients to declare which directories or resources the server is authorized to access. The server must:

Boundary Enforcement

Declared root: /home/user/project

Allowed:
  /home/user/project/src/main.py       ✓ (within root)
  /home/user/project/docs/readme.md    ✓ (within root)

Blocked:
  /home/user/.ssh/id_rsa               ✗ (outside root)
  /home/user/project/../.ssh/id_rsa    ✗ (traversal outside root)
  /etc/passwd                           ✗ (outside root)

Implementation Checklist

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.