GitVisionMCP - Change Tracking - Release Documentation - Impact Assessment - Historical Analysis
1.7K
This guide explains how to use GitVisionMCP in a Docker container with VS Code as a Copilot Agent.
GitVisionMCP is a comprehensive Model Context Protocol (MCP) Server that provides advanced git analysis and documentation tools, including powerful commit, Excel, XML, YAML and JSON search capabilities. Designed to be used as a Copilot Agent in VS Code for comprehensive repository analysis and documentation generation.
docker pull mcprunner/gitvisionmcp:latest
Path format dependent on your OS. For Windows, use forward slashes or double backslashes in paths. GITHUB_TOKEN is optional.
Create a .vscode/mcp.json file in your workspace with the following content (adjust paths to match your system):
{
"servers": {
"GitVisionMCP-Docker": {
"type": "stdio",
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"--init",
"--stop-timeout",
"10",
"-e",
"GITVISION_MCP_TRANSPORT=Stdio",
"-e",
"GIT_APP_LOG_DIRECTORY=/app/logs",
"-v",
"/your/repository/path:/app/repo",
"-v",
"/your/repository/path/logs:/app/logs",
"mcprunner/gitvisionmcp:latest"
],
"env": {
"DOTNET_ENVIRONMENT": "Production",
"GITVISION_MCP_TRANSPORT": "Stdio",
"GIT_APP_LOG_DIRECTORY": "/app/logs",
"GITHUB_TOKEN": "ghp_example_token"
}
}
}
}
Volume Mounts:
-v C:/your/repository/path:/app/repo: Mount your git repository inside the container-v C:/your/repository/path/logs:/app/logs: Mount a logs directory for persistent logsEnvironment Variables:
DOTNET_ENVIRONMENT: Set to "Production" for optimized performanceGITVISION_MCP_TRANSPORT: Set to "Stdio" or "Http" for VS Code communication (defaults to Stdio)GIT_APP_LOG_DIRECTORY: Container path for logsGITHUB_TOKEN: Optional Github PAT, will default to git commands if unavailable.Path Format:
"c:\\Users\\username\\source\\repos\\project:/app/repo",/c/Users/username/source/repos/projectGITHUB_TOKEN: see Git authentication for GitVisionMCP
This project uses LibGit2Sharp for in-process git operations and falls back to the git CLI when necessary (for example when the native libgit2 build doesn't support SSH transports).
Recommended approaches:
Windows PowerShell (single session):
$env:GITHUB_TOKEN = "<your_token_here>"
# Run the server in the same shell so it inherits the variable
dotnet run --project .\GitVisionMCP.csproj
Or set an environment variable persistently (example for the current user):
setx GITHUB_TOKEN "<your_token_here>"
# New shells will see the variable
The server will use this token for HTTPS fetches and for the CLI fallback by passing an Authorization header to git.
If your remote uses SSH ([email protected]:owner/repo.git) the embedded libgit2 may not support SSH in your environment. In that case either:
git is available on PATH and you have SSH keys configured), orgit remote set-url origin https://github.com/<owner>/<repo>.git
git is installed and accessible on PATH for the fallback to work.Security note: treat tokens as secrets. Do not hard-code tokens in source or commit them to the repository.
After configuring the mcp.json file, restart VS Code to load the new MCP configuration. You can now use GitVisionMCP with Copilot by asking questions like:
GitVisionMCP in Docker provides 30+ tools for comprehensive git analysis and file operations:
gv_generate_git_commit_report - Generate commit report for current branchgv_generate_git_commit_report_to_file - Generate commit report and save to filegv_get_all_branches - List all branches (local and remote)gv_get_local_branches - List local branchesgv_get_remote_branches - List remote branchesgv_get_current_branch - Get current active branchgv_compare_branches_documentation - Compare differences between two branchesgv_compare_branches_with_remote_documentation - Compare branches with remote supportgv_fetch_from_remote - Fetch latest changes from remote repositorygv_get_recent_commits - Get recent commits from the current repositorygv_compare_commits_documentation - Generate documentation comparing differences between two commitsgv_get_changed_files_between_commits - Get list of files changed between two commitsgv_get_detailed_diff_between_commits - Get detailed diff content between two commitsgv_get_commit_diff_info - Get comprehensive diff information between two commitsgv_get_file_line_diff_between_commits - Get line-by-line file diff between two commitsgv_search_commits_for_string - Search all commits for a specific stringgv_list_workspace_files - List all files in the workspace with optional filteringgv_list_workspace_files_with_cached_data - List workspace files using pre-fetched file datagv_read_filtered_workspace_files - Read contents of all files from filtered workspace resultsgv_search_json_file - Search for JSON values using JSONPathgv_search_yaml_file - Search for YAML values using JSONPathgv_search_xml_file - Search for XML values using XPathgv_search_csv_file - Search for CSV values using JSONPathgv_search_excel_file - Search for values in Excel files using JSONPathgv_transform_xml_with_xslt - Transform XML file using XSLT stylesheetgv_deconstruct_to_file - Deconstruct C# file and return structure as JSONgv_deconstruct_to_json - Deconstruct C# file and save structure to JSON filegv_git_find_merge_conflicts - Search for Git merge conflicts in source codegv_get_app_version - Extract application version from project fileContainer fails to start
Cannot access repository
No logs generated
VS Code cannot connect
Performance issues
The Docker container approach is ideal for:
However, for large repositories, the local installation may offer better performance.
You can test the Docker container directly with a specific git command:
echo '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"gv_get_all_branches","arguments":{}}}' | docker run --rm -i --init -v C:/your/repository/path:/app/repo:ro mcprunner/gitvisionmcp:latest
Content type
Image
Digest
sha256:9b70b026c…
Size
119.9 MB
Last updated
11 months ago
docker pull mcprunner/gitvisionmcp