MCPHub LabRegistrymufeedvh/code2prompt
mufeedvh

mufeedvh/code2prompt

Built by mufeedvh 7,247 stars

What is mufeedvh/code2prompt?

A CLI tool to convert your codebase into a single LLM prompt with source tree, prompt templating, and token counting.

How to use mufeedvh/code2prompt?

1. Install a compatible MCP client (like Claude Desktop). 2. Open your configuration settings. 3. Add mufeedvh/code2prompt using the following command: npx @modelcontextprotocol/mufeedvh-code2prompt 4. Restart the client and verify the new tools are active.
🛡️ Scoped (Restricted)
npx @modelcontextprotocol/mufeedvh-code2prompt --scope restricted
🔓 Unrestricted Access
npx @modelcontextprotocol/mufeedvh-code2prompt

Key Features

Native MCP Protocol Support
Real-time Tool Activation & Execution
Verified High-performance Implementation
Secure Resource & Context Handling

Optimized Use Cases

Extending AI models with custom local capabilities
Automating system workflows via natural language
Connecting external data sources to LLM context windows

mufeedvh/code2prompt FAQ

Q

Is mufeedvh/code2prompt safe?

Yes, mufeedvh/code2prompt follows the standardized Model Context Protocol security patterns and only executes tools with explicit user-granted permissions.

Q

Is mufeedvh/code2prompt up to date?

mufeedvh/code2prompt is currently active in the registry with 7,247 stars on GitHub, indicating its reliability and community support.

Q

Are there any limits for mufeedvh/code2prompt?

Usage limits depend on the specific implementation of the MCP server and your system resources. Refer to the official documentation below for technical details.

Official Documentation

View on GitHub
<div align="center"> <a href="https://code2prompt.dev"> <img align="center" width="550px" src="https://github.com/mufeedvh/code2prompt/blob/main/.assets/logo_dark_v0.0.2.svg?raw=true" alt="Code2prompt"/> </a> <br> <h3>Convert your codebase into a single LLM prompt.</h3> </div> <p align="center"> <a href="https://code2prompt.dev"><b>Website</b></a> • <a href="https://code2prompt.dev/docs/welcome/"><b>Documentation</b></a> • <a href="https://discord.com/invite/ZZyBbsHTwH"><b>Discord</b></a> </p> <div align="center">

License Crates.io PyPI CI Discord Docs.rs Crates.io Downloads GitHub Stars

</div>
<h1 align="center"> <a href="https://code2prompt.dev"><img src="https://github.com/mufeedvh/code2prompt/blob/main/.assets/demo.gif?raw=true" alt="code2prompt demo"></a> </h1>

Flow Diagram

Code2Prompt is a powerful context engineering tool designed to ingest codebases and format them for Large Language Models. Whether you are manually copying context for ChatGPT, building AI agents via Python, or running a MCP server, Code2Prompt streamlines the context preparation process.

⚡ Quick Install

Cargo

cargo install code2prompt 

To enable optional Wayland support (e.g., for clipboard integration on Wayland-based systems), use the wayland feature flag:

cargo install --features wayland code2prompt

Homebrew

brew install code2prompt

SDK with pip 🐍

pip install code2prompt-rs

🚀 Quick Start

Once installed, generating a prompt from your codebase is as simple as pointing the tool to your directory.

Basic Usage: Generate a prompt from the current directory and copy it to the clipboard.

code2prompt .

Save to file:

code2prompt path/to/project --output-file prompt.txt

🌐 Ecosystem

Code2Prompt is more than just a CLI tool. It is a complete ecosystem for codebase context.

🧱 Core Library <br><img src="https://img.shields.io/badge/Rust-FF6700?style=for-the-badge&logo=rust&logoColor=white" alt="Rust Core Badge"/>💻 CLI Tool <br><img src="https://img.shields.io/badge/Terminal-2C3E50?style=for-the-badge&logo=gnu-bash&logoColor=white" alt="CLI Badge"/>🐍 Python SDK <br><img src="https://img.shields.io/badge/Python-3776AB?style=for-the-badge&logo=python&logoColor=white" alt="Python SDK Badge"/>🤖 MCP Server <img src="https://img.shields.io/badge/Agentic%20Flow-7E57C2?style=for-the-badge&logo=server&logoColor=white" alt="MCP Server Badge"/>
The internal, high-speed library responsible for secure file traversal, respecting .gitignore rules, and structuring Git metadata.Designed for humans, featuring both a minimal CLI and an interactive TUI. Generate formatted prompts, track token usage, and outputs the result to your clipboard or stdout.Provides fast Python bindings to the Rust Core. Ideal for AI Agents, automation scripts, or deep integration into RAG pipelines. Available on PyPI.Run Code2Prompt as a local service, enabling agentic applications to read your local codebase efficiently without bloating your context window.

📚 Documentation

Check our online documentation for detailed instructions

✨ Features

Code2Prompt transforms your entire codebase into a well-structured prompt for large language models. Key features include:

  • Terminal User Interface (TUI): Interactive terminal interface for configuring and generating prompts
  • Smart Filtering: Include/exclude files using glob patterns and respect .gitignore rules
  • Flexible Templating: Customize prompts with Handlebars templates for different use cases
  • Automatic Code Processing: Convert codebases of any size into readable, formatted prompts
  • Token Tracking: Track token usage to stay within LLM context limits
  • Smart File Reading: Simplify reading various file formats for LLMs (CSV, Notebooks, JSONL, etc.)
  • Git Integration: Include diffs, logs, and branch comparisons in your prompts
  • Blazing Fast: Built in Rust for high performance and low resource usage

Stop manually copying files and formatting code for LLMs. Code2Prompt handles the tedious work so you can focus on getting insights and solutions from AI models.

Alternative Installation

Refer to the documentation for detailed installation instructions.

Binary releases

Download the latest binary for your OS from Releases.

Source build

Requires:

git clone https://github.com/mufeedvh/code2prompt.git
cd code2prompt/
cargo install --path crates/code2prompt

⭐ Star Gazing

Star History Chart

📜 License

Licensed under the MIT License, see <a href="https://github.com/mufeedvh/code2prompt/blob/master/LICENSE">LICENSE</a> for more information.

Liked the project?

If you liked the project and found it useful, please give it a :star: !

👥 Contribution

Ways to contribute:

  • Suggest a feature
  • Report a bug
  • Fix something and open a pull request
  • Help me document the code
  • Spread the word

Global Ranking

8.5
Trust ScoreMCPHub Index

Based on codebase health & activity.

Manual Config

{ "mcpServers": { "mufeedvh-code2prompt": { "command": "npx", "args": ["mufeedvh-code2prompt"] } } }