-
Notifications
You must be signed in to change notification settings - Fork 9.9k
Description
Problem
The git server refreshes client roots when listing repositories, but tool execution validates repo_path only against the optional command-line repository restriction. If roots change at runtime, a repo path that used to be reachable can still be used in later tool calls.
Why now
The git server is a reference implementation for safe repository access. Root changes need to revoke access deterministically instead of relying on an undefined reconnect/restart boundary.
Version under test
- Commit:
b60eca1b3bfcd12e2afe7000882db363a1b89f6e(origin/mainon 2026-03-17) - Runtime: Python
3.14.0, macOSdarwin/arm64
Minimal repro
- Start the git MCP server with roots support enabled and no fixed
--repositoryargument. - Expose repo
Athrough roots and successfully call a git tool against it. - Update the client roots so repo
Ais no longer allowed. - Reuse the old
repo_pathin another git tool call.
Expected behavior
The second call should be rejected based on the current roots.
Actual behavior
call_tool() only validates against the command-line repository restriction, so root-based access is not re-enforced during tool execution.
Code paths
src/git/src/mcp_server_git/server.pysrc/git/tests/test_server.pysrc/filesystem/roots-utils.tssrc/git/README.md
Validation target
Changing roots at runtime should revoke access to repositories that are no longer within the allowed set without requiring a restart.