repo-to-txt-mcp
MCP server for analyzing and converting Git repositories to text files for LLM context
chromewillow
README
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
-
Install the required packages:
pip install -r requirements.txt npm install
-
Start the server:
node smithery-wrapper.js
-
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
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
MCP Package Docs Server
Facilitates LLMs to efficiently access and fetch structured documentation for packages in Go, Python, and NPM, enhancing software development with multi-language support and performance optimization.
Claude Code MCP
An implementation of Claude Code as a Model Context Protocol server that enables using Claude's software engineering capabilities (code generation, editing, reviewing, and file operations) through the standardized MCP interface.
@kazuph/mcp-taskmanager
Model Context Protocol server for Task Management. This allows Claude Desktop (or any MCP client) to manage and execute tasks in a queue-based system.
Linear MCP Server
Enables interaction with Linear's API for managing issues, teams, and projects programmatically through the Model Context Protocol.
mermaid-mcp-server
A Model Context Protocol (MCP) server that converts Mermaid diagrams to PNG images.
Jira-Context-MCP
MCP server to provide Jira Tickets information to AI coding agents like Cursor

Linear MCP Server
A Model Context Protocol server that integrates with Linear's issue tracking system, allowing LLMs to create, update, search, and comment on Linear issues through natural language interactions.

Sequential Thinking MCP Server
This server facilitates structured problem-solving by breaking down complex issues into sequential steps, supporting revisions, and enabling multiple solution paths through full MCP integration.