docs(git): clarify unconfined default scope and repository confinement options in README and CLI
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 1/5
- Tempo stimato
- Meno di un'ora
- Idoneità per principianti
- 74/100
- Tipo di issue
- Documentazione
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- git, python
- Ambito
- documentation, security
Direzione di ricerca
Leggi la sezione Configuration di src/git/README.md e l’opzione --repository in src/git/src/mcp_server_git/__init__.py; l’issue menziona anche src/git/src/mcp_server_git/server.py e src/git/tests/test_entrypoints.py. Verifica in che modo allowed_repository=None influisce sull’accesso al repository, quindi aggiorna l’avviso, la guida della CLI, il docstring e l’asserzione sulla guida descritti nell’issue. Il lavoro è completato quando questi elementi spiegano l’accesso non vincolato predefinito e il test mirato della guida passa.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- TypeScript
- Stelle
- 91.4k
- Fork
- 11.8k
- Merge medio
- 6h 39m
- PR unite (30g)
- 146
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di modelcontextprotocol/servers
-
chore v2
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
modelcontextprotocol/servers#5261 ·
I maintainer di solito rispondono entro 1 giorno
-
docs(git): clarify unconfined default scope and repository confinement options in README and CLIAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
modelcontextprotocol/servers#5231 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
git: README should state plainly that without --repository every reachable repository is in scopeApertadocumentation server-git v2
Difficoltà 1/5 1-3 ore Idoneità per principianti 84/100
modelcontextprotocol/servers#5225 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
chore v2
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
modelcontextprotocol/servers#5223 ·
I maintainer di solito rispondono entro 1 giorno
-
bug v2
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
modelcontextprotocol/servers#5217 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di modelcontextprotocol/servers
Issue simili
-
VS Code extension: clickable file links in chat drop the :line suffix, never jump to the lineAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
MoonshotAI/kimi-code#4398 ·
I maintainer di solito rispondono entro 1 giorno
-
Xiaomi Mimo语音识别服务异常Apertapending triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
package-lock.json : les binaires natifs macOS et Linux de unrs-resolver ont disparu depuis #1823Apertabug dependencies
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
AxaFrance/design-system#2064 ·
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100