Skip to main content
Glama

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.

Related MCP server: SRC (Structured Repo Context)

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

Available Tools

3 tools
get_github_repoC

Process and return the code from a GitHub repository branch as text

Inputs: repo_url (required), branch.

get_gitlab_repoC

Process and return the code from a GitLab repository branch as text

Inputs: repo_url (required), branch.

get_local_repoC

Process and return the code from a local repository as text

Inputs: repo_path (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.9/5.0

    Scored across 3 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose targeting a different repository source: GitHub, GitLab, and local repositories. The descriptions explicitly differentiate them by source, leaving no ambiguity about which tool to use for each scenario.

    Naming Consistency5/5

    All tools follow a consistent verb_noun pattern with 'get_' prefix and descriptive suffixes indicating the repository source. The naming is uniform and predictable across all three tools.

    Tool Count2/5

    With only 3 tools, the server feels thin for its apparent scope of repository code retrieval. While it covers three repository sources, the functionality is limited to a single 'get' operation without supporting related actions like searching, filtering, or managing repositories.

    Completeness2/5

    The tool surface is severely incomplete for repository interaction. It only provides retrieval operations without any create, update, delete, search, or management capabilities. Even within retrieval, there are no options for filtering, pagination, or handling different file types beyond returning 'code as text'.

    Related MCP Connectors

    Related MCP Servers