codemap is a blazing fast Rust CLI tool and MCP (Model Context Protocol) server for analyzing codebases. It extracts definitions (functions, classes, structs) from source code using Tree-sitter and outputs them in a structured format (Markdown or JSON) optimized for LLM context.
- Fast: Built with Rust and Rayon for parallel processing.
- Accurate: Uses Tree-sitter for robust parsing.
- Structured Output: Generates concise Markdown summaries of your code structure.
- MCP Support: Runs as an MCP server to provide context to LLMs like Claude or Cursor.
- Language Support: Rust, Python, TypeScript, TSX.
cargo install --path .Analyze a directory and output Markdown:
codemap src/Output JSON:
codemap src/ --format jsonTo use codemap as an MCP server with Claude Desktop or other clients, configure it as follows:
{
"mcpServers": {
"codemap": {
"command": "codemap",
"args": ["--serve"]
}
}
}Run tests:
cargo testMIT