URL: https://gofastmcp.com/clients/roots
Title: Client Roots - FastMCP

Documentation Index
Fetch the complete documentation index at:
/llms.txt
Use this file to discover all available pages before exploring further.
Skip to main content
Meet
Prefect Horizon
, the enterprise MCP gateway built by the team behind FastMCP
FastMCP
home page
v3
Prefect Horizon
PrefectHQ/fastmcp
PrefectHQ/fastmcp
Search...
Navigation
Operations
Client Roots
Search the docs...
⌘
K
Documentation
Get Started
Welcome!
Installation
Quickstart
Servers
Overview
Core Components
Working with Tools
MCP Providers
Interactivity
Extensibility
Auth
Deployment
Apps
Overview
Quickstart
NEW
FastMCPApp
NEW
Interactive Tools
NEW
Generative UI
NEW
Custom HTML
Reference
Clients
Overview
Client-Only Package
Transports
fastmcp-remote
Operations
UPDATED
Tools
Resources
Prompts
Sampling
Elicitation
Tasks
NEW
Progress
Logging
Roots
Notifications
Authentication
UPDATED
Integrations
Auth
Web Frameworks
AI Assistants
AI SDKs
MCP.json
More
Settings
CLI
Upgrading
Development
What's New
FAQ
On this page
Static Roots
Dynamic Roots
Operations
Client Roots
Copy page
Provide local context and resource boundaries to MCP servers.
Copy page
New in version
2.0.0
Use this when you need to tell servers what local resources the client has access to.
Roots inform servers about resources the client can provide. Servers can use this information to adjust behavior or provide more relevant responses.
​
Static Roots
Provide a list of roots when creating the client:
from
fastmcp
import
Client
client
=
Client
(
"
my_mcp_server.py
"
,
roots
=[
"
/path/to/root1
"
,
"
/path/to/root2
"
]
)
​
Dynamic Roots
Use a callback to compute roots dynamically when the server requests them:
from
fastmcp
import
Client
from
fastmcp
.
client
.
roots
import
RequestContext
async
def
roots_callback
(
context
:
RequestContext
)
->
list
[
str
]:
print
(
f
"Server requested roots (Request ID:
{
context
.
request_id
}
)"
)
return
[
"
/path/to/root1
"
,
"
/path/to/root2
"
]
client
=
Client
(
"
my_mcp_server.py
"
,
roots
=
roots_callback
)
Server Logging
Previous
Notifications
Next
⌘
I
discord
github
website
x
Powered by
This documentation is built and hosted on Mintlify, a developer documentation platform
Assistant
Responses are generated using AI and may contain mistakes.
