#1515th of 23 in MCP servers for developers

code2prompt

Rust CLI that packs a codebase into one formatted LLM prompt

Stars
7.7k
License
MIT
Last commit
Sep 2026
Last release
Dec 2025
Language
Rust

Missed the latest GitHub check; these facts may be older.

Overview

code2prompt walks a directory, filters files with glob patterns and .gitignore rules, and renders them through Handlebars templates into a single prompt. Output goes to stdout, a file, or the clipboard, with per-file token estimates and optional Git diffs and logs. It ships as a Rust core library, a CLI with a TUI, a Python SDK (code2prompt-rs) and an MCP server, plus an agent skill.

Who it is for: Developers who paste repository context into LLMs or feed it to agents

Strengths

  • Handlebars templates let you customize the prompt layout per use case
  • Respects .gitignore and supports include/exclude glob patterns
  • Includes Git diffs, logs and branch comparisons in the prompt
  • Available as CLI, TUI, Python SDK on PyPI, and MCP server

Weaknesses

  • Token count is an estimate; the full rendered prompt is not re-tokenized
  • Agent skill needs the CLI installed separately
  • Entity map for the skill requires an optional build feature
  • Wayland clipboard support needs a feature flag at build time

What it needs

  • no GPU

Also in MCP servers for developers

See all 23
Also in MCP servers for developers
RankProjectScore
1gitnexusCode knowledge graph exposed to coding agents through MCP tools Live demo ↗ (opens in a new tab)47.9k starscustom license90 out of 100
2codegraphLocal code knowledge graph served to coding agents over MCP74.1k starsMIT81 out of 100
3serenaMCP server giving coding agents symbol-level code search, editing and refactoring30.3k starscustom license71 out of 100
#4chrome-devtools-mcpMCP server that lets coding agents drive and debug a live Chrome53.6k starsApache-2.070 out of 100
#5codebase-memory-mcpLocal MCP server that indexes a codebase into a queryable code knowledge graph46.6k starsMIT70 out of 100