{
  "source_file": "0930",
  "source_platform": "Dev.to",
  "author": "Enrique Bruzual",
  "title_listed": "I gave Claude Desktop a tax-free MCP memory layer",
  "keywords": "",
  "domain": "大模型算法",
  "content_type": "深度技术解析",
  "is_paid_flag": "否",
  "url": "https://dev.to/kike/i-gave-claude-desktop-a-tax-free-mcp-memory-layer-pl",
  "publish_date": "2026-08-10",
  "corpus_stage": "",
  "notes": "",
  "id": "9c4d359850c6",
  "collected_at": "2026-10-02T14:05:23",
  "title": "I gave Claude Desktop a tax-free MCP memory layer - DEV Community",
  "body_markdown": "Most of us have felt it by now.\nThe Context Tax.\nSlow token bleed just to re-establish what the AI already knew last session. A real dollar cost.\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.\nThen came the AI boom. Same problem, different shape.\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.\nI tried managing it manually:\nA\nNOTES.md\nfile here.\nA project brief copy-pasted into the chat there.\nCareful file selection to give the agent just enough context.\nIt 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.\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.\nThat is what\nzerikai_memory\nbecame. It can run behind Claude Desktop via MCP. That is where it gets interesting.\n🏗️ The Design Philosophy: Keep Scanners LLM-Free\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.\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.\nWhat I did not expect was how well it handles Markdown. That turned out to be the real asset.\n🔄 The Markdown Scanning Pipeline\nWhen the scanner hits a\n.md\nor\n.mdx\nfile,\n_extract_markdown()\nin\ncode_indexer.py\nparses it into a CST and walks the tree recursively:\nBreadcrumb Hierarchy:\nEach heading section becomes its own ChromaDB entity.\nExample:\nGetting Started > Installation > Docker\n.\nEntity Typing:\nPreamble content, task list checkboxes, and orphaned blocks are handled as distinct entity types.\nNo Bloat, No Drift:\nStorage uses deterministic MD5 IDs generated from the file path and section name. Re-scans overwrite, not duplicate.\n🔍 The Query Pipeline\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.]\nEnter fullscreen mode\nExit fullscreen mode\nThe pipeline returns only the most relevant sections.\nThe IDE or Claude Desktop session calls the memory via MCP.\nThe context window stays lean. It does not dump entire files into the chat context.\nPrecise source references back. Not raw context dumps. My API bill stays manageable.\n⚡ Runtime Architecture\nRuns behind an MCP interface. Executes asynchronously. If the IDE session times out, the memory keeps running.\nFully local with Ollama, fully cloud with DeepSeek, or hybrid.\nBuilt to exploit KV caching wherever possible. Not sacrificing performance. Saving real money.\n🚀 The Research Workflow\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.\nHere is my deep research workflow:\nThe Spark:\nStart with Google AI. Grab live search indexing on business, tech trends, or code documentation.\nThe Prompt:\nMove to Claude Desktop. Describe what I am figuring out. Trigger my deep-research prompt generator skill.\nThe Deep Dive:\nRun that prompt in Gemini Deep Research. It produces a large, comprehensive research report that can be exported to a Google Doc.\nThe Index:\nExport that document as Markdown into a directory.\nzerikai_memory\nindexes it.\nThe chat session that generated the Deep Research prompt already knows the questions I was asking. All it has to do is query the memory via MCP for the answers.\nThe research workflow is one example. Any Claude Desktop workflow that benefits from persistent, queryable context can plug into the same pattern.\nThe Payoff\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.\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.\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.\nInstall It\nFor Markdown files, you still need an IDE to run the MCP server.\nStep 1: Clone and install\ngit clone https://github.com/KikeVen/zerikai_memory.git\ncd\nzerikai_memory\npython\n-m\nvenv .venv\nsource\n.venv/bin/activate\n# macOS / Linux\n# .venv\\Scripts\\activate         # Windows\npip\ninstall\n-r\nrequirements.txt\n# Verify\npython\n-c\n\"from main import scan_workspace, query_memory; print('OK')\"\nEnter fullscreen mode\nExit fullscreen mode\nEdit the\n.env\nfile in the clone directory. Point it at your preferred LLM in Ollama or DeepSeek (requires an API key).\nIf there are files or directories you do not want scanned in the workspace you want indexed, add a\n.memignore\nfile to the project root and list them there. The scanner skips them.\nStep 2: Add it to your IDE/coding CLI MCP config\n{\n\"mcpServers\"\n:\n{\n\"universal-brain\"\n:\n{\n\"command\"\n:\n\"/absolute/path/to/zerikai_memory/.venv/bin/python\"\n,\n\"args\"\n:\n[\n\"/absolute/path/to/zerikai_memory/main.py\"\n]\n}\n}\n}\nEnter fullscreen mode\nExit fullscreen mode\nEvery path must be absolute. Relative paths cause silent startup failures. No error message. You will spend an hour debugging nothing.\nStep 3: Scan your workspace\nOpen the VS Code command palette (or IDE/coding CLI). Call\n#universal-brain\n. Scan the workspace for the first time:\n\"Set up memory for this project\"\nEnter fullscreen mode\nExit fullscreen mode\nIt runs in the background. Poll with\nscan_status\nto track progress. Once complete, the codebase is indexed. The project brief lives in\n.brain/contexts/\n. For a full list of tool commands, visit\ndocs\nStep 4: Query it\nquery_memory: where does data flow after the payments endpoint?\nEnter fullscreen mode\nExit fullscreen mode\nThat is it.\nVisit\nzerikai_memory\non GitHub to install it.\nRelated\nPost-Mortem: Building a Local MCP Server for Codebase Memory using Ollama and ChromaDB\nYour AI Agent is Stuck in a Loop. Here's the Memory Layer That Breaks It and Saves You Money",
  "metadata": {
    "title": "I gave Claude Desktop a tax-free MCP memory layer - DEV Community",
    "description": "Most of us have felt it by now. The Context Tax.  Slow token bleed just to re-establish what the AI... Tagged with ai, claude, mcp, rag.",
    "keywords": "ai, claude, mcp, rag, software, coding, development, engineering, inclusive, community",
    "author": null,
    "og:type": "article",
    "og:url": "https://dev.to/kike/i-gave-claude-desktop-a-tax-free-mcp-memory-layer-pl",
    "og:title": "I gave Claude Desktop a tax-free MCP memory layer",
    "og:description": "Most of us have felt it by now. The Context Tax.  Slow token bleed just to re-establish what the AI...",
    "og:site_name": "DEV Community",
    "og:image": "https://media2.dev.to/dynamic/image/width=1200,height=627,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fd55f3u94wdwo15mnnqth.png",
    "twitter:site": "@thepracticaldev",
    "twitter:creator": "@",
    "twitter:title": "I gave Claude Desktop a tax-free MCP memory layer",
    "twitter:description": "Most of us have felt it by now. The Context Tax.  Slow token bleed just to re-establish what the AI...",
    "twitter:card": "summary_large_image",
    "twitter:widgets:new-embed-design": "on",
    "twitter:image:src": "https://media2.dev.to/dynamic/image/width=1200,height=627,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fd55f3u94wdwo15mnnqth.png"
  },
  "paywall": {
    "listed_paid": false,
    "detected": false,
    "marker": "",
    "public_only": false,
    "policy": "付费/会员内容只保留页面公开可见部分，不绕过付费墙"
  },
  "crawl": {
    "success": true,
    "status_code": 200,
    "error": ""
  },
  "code_blocks": [
    {
      "file": "attachments/9c4d359850c6/code/body-000.txt",
      "chars": 433,
      "language": "text"
    },
    {
      "file": "attachments/9c4d359850c6/code/body-001.txt",
      "chars": 299,
      "language": "text"
    },
    {
      "file": "attachments/9c4d359850c6/code/body-002.txt",
      "chars": 186,
      "language": "text"
    },
    {
      "file": "attachments/9c4d359850c6/code/body-003.txt",
      "chars": 33,
      "language": "text"
    },
    {
      "file": "attachments/9c4d359850c6/code/body-004.txt",
      "chars": 64,
      "language": "text"
    }
  ],
  "images": [
    {
      "status": "ok",
      "url": "https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fll4qyc4lz5chjmsklkfm.png",
      "bytes": 42991,
      "reused": true,
      "local_path": "attachments/9c4d359850c6/images/002.png",
      "src": "https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fll4qyc4lz5chjmsklkfm.png",
      "alt": "MCP memory call",
      "downloaded": true
    },
    {
      "status": "ok",
      "url": "https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fr4a3g87kf9o66k2gbfsh.png",
      "bytes": 55575,
      "reused": true,
      "local_path": "attachments/9c4d359850c6/images/003.png",
      "src": "https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fr4a3g87kf9o66k2gbfsh.png",
      "alt": "Lean context window",
      "downloaded": true
    },
    {
      "status": "ok",
      "url": "https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fsmh238nfmd6jnp1eyyqv.png",
      "bytes": 18257,
      "reused": true,
      "local_path": "attachments/9c4d359850c6/images/004.png",
      "src": "https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fsmh238nfmd6jnp1eyyqv.png",
      "alt": "source references",
      "downloaded": true
    },
    {
      "status": "ok",
      "url": "https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffnwpjjwonuz57mgtxzua.png",
      "bytes": 234554,
      "reused": true,
      "local_path": "attachments/9c4d359850c6/images/005.png",
      "src": "https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffnwpjjwonuz57mgtxzua.png",
      "alt": "Claude and Zerikai_memory",
      "downloaded": true
    }
  ],
  "audio": [],
  "videos": [],
  "links": [
    {
      "href": "https://github.com/KikeVen/zerikai_memory",
      "label": "zerikai_memory",
      "type": "a"
    },
    {
      "href": "https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fll4qyc4lz5chjmsklkfm.png",
      "label": "",
      "type": "a"
    },
    {
      "href": "https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fr4a3g87kf9o66k2gbfsh.png",
      "label": "",
      "type": "a"
    },
    {
      "href": "https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fsmh238nfmd6jnp1eyyqv.png",
      "label": "",
      "type": "a"
    },
    {
      "href": "https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffnwpjjwonuz57mgtxzua.png",
      "label": "",
      "type": "a"
    },
    {
      "href": "https://dev.to/kike/post-mortem-building-a-local-mcp-server-for-codebase-memory-using-ollama-and-chromadb-3ilg",
      "label": "Post-Mortem: Building a Local MCP Server for Codebase Memory using Ollama and ChromaDB",
      "type": "a"
    },
    {
      "href": "https://dev.to/kike/your-ai-agent-is-stuck-in-a-loop-heres-the-memory-layer-that-breaks-it-and-saves-you-money-5fni",
      "label": "Your AI Agent is Stuck in a Loop. Here's the Memory Layer That Breaks It and Saves You Money",
      "type": "a"
    }
  ],
  "repair_version": 2,
  "repaired_at": "2026-10-14T10:49:58Z",
  "source_url": "https://dev.to/kike/i-gave-claude-desktop-a-tax-free-mcp-memory-layer-pl",
  "papers": [],
  "actual_video_files": [],
  "body_chars": 7167,
  "expected_body_images": 4,
  "discovery_status": "ok",
  "delivery_status": "ok",
  "missing_reason": "",
  "raw_html": "attachments/9c4d359850c6/pages/source.html",
  "local_html": "attachments/9c4d359850c6/pages/article.html",
  "body_base_path": "attachments/9c4d359850c6/pages/",
  "body_markdown_path": "attachments/9c4d359850c6/pages/article.md"
}