Back to MCP Catalog

Git Repository Ingest MCP Server

Version ControlPython
Analyze GitHub repository structure and read important files
Available Tools

github_directory_structure

Returns a tree-like representation of a GitHub repository's directory structure

repo_url

github_read_important_files

Reads and returns the contents of specified files in a GitHub repository

repo_urlfile_paths

Git Repository Ingest is a Model Context Protocol server that helps AI assistants analyze GitHub repositories by providing access to their directory structure and file contents. Inspired by gitingest.com, it enables AI models to understand code repositories more effectively. This tool simplifies the process of exploring GitHub repositories programmatically, allowing AI assistants to navigate directory structures and read specific files without requiring direct GitHub API access. With robust error handling and efficient repository management, it's an essential tool for code analysis and understanding.

Overview

Git Repository Ingest is a Model Context Protocol (MCP) server that helps AI assistants analyze GitHub repositories by providing access to their directory structure and file contents. This tool is particularly useful for understanding codebases, exploring project structures, and analyzing specific files within repositories.

Installation

You can install Git Repository Ingest using the uvx package manager. Add the following configuration to your MCP client:

{
    "mcpServers": {
        "mcp-git-ingest": {
            "command": "uvx",
            "args": ["--from", "git+https://github.com/adhikasp/mcp-git-ingest", "mcp-git-ingest"]
        }
    }
}

Alternatively, you can use Docker to run the server:

  1. Clone the repository: git clone https://github.com/adhikasp/mcp-git-ingest.git
  2. Build the Docker image: docker build -t mcp-git-ingest .
  3. Run the container: docker run -p 8000:8000 mcp-git-ingest

Usage

Once installed, you can use the Git Repository Ingest tools to analyze GitHub repositories. The server provides two main functionalities:

  1. Exploring repository structure: Get a tree-like representation of a repository's directory structure.
  2. Reading file contents: Retrieve the contents of specific files within a repository.

Example usage with an MCP client:

# Get the directory structure of a repository
github_directory_structure(repo_url="https://github.com/username/repository")

# Read specific files from a repository
github_read_important_files(
    repo_url="https://github.com/username/repository",
    file_paths=["README.md", "src/main.py", "pyproject.toml"]
)

The server handles repository cloning, file reading, and cleanup automatically, making it easy to work with GitHub repositories programmatically.

Features

  • Deterministic temporary directory creation: Creates consistent temporary directories based on repository URL hashes
  • Efficient repository management: Checks for existing clones before downloading
  • Robust error handling: Provides clear error messages for failed operations
  • Automatic cleanup: Removes temporary files after processing
  • Unicode tree representation: Generates visually appealing directory structures

Requirements

  • Python 3.8 or higher
  • Git installed on the system
  • Internet connection to clone repositories

Related MCPs

GitHub API
Version ControlTypeScript

Interact with GitHub repositories, issues, pull requests, and more through the GitHub API

GitLab
Version ControlTypeScript

Interact with GitLab repositories, issues, and merge requests

Gitee
Version ControlOther

A Chinese alternative to GitHub for code hosting and collaboration

About Model Context Protocol

Model Context Protocol (MCP) allows AI models to access external tools and services, extending their capabilities beyond their training data.

Generate Cursor Documentation

Save time on coding by generating custom documentation and prompts for Cursor IDE.