Simple MCP server for fetching the remote git repository content as a structured text file
Project description
MCP Git Explorer
A tool for exploring Git repositories through Claude using the Model Context Protocol (MCP).
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
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mcp_git_explorer-0.2.0.tar.gz
(35.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_git_explorer-0.2.0.tar.gz.
File metadata
- Download URL: mcp_git_explorer-0.2.0.tar.gz
- Upload date:
- Size: 35.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
306a88ff74a27ee8658f364cd441531b9379bde8b116889bf5425954e577f68c
|
|
| MD5 |
0524ecf86e5ff4b8f38fe67f5c8bad16
|
|
| BLAKE2b-256 |
25fc60723f8640549e3902bcbc54743f22c806c804f8809fe3aa16f1dc0c972f
|
File details
Details for the file mcp_git_explorer-0.2.0-py3-none-any.whl.
File metadata
- Download URL: mcp_git_explorer-0.2.0-py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d87b17cc1b3b2d0c7980df79e7cd78071172a4eb7bfb8aa6022f74a8dfba003e
|
|
| MD5 |
90831e771cf318bd246a5cac12753e6c
|
|
| BLAKE2b-256 |
b87fdfafded2a30a0e79b0b8f15c7a7a7cd7a7909f66437faf3b5df95d3620d8
|