MCP cover image
See in Github
2025-03-26

MCP服务器用于分析和将GIT存储库转换为LLM上下文的文本文件

1

Github Watches

0

Github Forks

0

Github Stars

repo-to-txt-mcp

An MCP server for analyzing and converting Git repositories to text files for LLM context.

Overview

repo-to-txt-mcp is a Machine Code Protocol (MCP) server that allows you to analyze GitHub repositories or local folders and convert them into structured text files. This is particularly useful for providing context about repositories to large language models (LLMs) like GPT-4.

This project extends the functionality of the repo-to-txt CLI tool to provide a web API that can be integrated into other applications, particularly Cursor's MCP system.

Features

  • Repository Analysis: Analyze both local and remote Git repositories
  • Structured Output: Generate formatted text with folder structure and concatenated file contents
  • File Filtering: Include or exclude files based on extensions
  • Token Management: Limit output size by token count
  • Easy Integration: Designed to work seamlessly with Cursor's MCP system
  • Cross-Platform: Works on Windows, macOS, and Linux

Installation

Prerequisites

  • Python 3.8+
  • Node.js 14+
  • Git

Installation Options

See the Installation Guide for detailed instructions on:

  • Direct installation
  • Docker installation
  • GitHub Container Registry usage

Quick Start

  1. Install the required packages:

    pip install -r requirements.txt
    npm install
    
  2. Start the server:

    node smithery-wrapper.js
    
  3. The server will be available at http://localhost:8000

API Usage

Convert a GitHub Repository

curl -X POST http://localhost:8000/analyze \
  -H "Content-Type: application/json" \
  -d '{
    "source": "https://github.com/username/repository",
    "return_file": true
  }'

Filter by File Extensions

curl -X POST http://localhost:8000/analyze \
  -H "Content-Type: application/json" \
  -d '{
    "source": "https://github.com/username/repository",
    "include_only": [".py", ".js", ".md"],
    "exclude": [".pyc", ".git"]
  }'

See the API Documentation for complete details.

Cursor Integration

This server is designed to integrate with Cursor to provide repository context to language models during conversations.

See the Cursor Integration Guide for instructions on how to set up and use this feature.

Docker Support

A Dockerfile is included to facilitate containerized deployment:

docker build -t repo-to-txt-mcp .
docker run -p 8000:8000 repo-to-txt-mcp

Smithery Integration

This project includes configuration for Smithery, a tool for managing MCPs:

smithery install chromewillow/repo-to-txt-mcp

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • This project builds on the functionality of the repo-to-txt CLI tool
  • Thanks to the FastMCP library for simplifying the creation of MCP servers

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Bora Yalcin
  • Evaluator for marketplace product descriptions, checks for relevancy and keyword stuffing.

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

  • huahuayu
  • 统一的API网关,用于将多个Etherscan样区块链Explorer API与对AI助手的模型上下文协议(MCP)支持。

  • modelcontextprotocol
  • 模型上下文协议服务器

  • Mintplex-Labs
  • 带有内置抹布,AI代理,无代理构建器,MCP兼容性等的多合一桌面和Docker AI应用程序。

    Reviews

    2 (1)
    Avatar
    user_R0Zo1Z2c
    2025-04-15

    I have been using Axiom MCP Server by zed-extensions and it has significantly improved my workflow. The server is incredibly reliable and easy to manage, offering robust performance and seamless integration. Highly recommend for anyone looking for a top-notch MCP application. Check it out at the provided link!