#5858th of 77 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
Stars, last 30 weeks+599
27 Mar 2026: 7,133 stars3 Apr 2026: 7,151 stars10 Apr 2026: 7,175 stars17 Apr 2026: 7,194 stars24 Apr 2026: 7,208 stars1 May 2026: 7,231 stars8 May 2026: 7,245 stars15 May 2026: 7,260 stars22 May 2026: 7,282 stars29 May 2026: 7,298 stars5 Jun 2026: 7,321 stars12 Jun 2026: 7,335 stars19 Jun 2026: 7,360 stars26 Jun 2026: 7,375 stars3 Jul 2026: 7,396 stars10 Jul 2026: 7,414 stars17 Jul 2026: 7,430 stars24 Jul 2026: 7,448 stars31 Jul 2026: 7,461 stars7 Aug 2026: 7,469 stars14 Aug 2026: 7,555 stars21 Aug 2026: 7,567 stars28 Aug 2026: 7,582 stars4 Sept 2026: 7,598 stars11 Sept 2026: 7,626 stars18 Sept 2026: 7,636 stars25 Sept 2026: 7,677 stars2 Oct 2026: 7,702 stars9 Oct 2026: 7,708 stars16 Oct 2026: 7,720 stars23 Oct 2026: 7,732 stars

7,133 on 27 Mar 20267,732 on 23 Oct 2026

From GitHub's daily star counts.

Checked on GitHub.

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

Quick answers

Is code2prompt open source?

Yes. Its code is on GitHub under the MIT license.

Also in MCP servers for developers

See all 77
Also in MCP servers for developers
RankProjectScore
1codegraphLocal code knowledge graph that coding agents query over MCP75.1k starsMIT96 out of 100
2gitnexusCode knowledge graph exposed to coding agents through MCP tools Live demo ↗ (opens in a new tab)48k starscustom license96 out of 100
3serenaMCP server giving coding agents symbol-level code search, editing and refactoring30.7k starscustom license92 out of 100
#4n8n-mcpMCP server exposing n8n node docs, templates and workflow management to AI assistants Live demo ↗ (opens in a new tab)23.1k starsMIT91 out of 100
#5chrome-devtools-mcpMCP server and CLI that lets coding agents control and debug live Chrome54.1k starsApache-2.089 out of 100