Skip to main content
Glama

MCP-Repo2LLM

MCP-Repo2LLM

概述

mcp-repo2llm 是一个 MCP 服务器,可将代码库转换为 LLM 友好格式。它是一款强大的工具,可将代码库转换为 LLM 友好格式,从而弥合传统代码库与现代 AI 语言模型之间的差距。此代码库基于RepoToTextForLLMs ,后者提供将代码库转换为 LLM 可读格式的核心功能。

动机

随着人工智能和大型语言模型 (LLM) 在软件开发中的重要性日益提升,我们越来越需要有效地将代码库与这些模型进行通信。传统的代码库并未针对 LLM 处理进行优化,这在使用人工智能工具进行代码分析和生成时可能会导致结果不佳。

问题解决了

该项目解决了几个关键挑战:

  • 使用 LLM 处理大型代码库有困难
  • 向 AI 模型输入代码时丢失上下文和结构
  • 存储库元数据和文档处理效率低下
  • 不同编程语言的格式不一致

主要特点

  • 智能存储库扫描:智能处理整个代码库,同时保持结构完整性
  • 上下文保存:维护代码文件之间的重要上下文信息和关系
  • 多语言支持:通过特定语言的优化处理各种编程语言
  • 元数据增强:使用相关元数据丰富代码,以便更好地理解 LLM
  • 高效处理:针对处理大型存储库进行了优化,以最少的资源使用率

安装

要通过 uv 安装 mcp-repo2llm:

"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:你的 github 令牌 GITLAB_TOKEN:你的 gitlab 令牌

工具

获取gitlab仓库

  • 处理并从 GitLab 存储库分支返回代码作为文本
  • 输入:
    • repo_url (字符串):来自 gitlab 的存储库 URL
    • branch(字符串):分支名称,默认为master
  • 返回(字符串):项目存储库中的所有信息和说明作为文本

获取 github 仓库

  • 处理并从 Github 存储库分支返回代码作为文本
  • 输入:
    • repo_url (字符串):来自 github 的存储库 URL
    • branch(字符串):分支名称,默认为master
  • 返回(字符串):项目存储库中的所有信息和说明作为文本

获取本地仓库

  • 处理并从 GitLab 存储库分支返回代码作为文本
  • 输入:
    • repo_url(字符串):存储库路径
  • 返回(字符串):项目存储库中的所有信息和说明作为文本
-
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.

MCP 服务器将 GitHub、GitLab 或本地目录中的代码存储库转换为 LLM 友好格式,保留上下文和结构以实现更好的 AI 处理。

  1. 概述
    1. 动机
      1. 问题解决了
        1. 主要特点
          1. 安装
            1. 工具
              1. 获取gitlab仓库
              2. 获取 github 仓库
              3. 获取本地仓库

            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 -
              15,359
              17,066
              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

            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