About MCP Git Explorer
MCP Git Explorer is an MCP server that retrieves remote Git repository contents as structured text for code analysis. It serves users who need to inspect repository content or estimate its size and token count before retrieving all files.
Key features
- 01Retrieve repository file contents as structured text
- 02Estimate repository size and token count
- 03Respect .gitignore and .repomixignore patterns
- 04Skip binary and empty text files
- 05Access private GitLab repositories with a token
Use cases
- 01Inspect a remote repository without manual downloads
- 02Check a codebase's size before retrieving its contents
- 03Analyze repository files with an MCP client
MCP support
It exposes tools to retrieve repository contents, estimate codebase statistics, and check GitLab token status to MCP clients. The README notes integration with Claude's Model Context Protocol.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMEMCP Git Explorer
Simple MCP (Model Context Protocol) server for fetching the remote git repository content as a structured text file.
Features
- Clone and analyze Git repositories
- Generate a structured text representation of repository contents
- Quickly estimate codebase size and token count without retrieving all content
- Support for public repositories and private GitLab repositories with token authentication
- Tokenization counting using OpenAI's tiktoken library
- Respect for .gitignore and .repomixignore patterns
- Skip binary files and empty text files
- Integration with Claude's Model Context Protocol
Installation
From PyPI
pip install mcp-git-explorer
Using uv
uv pip install mcp-git-explorer
Direct execution with uvx (without installation)
uvx mcp-git-explorer
Usage
As a command-line tool
# Basic usage
mcp-git-explorer
# Using SSE transport
mcp-git-explorer --transport sse
# Providing GitLab token
mcp-git-explorer --gitlab-token YOUR_TOKEN
Environment Variables
GIT_EXPLORER_GITLAB_TOKEN: Your GitLab personal access token for accessing private repositories
In Claude
MCP Git Explorer provides Claude with the ability to:
- Explore Git repositories without needing to manually download and upload files
- Access the full contents of repositories, with automatic token counting
- Navigate through repository structure and file contents
- Quickly assess repository size before deciding whether to retrieve full content
When to use which tool
- Use
estimate_codebasewhen you want to quickly check the size and structure of a repository before analyzing its contents. This is especially useful for large repositories where you need to check if retrieving the full content is feasible within token limits. - Use
get_codebasewhen you need to analyze the actual code and content of the files in the repository.
Available Tools
get_codebase(repo_url: str, use_token: bool = True) -> str: Clone and analyze a Git repository, returning full file contentsestimate_codebase(repo_url: str, use_token: bool = True) -> str: Quick analysis providing repository statistics including file count, structure, and token estimationcheck_gitlab_token_status() -> str: Check if a GitLab token is configured
Development
Setup
# Clone the repository
git clone https://github.com/jmiedzinski/mcp-git-explorer.git
cd mcp-git-explorer
# Install development dependencies
uv pip install -e ".[dev]"
Running locally
# Run directly
python -m mcp_git_explorer.cli
# Run via MCP CLI
mcp dev mcp_git_explorer/cli.py
# Run via uvx
uvx mcp-git-explorer
License
MIT
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.