Git Ingest

Developer tools

A Model Context Protocol (MCP) server that helps read GitHub repository structure and important files.

Your AI app calls the Git Ingest MCP server, which does the developer tools work and sends the result back to the chat.

About Git Ingest

Git Ingest is a community MCP server from adhikasp, filed in our directory under developer tools. A Model Context Protocol (MCP) server that helps read GitHub repository structure and important files.

At a glance

Publisher
adhikasp (community)
Runs
See the README for setup
Written in
Python
License
MIT
GitHub stars
315

How to set up Git Ingest

  1. Follow the install steps in the Git Ingest README; it is written in Python, so have that toolchain ready.
  2. Check the Git Ingest README for keys or settings; the registry lists none that Git Ingest requires.
  3. Add Git Ingest to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the Git Ingest tools to confirm the connection.
  5. Run one read-only task with Git Ingest first, and keep your app asking before each tool call until the results look right.

Git Ingest compared with similar servers

  • OrchestKit Docs by yonatangross has fewer GitHub stars than Git Ingest (313 against 315); both are community servers, and OrchestKit Docs runs as a remote server and Git Ingest runs on your own machine.
  • Ucsandman by ucsandman has more GitHub stars than Git Ingest (318 against 315); both are community servers, and both run locally.
  • Flare by AlgoNoRhythm has fewer GitHub stars than Git Ingest (312 against 315); both are community servers, and both run locally.

Before you connect Git Ingest

  • Give Git Ingest its own API key or account with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each Git Ingest tool call until you trust what it does with them.
  • Treat text that Git Ingest fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for Git Ingest on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for Git Ingest

How marketing and sales teams put Git Ingest to work, by company size. Pick the size closest to yours and start Git Ingest on one use case.

Small business

  • A small business with a developer can use Git Ingest to ship site and tracking fixes faster, with the AI reading the code it changes.
  • Technical founders can ask Git Ingest to explain and fix a marketing site issue without context switching between tools.
  • Git Ingest runs on your own computer, which keeps data local; it needs a little setup, so a small team should plan an hour for it.

Mid-market

  • Growth engineers can use Git Ingest to build landing pages, tracking and integrations in fewer cycles, with reviews kept in the normal flow.
  • Marketing ops engineers can connect Git Ingest to keep scripts and automations documented and versioned as they change.
  • Start Git Ingest on one workflow with one owner, measure the time it saves, then roll it out to the wider team.

Enterprise

  • Enterprise engineering teams can roll out Git Ingest with repo scopes and audit logs, so agents work only where they are allowed.
  • Platform teams can standardize on Git Ingest so web and marketing engineering share one reviewed way of working with AI.
  • Git Ingest is a community server, so have security review the code and pin a version before Git Ingest touches company data.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

Git Ingest README

From adhikasp/mcp-git-ingest on GitHub, shared under its MIT license. Images are left out; the original has them.

README.md

MCP Git Ingest

A Model Context Protocol (MCP) server that helps read GitHub repository structure and important files.

Inspired by gitingest.

Configuration

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

Security

git_read_important_files only reads files inside the clone it just made:

  • absolute paths and .. segments are rejected;
  • the path is resolved with symlinks followed (realpath), and must stay inside the repository, so a symlinked README.md -> ~/.ssh/id_ed25519 in a cloned repo is refused too;
  • .git/ is off limits (the clone URL can carry credentials);
  • a single file is capped at 512 KiB (MCP_GIT_INGEST_MAX_FILE_BYTES overrides);
  • repo_url must be https://, ssh:// or scp-style user@host:path, file://, ext:: and bare local paths are refused; set MCP_GIT_INGEST_ALLOWED_HOSTS=github.com,gitlab.com to restrict hosts.

git_directory_structure never descends into symlinks (a repo could point one at /).

Fixed in 0.1.1; thanks to Li-c-hui for the report (issue #19).

Usage

Using mcp-client-cli:

$ llm read https://github.com/adhikasp/mcp-git-ingest and determine how the code technically works

I'll help you understand the technical details of the mcp-git-ingest repository. I'll first fetch the directory structure and then read the important files to analyze how the code works.

Tool Calls:
  github_directory_structure
  Args:
    repo_url: https://github.com/adhikasp/mcp-git-ingest

Now, I'll read the important files to understand the technical implementation:

Tool Calls:
  github_read_important_files
  Args:
    repo_url: https://github.com/adhikasp/mcp-git-ingest
    file_paths: ['README.md', 'src/mcp_git_ingest/main.py', 'pyproject.toml']

Let me break down how this code technically works:

1. Purpose:
The `mcp-git-ingest` is a Model Context Protocol (MCP) server designed to help read GitHub repository structures and important files. It provides two main tools:
- `github_directory_structure`: Returns a tree-like representation of a repository's directory structure
- `github_read_important_files`: Reads and returns the contents of specified files in a repository

2. Technical Implementation:

a. Dependencies:
- Uses `fastmcp` for creating an MCP server
- Uses `gitpython` for Git repository operations
- Requires Python 3.8+

b. Key Functions:

`clone_repo(repo_url: str) -> str`:
- Creates a deterministic temporary directory based on the repository URL's hash
- Checks if the repository is already cloned
- If not, clones the repository
- Handles error cases and cleanup
- Returns the path to the cloned repository

`get_directory_tree(path: str, prefix: str = "") -> str`:
- Recursively generates a tree-like directory structure
- Skips `.git` directories
- Uses Unicode box-drawing characters to create a visual tree representation
- Handles sorting of entries

`github_directory_structure(repo_url: str) -> str`:
- Clones the repository
- Generates directory tree
- Cleans up the temporary repository after processing
- Returns the tree structure or an error message

`github_read_important_files(repo_url: str, file_paths: List[str]) -> dict[str, str]`:
- Clones the repository
- Reads specified files
- Returns a dictionary mapping file paths to their contents
- Handles file reading errors
- Cleans up the temporary repository

3. Error Handling:
- Uses try-except blocks to handle repository cloning, file reading errors
- Ensures temporary directories are always cleaned up using `finally` blocks
- Returns descriptive error messages

4. Performance Optimizations:
- Uses a hash-based temporary directory naming to potentially reuse cloned repositories
- Checks for existing repositories before cloning
- Implements cleanup to prevent accumulation of temporary files

5. Unique Features:
- Deterministic temporary directory creation
- Unicode tree representation
- Flexible file reading with error handling

6. Execution:
- Can be run as a CLI tool via `mcp-git-ingest`
- Configured through `pyproject.toml`
- Depends on `fastmcp` for MCP server functionality

The code is a robust, flexible tool for programmatically exploring and reading GitHub repositories, with a focus on error handling and clean implementation.

Would you like me to elaborate on any specific aspect of the implementation?

Questions about Git Ingest

What is the Git Ingest MCP server?

A Model Context Protocol (MCP) server that helps read GitHub repository structure and important files. Git Ingest is maintained by adhikasp on GitHub at adhikasp/mcp-git-ingest, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I install the Git Ingest MCP server?

Git Ingest doesn't publish a one-line install in the MCP registry, so follow the setup steps in its README on GitHub (adhikasp/mcp-git-ingest). Like most servers, Git Ingest ends with a command or URL you paste into your AI app's MCP config.

Does Git Ingest need an API key?

The registry lists no required keys for Git Ingest. Check the Git Ingest README for optional settings, and expect a remote server to ask you to sign in the first time you connect.

Is Git Ingest an official MCP server?

No. Git Ingest is a community server maintained by adhikasp. Community servers can be excellent; read the code and the open issues before you give Git Ingest access to company data.

What license is Git Ingest under?

Git Ingest is released under the MIT license, according to its GitHub repository. The license covers the code of Git Ingest; the service it connects to has its own terms.