About Code2Prompt MCP Server
The Code2Prompt MCP Server is a utility server that enables AI assistants to interact with codebases through the Model Context Protocol (MCP). It provides tools for converting entire codebases into well-structured prompts suitable for large language models (LLMs). Key features include:
- Automatic Code Processing: Traverses directories to build a tree structure and gathers information about each file, facilitating the creation of comprehensive prompts for code analysis and generation tasks.
- Smart Filtering: Allows inclusion or exclusion of files using glob patterns and respects .gitignore rules to focus on relevant code sections.
- Flexible Templating: Supports customization of prompt generation using Handlebars templates, enabling tailored outputs for different use cases.
- Token Tracking: Tracks token usage to ensure compatibility with LLM context limits, aiding in efficient prompt creation.
- Git Integration: Includes diffs, logs, and branch comparisons in prompts, providing context on code changes and history.
- Developer Experience: Features automatic clipboard copy, line numbers, and file organization options to enhance usability.
Designed for local operation, the server ensures data privacy and security. It is actively maintained as an open-source project.