#1515th of 23 in MCP servers for developers
code2prompt
Rust CLI that packs a codebase into one formatted LLM prompt
Documentation ↗
(opens in a new tab)Website ↗
(opens in a new tab)Repository on GitHub ↗
(opens in a new tab)
- 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| Rank | Project | Score |
|---|---|---|
| 1 | gitnexusCode knowledge graph exposed to coding agents through MCP tools | 90 out of 100 |
| 2 | codegraphLocal code knowledge graph served to coding agents over MCP | 81 out of 100 |
| 3 | serenaMCP server giving coding agents symbol-level code search, editing and refactoring | 71 out of 100 |
| #4 | chrome-devtools-mcpMCP server that lets coding agents drive and debug a live Chrome | 70 out of 100 |
| #5 | codebase-memory-mcpLocal MCP server that indexes a codebase into a queryable code knowledge graph | 70 out of 100 |