{"slug": "i-gave-claude-desktop-a-tax-free-mcp-memory-layer", "title": "I gave Claude Desktop a tax-free MCP memory layer", "summary": "A developer built zerikai_memory, an open-source MCP memory layer that runs locally behind Claude Desktop, using Tree-Sitter to parse source files and Markdown into a ChromaDB vector store. The tool aims to reduce token costs and context loss by providing cited, queryable project memory without LLM inference on the user's data.", "body_md": "Most of us have felt it by now. **The Context Tax.**\n\nSlow token bleed just to re-establish what the AI already knew last session. A real dollar cost.\n\nBut the problem started before AI tools existed. I once spent nearly a full week reverse-engineering a Django SaaS I was dropped into. Reading someone else's code. Mapping flows I had not written. Just to get to a place where I could build something new.\n\nThen came the AI boom. Same problem, different shape.\n\nI would return to a client project after a few months away, my own code, and stand there asking why I wrote a function that long. IDE agents helped. But every new session meant re-attaching files, re-explaining architecture, and burning 500 to 1,000 tokens before writing a single useful prompt.\n\nI tried managing it manually:\n\n`NOTES.md`\n\nfile here.It was frustrating, but functional. Then the frontier model companies started repricing. I had an annual VS Code subscription active. I could see the math shifting under me.\n\nBefore the price changes landed, I started researching memory layers. Not as a vague concept. As something I could build, own, and run locally. Something queryable. Something that traveled with the project.\n\nThat is what [ zerikai_memory](https://github.com/KikeVen/zerikai_memory) became. It can run behind Claude Desktop via MCP. That is where it gets interesting.\n\nThe more I learned about how LLMs hallucinate, the more I knew I had to stay as close to the source of truth as possible. The file scanner is entirely LLM-free.\n\nI reached for Tree-Sitter because it builds a Concrete Syntax Tree directly from source files. Full structural fidelity. Zero model inference touching your data. Right now it parses Python, JavaScript, TypeScript, HTML, and Markdown. More languages coming.\n\nWhat I did not expect was how well it handles Markdown. That turned out to be the real asset.\n\nWhen the scanner hits a `.md`\n\nor `.mdx`\n\nfile, `_extract_markdown()`\n\nin `code_indexer.py`\n\nparses it into a CST and walks the tree recursively:\n\n`Getting Started > Installation > Docker`\n\n.\n\n```\n[ChromaDB vector store]  <- lives in .brain/, isolated per workspace\n        |\n        v  Query triggers L1 -> L2 -> L3 -> L4\n[L1: Vector search]       L2 distance, top-N results\n[L2: Lexical re-rank]     boosts exact keyword + entity matches\n[L3: Mode routing]        cloud / local / hybrid\n[L4: Synthesis]           answer with inline #file:line citations\n        |\n        v\n[Your IDE gets clean, cited context. Not a file dump.]\n```\n\nThe pipeline returns only the most relevant sections.\n\nThe IDE or Claude Desktop session calls the memory via MCP.\n\nThe context window stays lean. It does not dump entire files into the chat context.\n\nPrecise source references back. Not raw context dumps. My API bill stays manageable.\n\nOnce I realized I could drop research, reading logs, and saved notes into Markdown, scan them into memory, and query them through Claude Desktop, the workflow changed.\n\nHere is my deep research workflow:\n\n`zerikai_memory`\n\nindexes it.The research workflow is one example. Any Claude Desktop workflow that benefits from persistent, queryable context can plug into the same pattern.\n\nTen research results indexed. Sitting in memory. Accessible from any new chat session. I do not re-explain context. I do not re-paste 5,000-word documents. I just query.\n\nI can also ask the memory to save useful chunks from a live session under a custom title. A conversation that produced something worth keeping does not disappear when the terminal closes.\n\nA marketing brief built on indexed market data reads differently than one built from stale training data. A legal response built on precedent you actually looked up. A PRD that reflects real technical context. The memory layer is not just saving tokens. It changes what you can produce with them.\n\nFor Markdown files, you still need an IDE to run the MCP server.\n\n**Step 1: Clone and install**\n\n```\ngit clone https://github.com/KikeVen/zerikai_memory.git\ncd zerikai_memory\npython -m venv .venv\nsource .venv/bin/activate        # macOS / Linux\n# .venv\\Scripts\\activate         # Windows\npip install -r requirements.txt\n# Verify\npython -c \"from main import scan_workspace, query_memory; print('OK')\"\n```\n\nEdit the `.env`\n\nfile in the clone directory. Point it at your preferred LLM in Ollama or DeepSeek (requires an API key).\n\nIf there are files or directories you do not want scanned in the workspace you want indexed, add a `.memignore`\n\nfile to the project root and list them there. The scanner skips them.\n\n**Step 2: Add it to your IDE/coding CLI MCP config**\n\n```\n{\n  \"mcpServers\": {\n    \"universal-brain\": {\n      \"command\": \"/absolute/path/to/zerikai_memory/.venv/bin/python\",\n      \"args\": [\"/absolute/path/to/zerikai_memory/main.py\"]\n    }\n  }\n}\n```\n\nEvery path must be absolute. Relative paths cause silent startup failures. No error message. You will spend an hour debugging nothing.\n\n**Step 3: Scan your workspace**\n\nOpen the VS Code command palette (or IDE/coding CLI). Call `#universal-brain`\n\n. Scan the workspace for the first time:\n\n```\n\"Set up memory for this project\"\n```\n\nIt runs in the background. Poll with `scan_status`\n\nto track progress. Once complete, the codebase is indexed. The project brief lives in `.brain/contexts/`\n\n. For a full list of tool commands, visit [docs](https://github.com/KikeVen/zerikai_memory#mcp-tools-reference)\n\n**Step 4: Query it**\n\n```\nquery_memory: where does data flow after the payments endpoint?\n```\n\nThat is it.\n\nVisit [zerikai_memory](https://github.com/KikeVen/zerikai_memory) on GitHub to install it.", "url": "https://wpnews.pro/news/i-gave-claude-desktop-a-tax-free-mcp-memory-layer", "canonical_source": "https://dev.to/kike/i-gave-claude-desktop-a-tax-free-mcp-memory-layer-pl", "published_at": "2026-08-10 13:30:00+00:00", "updated_at": "2026-08-10 13:49:47.619377+00:00", "lang": "en", "topics": ["developer-tools", "ai-tools", "ai-infrastructure", "large-language-models"], "entities": ["zerikai_memory", "Claude Desktop", "Tree-Sitter", "ChromaDB", "MCP", "KikeVen"], "alternates": {"html": "https://wpnews.pro/news/i-gave-claude-desktop-a-tax-free-mcp-memory-layer", "markdown": "https://wpnews.pro/news/i-gave-claude-desktop-a-tax-free-mcp-memory-layer.md", "text": "https://wpnews.pro/news/i-gave-claude-desktop-a-tax-free-mcp-memory-layer.txt", "jsonld": "https://wpnews.pro/news/i-gave-claude-desktop-a-tax-free-mcp-memory-layer.jsonld"}}