repo-to-txt-mcp
@chromewillow
MCP server for analyzing and converting Git repositories to text files for LLM context
Overview
What is repo-to-txt-mcp?
repo-to-txt-mcp is an MCP server that analyzes and converts Git repositories (remote or local) into structured text files for LLM context. It is designed for developers who want to provide repository context to large language models like GPT-4, and integrates with Cursor's MCP system.
How to use repo-to-txt-mcp?
Install Python 3.8+, Node.js 14+, and Git, then install dependencies with pip install -r requirements.txt and npm install. Start the server by running node smithery-wrapper.js (available at http://localhost:8000). Use the POST /analyze endpoint to submit analysis requests with JSON payloads specifying a source URL or local path, file filters, and token limits.
Key features of repo-to-txt-mcp
- Analyze both local and remote Git repositories
- Generate structured text with folder structure and file contents
- Include or exclude files by extension
- Limit output size by token count
- Integrates with Cursor's MCP system
- Cross-platform (Windows, macOS, Linux)
Use cases of repo-to-txt-mcp
- Provide full repository context to LLMs during code review or Q&A
- Convert repository contents into a single structured text for training or analysis
- Filter repositories to only include relevant files for specific tasks
- Use within Cursor conversations to give the AI context about a project
FAQ from repo-to-txt-mcp
How do I install repo-to-txt-mcp?
Prerequisites: Python 3.8+, Node.js 14+, Git. See the Installation Guide for direct, Docker, or GitHub Container Registry options.
How can I integrate repo-to-txt-mcp with Cursor?
The server is designed to integrate with Cursor to provide repository context during conversations. Refer to the Cursor Integration Guide in the repository for setup instructions.
What API endpoints does repo-to-txt-mcp expose?
The server provides a POST /analyze endpoint that accepts a JSON payload with a source (URL or local path), optional include/exclude file extension filters, and a return_file boolean.
Does repo-to-txt-mcp support Docker?
Yes, a Dockerfile is included. Build and run with docker build -t repo-to-txt-mcp . and docker run -p 8000:8000 repo-to-txt-mcp.
Can I limit the output size?
Yes, the server includes token management to limit output size by token count (not detailed further in the README).