Understanding roots in MCP
Roots are a concept in MCP that define the boundaries where servers can operate. They provide a way for clients to inform servers about relevant resources and their locations.
A root is a URI that a client suggests a server should focus on. When a client connects to a server, it declares which roots the server should work with. While primarily used for filesystem paths, roots can be any valid URI including HTTP URLs.
For example, roots could be:
Roots serve several important purposes:
When a client supports roots, it:
roots
capability during connectionWhile roots are informational and not strictly enforcing, servers should:
Roots are commonly used to define:
When working with roots:
Here’s how a typical MCP client might expose roots:
This configuration suggests the server focus on both a local repository and an API endpoint while keeping them logically separated.
Understanding roots in MCP
Roots are a concept in MCP that define the boundaries where servers can operate. They provide a way for clients to inform servers about relevant resources and their locations.
A root is a URI that a client suggests a server should focus on. When a client connects to a server, it declares which roots the server should work with. While primarily used for filesystem paths, roots can be any valid URI including HTTP URLs.
For example, roots could be:
Roots serve several important purposes:
When a client supports roots, it:
roots
capability during connectionWhile roots are informational and not strictly enforcing, servers should:
Roots are commonly used to define:
When working with roots:
Here’s how a typical MCP client might expose roots:
This configuration suggests the server focus on both a local repository and an API endpoint while keeping them logically separated.