Utilizes structural parsing of Markdown documents to identify logical sections based on headings, ensuring that search results maintain coherence and respect document hierarchy.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@LODA MCP Serversearch README.md for the quick start section within 500 tokens"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
LODA MCP Server
LLM-Optimized Document Access - A Model Context Protocol server for token-efficient document search in Claude Desktop and Claude Code.
What is LODA?
LODA (LLM-Optimized Document Access) is a search strategy designed specifically for how LLMs consume documents. Instead of returning raw matches or arbitrary chunks, LODA understands document structure and returns the most relevant sections within your token budget.
The Problem
When LLMs work with large documents, they face a fundamental challenge:
Traditional Approach | Problem |
Load entire document | Exceeds context limits |
Keyword search | No relevance ranking, returns too much |
RAG/Vector search | Requires infrastructure, 200-500ms latency |
Chunk-based retrieval | Arbitrary boundaries break coherence |
We discovered a "gap zone" at 25-35% document positions where traditional smart retrieval actually performed worse than brute-force loading.
The Solution
LODA combines lightweight techniques to achieve vector search quality at grep-like speeds:
Results:
70-95% token savings compared to loading full document
1-5ms search latency (cached) vs 200-500ms for RAG
Zero external dependencies - no vector database needed
Quick Start
1. Installation
2. Configure Claude Desktop
Find your config file:
Windows:
%APPDATA%\Claude\claude_desktop_config.jsonmacOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
Add this to the file:
3. Configure Claude Code
Add to your project's .claude/settings.json or global ~/.claude/settings.json:
4. Use It!
Ask Claude:
"Use loda_search to find the authentication section in api-docs.md"
"Search architecture.md for deployment instructions with a 500 token budget"
How LODA Works
1. Bloom Filter Elimination
Before scoring, LODA uses Bloom filters to instantly eliminate sections that definitely don't contain your search terms. This O(1) operation typically eliminates 80%+ of sections.
2. Section-Aware Parsing
LODA respects your document's structure. It understands markdown headings and returns complete logical sections, not arbitrary text chunks.
3. Relevance Scoring
Each candidate section is scored based on:
Query term presence in content (0.8 base score)
Header match bonus (+0.2 for header matches)
Multi-term coverage (all terms weighted equally)
4. Token Budget Selection
You specify a token budget, LODA returns the best sections that fit:
5. Aggressive Caching
Document structures and Bloom filters are cached with TTL (60s default). Repeated searches on the same document are 10x+ faster.
API Reference
loda_search
The main search tool.
Parameters:
Parameter | Type | Required | Default | Description |
| string | Yes | - | Path to document (relative to staging or absolute) |
| string | Yes | - | Search keywords or phrase |
| number | No | null | Maximum tokens to return (null = unlimited) |
| number | No | 5 | Maximum sections to return |
Example Request:
Example Response:
Budget Status Values
Status | Meaning |
| No budget was specified |
| Total tokens under 80% of budget |
| Total tokens between 80-100% of budget |
| Over budget (first section always returned) |
Other Tools
Tool | Description |
| Get hierarchical structure of document |
| Read specific section by ID with context |
| Read specific line range |
| Basic regex search (no LODA optimization) |
Staging Directory
By default, LODA looks for documents in the staging/ subdirectory:
You can also use absolute paths to search any document on your system.
HTTP Mode (Development/Testing)
For testing without Claude, run the server in HTTP mode:
Then test with curl:
Performance
Metric | Target | Achieved |
Search latency (cached) | <10ms | 1-5ms |
Search latency (cold) | <100ms | 20-50ms |
Token savings | >70% | 70-95% |
Bloom filter effectiveness | >80% | ~85% |
Cache hit rate | >80% | ~90% |
Testing
Test Results: 46/46 Passing
Component | Tests | Status |
token_estimator | 6 | ✅ |
relevance_scorer | 8 | ✅ |
budget_manager | 6 | ✅ |
bloom_filter | 10 | ✅ |
loda_index | 8 | ✅ |
loda_search_handler | 8 | ✅ |
Architecture
Research & Development
This project was built using the Continuum Development Process (CDP), a 13-phase methodology that emphasizes traceability and quality gates.
Why We Built This
We tried several approaches before arriving at LODA:
Approach | Why It Failed |
Semantic Chunking | Arbitrary boundaries split logical units |
RAG + Vector Search | Too much infrastructure for single-doc access |
JIT-Steg Retrieval | "Gap zone" at 25-35% where overhead exceeded brute-force |
Simple Grep | No relevance ranking, no token awareness |
LODA combines the best of each: section awareness, fast elimination, budget control, and zero external dependencies.
Research Documents
ULTRATHINK Analysis - Problem analysis from 5+ perspectives
Research Notes - Literature review and approach comparison
Implementation Plan - Technical architecture
Testing Plan - 61 test cases specified
Configuration Examples
Claude Desktop (Windows)
%APPDATA%\Claude\claude_desktop_config.json:
Claude Desktop (macOS/Linux)
~/Library/Application Support/Claude/claude_desktop_config.json:
Claude Code (Project-level)
.claude/settings.json:
Contributing
Fork the repository
Create a feature branch
Write tests for new functionality
Submit a PR with documentation
License
MIT License - see LICENSE for details.
Acknowledgments
Built for Model Context Protocol
Developed using Continuum Development Process
Inspired by information retrieval research on probabilistic data structures
Made with 🧠 for LLMs that need to read documents efficiently.