Support MCP `roots` capability with `listChanged` notifications

Resolved 💬 2 comments Opened Apr 27, 2026 by apoc Closed Jun 20, 2026

Summary

Claude Code currently does not implement the MCP roots capability as an MCP client. It would be valuable for Claude Code to:

  1. Declare the roots client capability with listChanged: true during MCP initialization
  2. Respond to roots/list requests from MCP servers
  3. Emit notifications/roots/list_changed whenever the active set of working directories changes

Motivation

The roots feature is how MCP servers learn which workspace/project boundaries the client is operating within. Without it, servers have to either guess, require manual configuration, or fall back to process-cwd heuristics — none of which match what the user is actually working on inside Claude Code.

Claude Code is a particularly good fit for this capability because the set of roots is not static during a session:

  • claude --add-dir <path> [<path> ...] lets users start a session with multiple directories
  • The /add-dir slash command lets users add additional directories mid-session

Every /add-dir invocation is exactly the kind of event the notifications/roots/list_changed notification was designed for. Today, MCP servers connected to Claude Code have no way to learn that the user just expanded the workspace, so any server logic scoped to "the current project" silently goes stale.

Use cases this would unlock

  • Code-search / indexing servers that want to (re-)index only the directories the user is actively working in
  • Linter / formatter / test-runner servers that need to know project boundaries to locate config files
  • Documentation servers that scope results to the current workspace
  • Any server that today requires a redundant cwd argument on every tool call

Current state

Claude Code already supports list_changed notifications for tools, prompts, and resources (per the MCP servers docs). Adding roots would round out client-side coverage of the MCP spec's listChanged notifications and bring Claude Code in line with other MCP clients.

References

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗