Connecting Obsidian to Claude Desktop & Cursor via MCP + TOON: Cutting Token Overhead by 36.7%–45%
When developers wire a personal Obsidian vault into Claude Desktop or Cursor through the Model Context Protocol (MCP), two bottlenecks show up almost immediately: Raw web clippings poison context windows with navigation chrome, cookie banners, tracking URLs, and 404 stubs. Standard JSON-RPC payloads waste 35%–45% of your token budget repeating the same field names, braces, and quotes across hundreds of uniform notes. While building ScrapLibra (and its Telegram capture bot @telelibra_ai_bot), we solved both bottlenecks by pairing a 20-folder flat Obsidian Markdown taxonomy with tabular TOON (Token-Optimized Object Notation) over MCP. Here is the reproducible tiktoken (cl100k_base) benchmark, the open-source starter kit, and the architecture behind it. 1. Why JSON-RPC Is Wasteful for Homogeneous Knowledge Batches A typical MCP search_notes or export_processed_batch call returns 50 to 500 structured notes sharing identical fields (note_id, category, title, source_url, tags, summary, takeaways, wikilinks). In JSON, every key name is repeated on every single record. In TOON, the schema is declared once in the header and each record streams as a compact row: notes[2]{id,cat,title,url,tags,summary,links}: note_0001|ML|Speculative Decoding in Gemini|https://example.org/ml/1|#llm #inference|Atomic synthesis...|[[MCP-Gateway]] note_0002|agents|Multi-Agent Orchestration|https://example.org/ag/2|#agentic #mcp|Atomic synthesis...|[[TOON-Protocol]] No repeated keys, no redundant braces, and deterministic parsing on the client side. 2. Reproducible Benchmark (tiktoken cl100k_base) We ran 100 and 500 structured 9-field atomic notes through OpenAI's tiktoken (cl100k_base) tokenizer. You can run the exact benchmark yourself from our MIT-licensed showcase repository: 16bitSega/scraplibra-mcp/benchmarks/toon_vs_json_benchmark.py. Batch Size Verbose JSON-RPC Obsidian Markdown (.md + YAML) TOON Stream Markdown vs JSON TOON vs JSON 100 notes (9 fields) 25,093 tokens 19,140 tokens 15,880 tokens -23.72% -36.72% 500 notes (9 fields) 125,333 tokens 95,700 tokens 79,320 tokens -23.64% -36.71% Nested MCP metadata (timestamps, backlinks, chunks) ~25,093 ~19,140 ~13,800 ~-24% up to -45% Practical takeaway: Within the same Claude Desktop or Cursor context window, an agent can inspect 58%–80% more notes per turn, with lower Time-to-First-Token (TTFT) and lower per-step inference cost. 3. Why a 20-Folder Flat Taxonomy Beats Deep Nesting Before adding MCP, we noticed that nested folder trees (Tech/AI/Agents/MCP/2026/...) collapse once a vault crosses 300–500 notes: You spend more time deciding where a link belongs than reading it. LLM classifiers hallucinate inconsistent subpaths. Instead, every captured link, YouTube video, ArXiv PDF, or Telegram Saved Messages export item is filtered locally by a Zero-Credit Noise Shield (stripping 31%–44% stubs, UTM duplicates, 404s, and private PII before calling Google Gemini 3.5 Flash in inference-only mode) and routed into 1 of 20 flat Markdown folders with YAML frontmatter and [[wikilinks]]. You can grab the free MIT 20-Folder Obsidian Starter Kit directly from GitHub: Repository: https://github.com/16bitSega/scraplibra-mcp Full Taxonomy Guide: https://scraplibra.com/guides/20-folder-flat-taxonomy/ 4. Wiring It Into Claude Desktop & Cursor (9 MCP Tools) The ScrapLibra MCP Gateway exposes 9 tools over Streamable HTTP / JSON-RPC 2.0 (search_notes, get_note, get_taxonomy_tree, get_notebooklm_compendium, create_topic_folder, export_processed_batch, get_tenant_status, initialize, tools/list) secured with an HMAC-SHA256 bearer token. Example claude_desktop_config.json / .cursor/mcp.json configuration: { "mcpServers": { "scraplibra": { "url": "https://scraplibra.com/mcp", "headers": { "Authorization": "Bearer YOUR_SCRAPLIBRA_MCP_TOKEN" } } } } (Full disclosure: I built ScrapLibra. There is a free Explorer tier with 10 notes and no credit card required; Pro Second Brain with live MCP is $4.99/mo or $47.88/yr, and one-time permanent credit packs start at $12.) Further Reading & Specs AI Second Brain + TOON Guide: https://scraplibra.com/guides/ai-second-brain-rag-mcp/ Full MCP Gateway Docs: https://scraplibra.com/mcp-docs/ (raw Markdown: /mcp-docs.md) Open-Source Starter Kit & Benchmark (MIT): https://github.com/16bitSega/scraplibra-mcp Machine-Readable Site Index: https://scraplibra.com/llms.txt
This is a summary aggregated from Dev.to. Read the complete article on the original site:
Read full article at Dev.to