Labsco
MCP SERVER

CodeToPrompt MCP Server

by yash9439

Turn a directory into one prompt an assistant can read — filtered, formatted and measured before you paste anything.

Codebase Context Packing & Compression
Summary
Know what a codebase costs before you send it.

The analysis tool answers the question that decides everything else — how many tokens this tree is — and the context tool then packs only what you chose to include. That order is what keeps a large repository from becoming a truncated prompt.

What it is

An MCP server around the codetoprompt library, which packs a codebase into a single prompt with filtering, formatting and compression options exposed as tool parameters.

What you get
  • A whole directory rendered into one prompt, with codetoprompt's filtering, formatting and compression options available on the call
  • A statistical read of the codebase first: token counts, line counts and a breakdown by file type
  • The contents of specific files formatted as a prompt, when only part of the tree matters
  • The same packing behaviour the CLI gives you, available to an agent without shelling out
Requirements

Pip install codetoprompt-mcp, which brings in codetoprompt and the mcp library, then a single `ctp-mcp` command in your client config. No account and no key — it reads the files you point it at.

Setup effort

One command — pip install codetoprompt-mcp