Local-first MCP server for intelligent code retrieval, AST-based indexing, relationship mapping, and token-efficient AI coding context.
Local-First Code Intelligence and Context Management for AI Coding Agents Compress context, prevent exploratory rediscovery loops, and bridge architectural disconnects across Python, TypeScript, Rust, and Flutter (Dart).
About this project Contributing Security
AI coding agents waste a large portion of their token budget on file discovery rather than actual work.
A typical agent session without TokenMS looks like this:
Without TokenMS With TokenMS :--- :--- Agent reads 8-15 whole files to find relevant code Agent receives only the exact symbols needed Repeated grep and exploratory reads per task Structured AST retrieval in a single call Manual relationship discovery across modules Cross-module pathway traversal built in 6,000-330,000 tokens consumed per task 1,500-3,500 tokens per task (budget-controlled) Agent loses critical context in long conversations Persistent curated knowledge ledger across sessions
The root cause: agents are optimized for chat, not for navigating large codebases. They read files sequentially, re-read them when context shifts, and have no way to know that AuthService in auth/service.py is the class that actually matters for the task at hand.
TokenMS solves this at the infrastructure level, not by prompting the agent to "be smarter."
TMS runs locally alongside your editor as a Model Context Protocol (MCP) service. It parses your repository into an Abstract Syntax Tree (AST) symbol graph, maps cross-module relationships, and uses Knapsack optimization to assemble only the exact classes, functions, and interfaces required for a task into a compac
From the project README.
Add the radar badge to your README — it shows your project was picked up by MCP Radar and links to this page:
[](https://mcp.liqiwa.com/s/HARSHNEXX--TokenMS.html)
🧠 Save 70–95% tokens in Claude Code, Cursor, Windsurf & Cline. Local Tree-sitter code graph MCP server: surgical edit context instead of full-file reads, refactor safety checks, and a hook that blocks
00200200/usagetrimKeep the signal. Cut the noise. Local CLI + MCP — fold verbose tool output for Claude Code, Codex, Cursor & Desktop.
thaildhe172591/pythiaPL/SQL development for AI agents on Oracle Database - expert queries, impact analysis, and a snapshot-verified write path with honest rollback
Farukes/TokenJarZero-cost token optimization engine for AI coding assistants (Claude Code, Cursor, Antigravity, Windsurf). Saves 70-95% tokens via AST skeletons, differential cache, and line slicing.
dagoSte/code-graphLocal code intelligence for 8 languages + SQLite SQL. Technical and declared functional maps, FTS5/BM25 + graph/RRF search, impact and test plans. CLI, dashboard and 15 MCP tools. Optional Codex/Claud
Ryrahul/session-relayShare AI coding-agent sessions with your team: /share in Claude Code, Codex, OpenCode, Gemini CLI, Copilot CLI, Cursor or ZCode, /pickup in another. Self-hosted, open source.
The top new MCP servers of the week, every Monday. No spam, unsubscribe anytime.