---
schema: rendered-html/v1
title: "Client Roots - FastMCP"
source_url: https://gofastmcp.com/clients/roots
generated_at: 2026-06-11T19:37:37.695173+00:00
---




[FastMCP home page![light logo](images/gofastmcp__com__clients__roots__wordmark.avif)![dark logo](images/gofastmcp__com__clients__roots__wordmark-white.avif)](gofastmcp__com.md)


- [PrefectHQ/fastmcp](https://github.com/PrefectHQ/fastmcp "PrefectHQ/fastmcp")
- [PrefectHQ/fastmcp](https://github.com/PrefectHQ/fastmcp "PrefectHQ/fastmcp")



Operations

Client Roots


⌘K















  - [Tools](gofastmcp__com__clients__tools.md)
  - [Resources](gofastmcp__com__clients__resources.md)
  - [Prompts](gofastmcp__com__clients__prompts.md)
  - [Sampling](gofastmcp__com__clients__sampling.md)
  - [Elicitation](gofastmcp__com__clients__elicitation.md)
  - [Tasks

    NEW](gofastmcp__com__clients__tasks.md)
  - [Progress](gofastmcp__com__clients__progress.md)
  - [Logging](gofastmcp__com__clients__logging.md)
  - [Roots](/clients/roots)
  - [Notifications](gofastmcp__com__clients__notifications.md)






- [Static Roots](#static-roots)
- [Dynamic Roots](#dynamic-roots)

Operations

# Client Roots


Provide local context and resource boundaries to MCP servers.


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) Static Roots

Provide a list of roots when creating the client:


client = Client(
    "my_mcp_server.py",
    roots=["/path/to/root1", "/path/to/root2"]

## [​](#dynamic-roots) Dynamic Roots

Use a callback to compute roots dynamically when the server requests them:

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](gofastmcp__com__clients__logging.md)[Notifications

Next](gofastmcp__com__clients__notifications.md)

⌘I




