
I Built a Tiny MCP That Understands Your Code and Saves 70% Tokens
Every coding agent demo looks magical... until you point it at a real codebase. Then it either: Chokes on context windows Hallucinates around stale code Or becomes so slow you might as well just grep I hit this wall building AI workflows with large Rust/Python/TS repos, so I built something I actually wanted for my own stack: a super light-weight, AST-based embedded MCP that just works on your codebase. It's called cocoindex-code and it's already saving me ~70% tokens and a lot of waiting time. If you're using Claude, Codex, Cursor, or any MCP-friendly coding agent, this post is for you. The Core Idea: AST + Incremental Indexing Most "code RAG" setups feel like infra projects: spin up a vector DB, write ETL, fight schema drift, tune chunking, maintain workers. Then you pray it all stays in sync. cocoindex-code takes the opposite approach: Embedded MCP : It runs locally as an MCP server, no separate DB to run or maintain. AST-based indexing : It understands code structure via Tree-sitte
Continue reading on Dev.to
Opens in a new tab

