You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which would imply you are limiting the mcp server to that repository but in practice the only thing --repository is used for is this (link]:
ifrepositoryisnotNone:
try:
git.Repo(repository)
logger.info(f"Using repository at {repository}")
exceptgit.InvalidGitRepositoryError:
logger.error(f"{repository} is not a valid Git repository")
return
After that codeblock it doesn't seem to be used. All the commands take a "repo_path" which can be anywhere on your machine. Coupled with "git_init" you can effectively read any file on the computer as long as you have the permissions to init a git repo.
If this is expected behavior then maybe it would be nice to add something to the docs about it.
joshstrange
changed the title
Running mcp-server-git with uvx give full disk access/--repository param is ignored
Running mcp-server-git with uvx gives full disk access/--repository param is ignored
Feb 7, 2025
I am not sure if this is related, but when running on a mac in uvx the repository passed in on the command line doesn't propagate through to the repo_path and it seems like it should by default?
Describe the bug
mcp-server-git
does not restrict repo paths to the repo specified.The docs have this code block:
Which would imply you are limiting the mcp server to that repository but in practice the only thing
--repository
is used for is this (link]:After that codeblock it doesn't seem to be used. All the commands take a "repo_path" which can be anywhere on your machine. Coupled with "git_init" you can effectively read any file on the computer as long as you have the permissions to init a git repo.
If this is expected behavior then maybe it would be nice to add something to the docs about it.
To Reproduce
Steps to reproduce the behavior:
mkdir reproduce-repo
cd reproduce-repo
git init
npx @modelcontextprotocol/inspector uvx mcp-server-git --repository "path/to/your/repo"
git_status
tool and enter a path different from what you passed in to the--repository
flagExpected behavior
One or more of the following:
or
Ideally you'd supply a base path (or paths) and it would be able to read/write to any repos in that path to allow for features like #188 (on purpose).
Logs
N/A
Additional context
N/A
The text was updated successfully, but these errors were encountered: