adhikasp/mcp-git-ingest logo

adhikasp/mcp-git-ingest

Free

使用 LLM 读取和分析 GitHub 仓库。

FreeFree tier
Type
Open Source

About adhikasp/mcp-git-ingest

MCP Git Ingest is a Model Context Protocol (MCP) server that provides structured access to GitHub repositories. It enables LLMs and MCP clients to read repository directory structures and retrieve the contents of important files. The tool automatically clones repositories into deterministic temporary directories, handles cleanup, and uses fastmcp for easy MCP integration. Inspired by gitingest, it is implemented in Python with gitpython for Git operations.

Key Features

Provides two MCP tools: github_directory_structure and github_read_important_files
Automatically clones GitHub repositories into deterministic temporary directories
Generates a tree-like directory structure using Unicode box-drawing characters
Reads and returns contents of specified files in a repository
Handles cleanup of temporary files using finally blocks
Uses fastmcp for easy MCP server creation and gitpython for Git operations
Supports passing a list of file paths to read multiple files at once

Pros & Cons

Pros
  • Open source and free to use
  • Integrates seamlessly with MCP-compatible clients and LLMs
  • Automatically handles repository cloning and cleanup, reducing manual steps
  • Uses deterministic temp directories, potentially caching cloned repos
  • Simple configuration with uvx for quick setup
Cons
  • Requires network access to clone repositories
  • Only reads repository structure and files; no write or search capabilities
  • May fail if repository URL is invalid or repository is private without proper credentials

Best For

Analyzing code architecture by examining repository directory structureReading key source files to understand how a project is implementedProviding context about a GitHub repository to an LLM for code analysisAutomating repository exploration in AI-powered development workflows

FAQ

What tools does mcp-git-ingest provide?
It provides two tools: github_directory_structure (returns a tree-like representation of a repository's directory structure) and github_read_important_files (reads and returns the contents of specified files in a repository).
How does mcp-git-ingest work?
The server clones the given GitHub repository into a deterministic temporary directory (hashed from the URL), then either generates a directory tree or reads specified files. After processing, it cleans up the temporary repository.
What dependencies does mcp-git-ingest use?
It uses fastmcp for creating an MCP server, gitpython for Git repository operations, and requires Python 3.8+.
How do I configure mcp-git-ingest with an MCP client?
Add the following to your MCP client configuration: {"mcpServers": {"mcp-git-ingest": {"command": "uvx", "args": ["--from", "git+https://github.com/adhikasp/mcp-git-ingest", "mcp-git-ingest"]}}}