docs(git): clarify unconfined default scope and repository confinement options in README and CLI
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 73/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- python
- Lĩnh vực
- cli, documentation, security
Hướng nghiên cứu
Đọc src/git/README.md trong mục Configuration và kiểm tra tùy chọn --repository trong src/git/src/mcp_server_git/__init__.py. Cập nhật cảnh báo trong README và phần trợ giúp CLI để giải thích rằng bỏ qua tùy chọn này cho phép truy cập mọi kho lưu trữ có thể truy cập; ghi lại hành vi của None trong src/git/src/mcp_server_git/server.py và kiểm tra assertion về trợ giúp trong src/git/tests/test_entrypoints.py. Hoàn tất khi các phần này giải thích nhất quán về giới hạn truy cập.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Server:git (mcp-server-git)
Server Version / Environment:
- Version:
2026.10.19(Python SDK>=2.3,<3) - Transport:
stdio - OS: Linux / macOS / Windows
Description & Motivation:
In mcp-server-git, tools accept repo_path (e.g., git_status, git_diff, git_commit, etc.).
When --repository <path> is passed at startup, validate_repo_path() rejects any tool calls outside the allowed repository root.
However, when launched without --repository (such as in standard client configurations like uvx mcp-server-git), allowed_repository defaults to None. In this mode, validate_repo_path() is a no-op, allowing any tool call to access and mutate any reachable Git repository across the host filesystem under the running user's process privileges (as pinned by test_without_repository_any_repository_is_reachable under #4550).
While this multi-repository reach is an intentional architectural capability, it is not prominently communicated to users in either the CLI --help or README.md. Users configuring the server may assume it is scoped only to the workspace or current directory.
Prompt Used to Generate the Change:
In src/git, clarify that omitting --repository leaves the server in unconfined mode where all reachable repositories on the filesystem are accessible to tool calls.
1. In src/git/README.md, add an official GitHub alert (> [!WARNING]) under Configuration explaining that without --repository, every reachable Git repository is in scope, and describe how to confine operations via --repository <path>.
2. In src/git/src/mcp_server_git/__init__.py, update the Click option help text for --repository to: 'Git repository path to confine operations to. Without this option, every reachable repository is in scope.'
3. In src/git/src/mcp_server_git/server.py, update validate_repo_path's docstring to document the None behavior.
4. In src/git/tests/test_entrypoints.py, update test_main_help to assert that the confinement message is present in --help output.
Behavior Before vs. After:
| Surface | Before | After |
|---|---|---|
mcp-server-git --help |
-r, --repository PATH Git repository path |
-r, --repository PATH Git repository path to confine operations to. Without this option, every reachable repository is in scope. |
src/git/README.md |
Generic text mentioning --repository resolves to top-level |
High-visibility GitHub alert > [!WARNING] detailing unconfined vs confined modes |
server.py docstring |
Did not mention allowed_repository=None |
Explicitly states: "When allowed_repository is None, no restriction is configured and any reachable repository on the filesystem is permitted." |
test_entrypoints.py |
Tested presence of -r, --repository |
Asserts confine operations to in output |
Verification Steps:
- Ran
python -m pytest tests/test_entrypoints.py -k test_main_help➡️ PASSED - Verified
mcp_server_git --helpoutput renders formatted lines cleanly. - Verified
test_main_without_repository_serves_noneandtest_python_dash_m_calls_main➡️ PASSED.
- Ngôn ngữ chính
- TypeScript
- Star
- 91.4k
- Fork
- 11.8k
- Merge trung bình
- 6 giờ 37 phút
- Pull request đã merge (30 ngày)
- 147
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của modelcontextprotocol/servers
-
Clear the four CodeQL alerts in the release scripts (replaceAll for %2F, comment-line check)Đang mởchore v2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
modelcontextprotocol/servers#5261 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
docs(git): clarify unconfined default scope and repository confinement options in README and CLIĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 74/100
modelcontextprotocol/servers#5230 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
git: README should state plainly that without --repository every reachable repository is in scopeĐang mởdocumentation server-git v2
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 84/100
modelcontextprotocol/servers#5225 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
chore v2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
modelcontextprotocol/servers#5223 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug v2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
modelcontextprotocol/servers#5217 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của modelcontextprotocol/servers
Issue tương tự
-
Manager flashes an empty "errorOccurred" dialog while redirecting a logged-out user to loginĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
openremote/openremote#3487 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
coollabsio/jean#867 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
ehmpathy/rhachet-roles-bhuild#616 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
📘 Docs supabase/cli
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug(cli): theme file home-directory check uses startsWith (sibling dirs pass, Windows casing fails)Đang mởarea/core kind/bug priority/p2 status/bot-triaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
google-gemini/gemini-cli#29955 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày