MCP-Repo2LLM

by crisschan
Apache 2.0
1

Integrations

  • Extracts and transforms code from GitHub repositories into LLM-friendly formats, preserving structure and context while requiring a GitHub token for authentication.

  • Processes GitLab repositories and converts them into text formats optimized for LLMs, maintaining code structure and relationships while requiring a GitLab token.

  • Processes local code repositories and transforms them into LLM-friendly text formats, preserving project structure and contextual information.

MCP-Repo2LLM

Overview

mcp-repo2llm is a MCP server that transforms code repositories into LLM-friendly formats. A powerful tool that transforms code repositories into LLM-friendly formats, bridging the gap between traditional code bases and modern AI language models. This repo is based on RepoToTextForLLMs, which provides core functionality for converting repositories into LLM-readable formats.

Motivation

As AI and Large Language Models (LLMs) become increasingly important in software development, there's a growing need to effectively communicate our codebases to these models. Traditional code repositories aren't optimized for LLM processing, which can lead to suboptimal results when using AI tools for code analysis and generation.

Problem Solved

This project addresses several critical challenges:

  • Difficulty in processing large codebases with LLMs
  • Loss of context and structure when feeding code to AI models
  • Inefficient handling of repository metadata and documentation
  • Inconsistent formatting across different programming languages

Key Features

  • Smart Repository Scanning: Intelligently processes entire codebases while maintaining structural integrity
  • Context Preservation: Maintains important contextual information and relationships between code files
  • Multi-language Support: Handles various programming languages with language-specific optimizations
  • Metadata Enhancement: Enriches code with relevant metadata for better LLM understanding
  • Efficient Processing: Optimized for handling large repositories with minimal resource usage

Installation

To install mcp-repo2llm by uv:

"mcp-repo2llm-server": { "command": "uv", "args": [ "run", "--with", "mcp[cli]", "--with-editable", "/mcp-repo2llm", "mcp", "run", "/mcp-repo2llm/mcp-repo2llm-server.py" ], "env":{ "GITHUB_TOKEN":"your-github-token", "GITLAB_TOKEN":"your-gitlab-token" } }

GITHUB_TOKEN: your github token GITLAB_TOKEN: your gitlab token

Tools

get_gitlab_repo

  • Process and return the code from a GitLab repository branch as text
  • Input:
    • repo_url (string): the repository URL from gitlab
    • branch (string): The branch name,default is master
  • Returns(string): The project all information and struction from the repository as text

get_github_repo

  • Process and return the code from a Github repository branch as text
  • Input:
    • repo_url (string): the repository URL from github
    • branch (string): The branch name,default is master
  • Returns(string): The project all information and struction from the repository as text

get_local_repo

  • Process and return the code from a GitLab repository branch as text
  • Input:
    • repo_url (string): the repository path
  • Returns(string): The project all information and struction from the repository as text
-
security - not tested
A
license - permissive license
-
quality - not tested

A MCP server that transforms code repositories from GitHub, GitLab, or local directories into LLM-friendly formats, preserving context and structure for better AI processing.

  1. Overview
    1. Motivation
      1. Problem Solved
        1. Key Features
          1. Installation
            1. Tools
              1. get_gitlab_repo
              2. get_github_repo
              3. get_local_repo

            Related MCP Servers

            • -
              security
              A
              license
              -
              quality
              Repomix MCP Server enables AI models to efficiently analyze codebases by packaging local or remote repositories into optimized single files, with intelligent compression via Tree-sitter to significantly reduce token usage while preserving code structure and essential signatures.
              Last updated -
              10,685
              15,483
              TypeScript
              MIT License
              • Linux
              • Apple
            • -
              security
              F
              license
              -
              quality
              An MCP server that enables Claude and other compatible LLMs to interact with the GitHub API, supporting features like creating issues, retrieving repository information, listing issues, and searching repositories.
              Last updated -
              TypeScript
            • -
              security
              -
              license
              -
              quality
              An MCP server that automatically generates documentation, test plans, and code reviews for code repositories by analyzing directory structures and code files using AI models via OpenRouter API.
              Last updated -
              3
              TypeScript
              Creative Commons Zero v1.0 Universal
            • -
              security
              -
              license
              -
              quality
              An MCP server that allows Claude and other MCP-compatible LLMs to interact with the GitHub API, supporting features like creating issues, getting repository information, listing issues, and searching repositories.
              Last updated -
              TypeScript

            View all related MCP servers

            ID: vrr1h8913r