CodeToPrompt MCP Server
Exposes the codetoprompt library to LLM agents for generating comprehensive prompts from directories and retrieving specific file contents. It enables codebase analysis through detailed statistics like token counts and file type breakdowns.
README
CodeToPrompt MCP Server
CodeToPrompt MCP Server exposes the powerful features of the codetoprompt library through the Model Context Protocol (MCP). This allows LLM agents and other MCP-compatible clients to programmatically generate prompts, analyze codebases, and retrieve specific file contents.
🔧 Installation
Install from PyPI:
pip install codetoprompt-mcp
This will automatically install codetoprompt and the required mcp library.
🚀 Usage with an MCP Client
This server is designed to be used with an MCP client, such as the Claude Desktop App.
Example: Claude Desktop Configuration
To use this server with Claude, add it to your claude_desktop_config.json file:
{
"mcpServers": {
"CodeToPrompt": {
"command": "ctp-mcp"
}
}
}
Once configured, you can invoke the tools from your conversation with the LLM.
Available Tools
ctp-get-context: The primary tool for generating a comprehensive prompt from a directory. It supports all ofcodetoprompt's filtering, formatting, and compression options.ctp-analyse-project: Provides a detailed statistical analysis of a codebase, including token counts, line counts, and breakdowns by file type.ctp-get-files: Retrieves the content of specific files, formatted as a prompt. This is useful for targeted queries.
🤝 Contributing
We welcome contributions! Please refer to the main codetoprompt repository for contribution guidelines.
📄 License
This project is licensed under the MIT License. See the LICENSE file for full details.
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.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.