Skip to main content

MCP 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:

  1. Explore Git repositories without needing to manually download and upload files
  2. Access the full contents of repositories, with automatic token counting
  3. Navigate through repository structure and file contents
  4. Quickly assess repository size before deciding whether to retrieve full content

When to use which tool

  • Use estimate_codebase when 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_codebase when 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 contents
  • estimate_codebase(repo_url: str, use_token: bool = True) -> str: Quick analysis providing repository statistics including file count, structure, and token estimation
  • check_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

Metadata

Release files for mcp-git-explorer 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mcp-git-explorer 0.3.0
File Size Uploaded Provenance
mcp_git_explorer-0.3.0.tar.gz 81.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for mcp-git-explorer 0.3.0
File Interpreter ABI Platform
mcp_git_explorer-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 90.2 kB

Release files / mcp_git_explorer-0.3.0.tar.gz

Download URL mcp_git_explorer-0.3.0.tar.gz
Size 81.0 kB
Tags Source
SHA-256 checksum
How to use checksums
b77b31001e29ac036be9e08371f206b17bbd76499613b7cf750327cea76893d4
BLAKE2b-256 checksum
How to use checksums
f962085582c7f90d0a1b1f5bbfc21a14867b81e6432e719e935ed5ca872abbf0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / mcp_git_explorer-0.3.0-py3-none-any.whl

Download URL mcp_git_explorer-0.3.0-py3-none-any.whl
Size 9.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
17305863bbe411ffdc42d249715ac881c76acb4d79433c9712c8c61f3ab1f842
BLAKE2b-256 checksum
How to use checksums
25df398f7ac3e17e64ce09726667160eb7e02561c097b109cceb5e11b1cba2bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Security for mcp-git-explorer 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page