Repository navigation
Commit 5b047e2
committed
fix(filesystem): preserve CLI directories when MCP roots are available
CLI-provided allowed directories are now respected as the authoritative
source when present. Previously, the oninitialized handler and
roots/list_changed notification handler would unconditionally replace
CLI directories with the client's MCP roots, making it impossible to
scope the server to directories outside the client's project root.
The fix tracks whether directories were explicitly provided via CLI
arguments and skips root resolution in both handlers when they were.
MCP roots are still used as a fallback when no CLI directories are given.
Fixes modelcontextprotocol#39291 parent d5bfe34 commit 5b047e2
1 file changed
Lines changed: 15 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
92 | 97 | | |
93 | 98 | | |
94 | 99 | | |
| |||
715 | 720 | | |
716 | 721 | | |
717 | 722 | | |
| 723 | + | |
718 | 724 | | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
719 | 729 | | |
720 | 730 | | |
721 | 731 | | |
| |||
728 | 738 | | |
729 | 739 | | |
730 | 740 | | |
| 741 | + | |
| 742 | + | |
731 | 743 | | |
732 | 744 | | |
733 | 745 | | |
734 | | - | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
735 | 749 | | |
736 | 750 | | |
737 | 751 | | |
| |||
0 commit comments