Code2prompt

Generates contextual prompts from codebases to aid AI assistants in understanding code repositories.
  • python

16

GitHub Stars

python

Language

6 months ago

First Indexed

2 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "odancona-code2prompt-mcp": {
      "command": "rye",
      "args": [
        "run",
        "python",
        "code2prompt_mcp.main"
      ]
    }
  }
}

code2prompt-mcp is an MCP server that analyzes codebases to produce contextual prompts, helping AI assistants understand and work with your repositories more effectively.

How to use

You run this MCP server from your local environment and connect to it with an MCP client. The server takes your codebase context and returns structured prompts that summarize files, dependencies, and common patterns, enabling AI agents to reasoning over your project more accurately.

Typical usage patterns include starting the MCP server locally and then querying it with your MCP client to fetch contextual prompts for a given codebase. You can reuse these prompts across sessions to maintain a consistent understanding of your repository as it evolves.

rye run python code2prompt_mcp.main

How to install

Ensure you have the required dependency manager installed and a working Git client. You will clone the project, install dependencies, and build the module in your local environment.

# prerequisites
# Install Git if not already installed
# Install Rye (dependency manager)

# Clone the repository
git clone https://github.com/odancona/code2prompt-mcp.git
cd code2prompt-mcp

# Install dependencies and build
rye build

Additional notes

Development and testing can be done with the MCP Inspector to verify how the server interprets and exposes its prompts.

npx @modelcontextprotocol/inspector python -m code2prompt_mcp.main
Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational