Sponsored by Deepsite.site

repo-to-txt-mcp

Created By
chromewillow9 months ago
MCP server for analyzing and converting Git repositories to text files for LLM context
Content

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
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Tavily Mcp
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
ChatWiseThe second fastest AI chatbot™
Serper MCP ServerA Serper MCP Server
Amap Maps高德地图官方 MCP Server
CursorThe AI Code Editor
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
DeepChatYour AI Partner on Desktop
WindsurfThe new purpose-built IDE to harness magic
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Playwright McpPlaywright MCP server
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。