# adhikasp/mcp-git-ingest [Health: Active]

**Category:** 🔄 Version Control  
**Repository:** https://github.com/adhikasp/mcp-git-ingest  
**GitHub Stars:** 315  
**Views:** 5  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/adhikasp-mcp-git-ingest

## Description
Read and analyze GitHub repositories with your LLM

## Tools
Capabilities this server exposes over MCP:

- **git_directory_structure** — Clone a Git repository and return its directory structure in a tree format.
- **git_read_important_files** — Read the contents of specified files in a given git repository.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

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

## Documentation

## What adhikasp/mcp-git-ingest does

adhikasp/mcp-git-ingest lets MCP clients explore Git repositories through an agent. It is designed around two operations:

- `github_directory_structure` returns a tree-like view of a repository while excluding the `.git` directory.
- `github_read_important_files` accepts a repository URL and a list of file paths, then returns the contents of those files.

The tools are useful for questions that require both orientation and source inspection. An agent can first request the directory layout, identify relevant files, and then retrieve only those files for analysis. The repository is cloned for each operation and removed after processing.

Although the example usage targets GitHub URLs, the server accepts HTTPS, SSH, and scp-style repository URLs. Host restrictions can be added when deployments should limit which Git hosts may be accessed.

## How it works

The server uses FastMCP to expose its operations through MCP and GitPython for repository cloning and Git operations. A repository URL is converted into a deterministic temporary directory name, allowing the implementation to recognize an existing clone before cloning again. Directory traversal produces a sorted visual tree using Unicode box-drawing characters.

File reads return a mapping between each requested path and its contents. Clone, traversal, and file-reading failures are handled with error messages, while cleanup runs after processing so temporary repositories do not accumulate.

The directory operation does not follow symbolic links while building the tree. File reads resolve symbolic links and verify that the resulting path remains inside the cloned repository. Absolute paths, parent-directory segments, `.git` access, and links that escape the repository are rejected. Individual files are limited to 512 KiB by default.

## Setup and configuration

A stdio MCP client can launch the server with `uvx`:

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

The executable entry point is `mcp-git-ingest`. The implementation uses Python 3.8 or newer and depends on FastMCP and GitPython through the project configuration.

Two environment variables adjust safeguards and access policy:

- `MCP_GIT_INGEST_MAX_FILE_BYTES` changes the per-file read limit.
- `MCP_GIT_INGEST_ALLOWED_HOSTS` restricts repository hosts, such as `github.com,gitlab.com`.

Repository URLs must use `https://`, `ssh://`, or scp-style syntax such as `user@host:path`. Local paths and `file://` or `ext::` URLs are refused. Because cloned URLs may contain credentials, `.git` is kept inaccessible to file reads.

## Tools and capabilities

`github_directory_structure` clones a repository and returns its nested file and directory layout. It skips `.git` and avoids descending into symbolic links.

`github_read_important_files` reads caller-selected files from a cloned repository and returns their contents in a path-to-content mapping. The path checks prevent access outside the clone, and the size limit helps constrain individual responses.

Together, these tools support a two-step workflow: discover the project structure, then retrieve implementation files, configuration, or documentation relevant to a specific question.

## Limitations and notes

The server operates on cloned repositories rather than a live working tree. File reads are caller-directed, so the client or agent must identify the paths it wants after inspecting the structure. Large individual files are capped unless the size limit is changed through configuration. Access control can be narrowed by setting an allowed-host list, but the supported repository URL forms remain limited to HTTPS, SSH, and scp-style Git URLs.

_Full upstream README: https://allmcps.com/mcp/adhikasp-mcp-git-ingest/readme_

