Skip to main content
Glama

MCP-Repo2LLM

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

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

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
              An MCP server that enables communication with GitLab repositories, allowing interaction with GitLab's API to manage projects, issues, and repositories through natural language.
              Last updated -
              5,164
              1
              JavaScript
              MIT License
            • -
              security
              A
              license
              -
              quality
              An MCP server that enables clients to extract LLM-friendly prompts from documentation in GitHub repositories or hosted websites.
              Last updated -
              Python
              Apache 2.0
            • A
              security
              F
              license
              A
              quality
              An MCP server that implements a structured workflow for LLM-based coding, guiding development through feature clarification, documentation generation, phased implementation, and progress tracking.
              Last updated -
              10
              14
              TypeScript
              • Apple
            • -
              security
              F
              license
              -
              quality
              A customized MCP server that enables integration between LLM applications and documentation sources, providing AI-assisted access to LangGraph and Model Context Protocol documentation.
              Last updated -
              1
              Python
              • Linux
              • Apple

            View all related MCP servers

            MCP directory API

            We provide all the information about MCP servers via our MCP API.

            curl -X GET 'https://glama.ai/api/mcp/v1/servers/crisschan/mcp-repo2llm'

            If you have feedback or need assistance with the MCP directory API, please join our Discord server