Skip to main content

CodeToPrompt MCP Server

PyPI version

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 of codetoprompt'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.

Metadata

Release files for codetoprompt-mcp 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for codetoprompt-mcp 0.1.0
File Size Uploaded
codetoprompt_mcp-0.1.0.tar.gz 5.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for codetoprompt-mcp 0.1.0
File Interpreter ABI Platform
codetoprompt_mcp-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 12.5 kB

Release files / codetoprompt_mcp-0.1.0.tar.gz

Download URL codetoprompt_mcp-0.1.0.tar.gz
Size 5.9 kB
Tags Source
SHA-256 checksum
How to use checksums
7b4e8ae84a2bc22e2f0f91e9abd48342b11f40b8eb750b6bb38e262642ac14ed
BLAKE2b-256 checksum
How to use checksums
6f8fe51154f3ff7e75cc888ef2716589f342ab2c76dff989a19d52f9c9e7d203
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.13

Release files / codetoprompt_mcp-0.1.0-py3-none-any.whl

Download URL codetoprompt_mcp-0.1.0-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bc8be04edfadd682702f7ef3c04c4fc3d25050cad796ec923205f9dec3ac0a6e
BLAKE2b-256 checksum
How to use checksums
23bd48ecdbc1bd6b17ca669bb330230efd54b748a01e6125c41aa2743d2232ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.13

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page