Skip to main content

An MCP server for the codetoprompt library, enabling integration with LLM agents.

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

codetoprompt_mcp-0.1.0.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

codetoprompt_mcp-0.1.0-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file codetoprompt_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: codetoprompt_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for codetoprompt_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7b4e8ae84a2bc22e2f0f91e9abd48342b11f40b8eb750b6bb38e262642ac14ed
MD5 dfe384ca50aae8de84c9e1075b7439b9
BLAKE2b-256 6f8fe51154f3ff7e75cc888ef2716589f342ab2c76dff989a19d52f9c9e7d203

See more details on using hashes here.

File details

Details for the file codetoprompt_mcp-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for codetoprompt_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bc8be04edfadd682702f7ef3c04c4fc3d25050cad796ec923205f9dec3ac0a6e
MD5 b7a36a9b7d9b95cf5a46800e4472779a
BLAKE2b-256 23bd48ecdbc1bd6b17ca669bb330230efd54b748a01e6125c41aa2743d2232ed

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page