adhikasp/mcp-git-ingest

adhikasp/mcp-git-ingest

от adhikasp
MCP-сервер для чтения структуры GitHub-репозитория и ключевых файлов. Упрощает анализ кода: извлекает иерархию папок, важные файлы, помогает быстро разобраться в проекте. Полезен разработчикам и AI...

MCP Git Ingest

smithery badge

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"],
        }
    }
}

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?

Часто задаваемые вопросы

У этого сервера пока нет списка инструментов.

Выберите клиент, чтобы установить adhikasp/mcp-git-ingest:

Любой клиент

Конфиг добавления MCP сервера стандартный, обычно он не меняется вообще, поэтому подходит практически к любому ИИ клиенту, поддерживающему MCP.

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

Перейдите по ссылке и сервер автоматически будет добавлен в Cursor. Либо откройте/создайте файл ~/.cursor/mcp.json(%USERPROFILE%\.cursor\mcp.json на Windows) и добавьте конфиг сервера:

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

Создайте .vscode/mcp.json в проекте (ключ верхнего уровня — servers):

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

Либо добавьте сервер через терминал:

code --add-mcp "{\"name\":\"adhikasp-mcp-git-ingest-p0rwd7z0ok\",\"type\":\"stdio\",\"command\":\"uvx\",\"args\":[\"--from\",\"git+https://github.com/adhikasp/mcp-git-ingest\",\"mcp-git-ingest\"]}"
ClaudeClaude Desktop

Откройте Settings → Developer → Edit Config — это откроет файл claude_desktop_config.json:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Впишите сервер и полностью перезапустите Claude Desktop:

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

Добавьте сервер одной командой в терминале:

claude mcp add adhikasp-mcp-git-ingest-p0rwd7z0ok -- uvx --from git+https://github.com/adhikasp/mcp-git-ingest mcp-git-ingest

Либо через JSON-конфиг:

claude mcp add-json adhikasp-mcp-git-ingest-p0rwd7z0ok "{\"command\":\"uvx\",\"args\":[\"--from\",\"git+https://github.com/adhikasp/mcp-git-ingest\",\"mcp-git-ingest\"]}"
CodexCodex

Добавьте сервер командой в терминале:

codex mcp add adhikasp-mcp-git-ingest-p0rwd7z0ok -- uvx --from git+https://github.com/adhikasp/mcp-git-ingest mcp-git-ingest

Либо вручную в ~/.codex/config.toml(%USERPROFILE%\.codex\config.toml на Windows):

[mcp_servers.adhikasp-mcp-git-ingest-p0rwd7z0ok]
command = "uvx"
args = ["--from", "git+https://github.com/adhikasp/mcp-git-ingest", "mcp-git-ingest"]
PerplexityPerplexity

MCP доступен подписчикам Perplexity Pro / Max / Enterprise. Локальные серверы — только в приложении для macOS.

  1. Откройте Настройки аккаунта → Connectors.
  2. Установите вспомогательное приложение PerplexityXPC (один раз).
  3. Нажмите Add Connector → вкладка Simple.
  4. В поле Server Name укажите adhikasp/mcp-git-ingest, а в поле команды запуска — строку ниже:
uvx --from git+https://github.com/adhikasp/mcp-git-ingest mcp-git-ingest

Нажмите Save и дождитесь статуса Running.

WindsurfWindsurf

Откройте Windsurf Settings → Cascade → MCP Servers или отредактируйте файл ~/.codeium/windsurf/mcp_config.json:

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

В панели Cline нажмите иконку MCP Servers → Configure → Configure MCP Servers (или отредактируйте ~/.cline/mcp.json) и добавьте сервер:

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

Создайте файл в .continue/mcpServers/ (например adhikasp-mcp-git-ingest-p0rwd7z0ok.yaml) или добавьте блок в config.yaml. MCP работает только в режиме agent:

mcpServers:
  - name: adhikasp-mcp-git-ingest-p0rwd7z0ok
    command: uvx
    args:
      - "--from"
      - "git+https://github.com/adhikasp/mcp-git-ingest"
      - "mcp-git-ingest"
Zed

Выполните agent: add context server или откройте настройки (zed: open settings file) и добавьте сервер в объект context_servers:

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

Похожие MCP-сервера

idosal/git-mcp

idosal/git-mcp

от idosal

Читает документацию и код любого GitHub-репозитория: точные API-вызовы, свежие примеры, без выдумок. Облачный сервис, ноль настройки.

TypeScript⭐ 8471
ofershap/mcp-server-github-gist

ofershap/mcp-server-github-gist

от ofershap

MCP сервер для управления GitHub Gist прямо из AI-ассистента: создавайте, читайте, обновляйте, ищите и удаляйте Gist, не покидая чата. Работает с Claude Desktop, Cursor и VS Code Copilot. Полезен разработчикам, которые хотят быстро управлять сниппетами через ИИ.

TypeScript⭐ 2
muhannad-hash/git-context-mcp

muhannad-hash/git-context-mcp

от muhannad-hash

MCP-сервер, который по файлу и диапазону строк находит коммит, PR и связанные issues через git blame и GitHub API — всё прямо в Claude. Разработчикам: вместо ручного поиска получаете контекст кода ...

JavaScript⭐ 2
raohwork/forgejo-mcp

raohwork/forgejo-mcp

от raohwork

MCP-сервер для управления репозиториями Gitea/Forgejo через AI-ассистентов (Claude, Gemini). Обрабатывает issue, метки, вехи, релизы, PR, Wiki и Actions. Ускоряет работу команды, автоматизируя рути...

Go⭐ 70
Gitlab MCP

Gitlab MCP

от zereight

Управляет проектами GitLab: создаёт merge request'ы, отслеживает issues, следит за пайплайнами. Работает с self-hosted инстансами.

TypeScript⭐ 2053
ddukbg/github-enterprise-mcp

ddukbg/github-enterprise-mcp

от ddukbg

Управляет репозиториями, issues и PR в GitHub Enterprise: создаёт, обновляет, удаляет, запускает Actions, управляет ветками и пользователями.

TypeScript⭐ 29
© Каталог MCP, 2026. Все права защищены.
Проект не аффилирован с Anthropic и любыми упомянутыми продуктами.
Все названия и торговые марки принадлежат их владельцам.
Контакты для связи: hi@mcp-katalog.ru

Лука Никитин