Returns a tree-like representation of a GitHub repository's directory structure
Reads and returns the contents of specified files in a GitHub repository
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.
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.
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:
git clone https://github.com/adhikasp/mcp-git-ingest.git
docker build -t mcp-git-ingest .
docker run -p 8000:8000 mcp-git-ingest
Once installed, you can use the Git Repository Ingest tools to analyze GitHub repositories. The server provides two main functionalities:
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.