MCP-Repo2LLM
MCP-レポ2LLM
概要
mcp-repo2llm は、コードリポジトリを LLM 対応形式に変換する MCP サーバーです。コードリポジトリを LLM 対応形式に変換する強力なツールであり、従来のコードベースと最新の AI 言語モデル間のギャップを埋めます。このリポジトリは、リポジトリを LLM 対応形式に変換するためのコア機能を提供するRepoToTextForLLMsをベースにしています。
Related MCP server: SRC (Structured Repo Context)
モチベーション
AIと大規模言語モデル(LLM)がソフトウェア開発においてますます重要になるにつれ、コードベースをこれらのモデルに効果的に伝達する必要性が高まっています。従来のコードリポジトリはLLM処理に最適化されていないため、AIツールを用いてコード分析や生成を行う際に、最適な結果が得られない可能性があります。
問題解決
このプロジェクトは、いくつかの重要な課題に取り組んでいます。
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トークン
ツール
get_gitlab_repo
GitLabリポジトリブランチからコードをテキストとして処理して返す
入力:
repo_url (文字列): GitLabのリポジトリURL
ブランチ(文字列):ブランチ名。デフォルトはマスター
戻り値(文字列): リポジトリからプロジェクトのすべての情報と指示をテキストとして返します
githubリポジトリを取得する
Githubリポジトリブランチからコードをテキストとして処理して返す
入力:
repo_url (文字列): githubのリポジトリURL
ブランチ(文字列):ブランチ名。デフォルトはマスター
戻り値(文字列): リポジトリからプロジェクトのすべての情報と指示をテキストとして返します
get_local_repo
GitLabリポジトリブランチからコードをテキストとして処理して返す
入力:
repo_url (文字列): リポジトリパス
戻り値(文字列): リポジトリからプロジェクトのすべての情報と指示をテキストとして返します
Available Tools
3 toolsget_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
Scored across 3 tools
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.
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.
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.
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'.
Maintenance
Related MCP Connectors
An MCP server that gives your AI access to the source code and docs of all public github repos
A MCP server built for developers enabling Git based project management with project and personal…
Repository knowledge graph MCP server for codebase understanding and debugging.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Related MCP Servers
- AlicenseAqualityDmaintenanceAn MCP server that scans codebases to extract structural information (classes, functions, etc.) with flexible filtering options and outputs in LLM-friendly formats.12GPL 3.0
- AlicenseAqualityBmaintenanceAn MCP server and CLI tool that transforms codebases into AI-ready context through semantic search, call graph analysis, and incremental indexing. It enables AI assistants to perform hybrid vector and keyword searches to understand complex repository structures and cross-file relationships.3528 npm3MIT
- AlicenseCqualityDmaintenanceAn MCP server that analyzes local or remote GitHub repositories, providing intelligent code context and structure to AI coding assistants.1013MIT
- AlicenseDqualityDmaintenanceA lightweight MCP server for bringing GitHub repositories into context for large language models, enabling repository analysis, file access, and search without local cloning.47 npm6Apache 2.0