BigContext MCP
MCP Server for handling large documents with intelligent segmentation and TF-IDF search. Designed to work with documents of any size without saturating the model context window.
Installation
Via uvx (Recommended)
No need to clone the repository! Install directly:
Configuration for Claude Desktop
Add to your ~/Library/Application Support/Claude/claude_desktop_config.json (macOS):
Restart Claude Desktop and the 31 BigContext tools will be available.
Overview
BigContext MCP allows Claude to work with extensive documents (books, manuals, research papers) by loading only relevant fragments per query, instead of the entire document. It uses automatic segmentation and TF-IDF keyword search to retrieve the most relevant content.
Key Features
Document Processing
Multi-format support: txt, md, PDF, EPUB, HTML
Automatic segmentation: Detects chapters, sections, and hierarchical structure
Efficient storage: SQLite with WAL mode for concurrent access
TF-IDF indexing: Fast semantic search without external embeddings
31 Domain-Agnostic Tools
Core Tools (5)
Tool | Description |
| Load, segment, and index a document |
| Search for relevant segments using TF-IDF |
| Get metadata, structure, and top terms |
| List all indexed documents |
| Compare two segments for themes and similarity |
Epistemology Tools (4)
Tool | Description |
| Analyze what a document CAN and CANNOT support |
| Check if a claim can be grounded in the source |
| Complete analysis before scholarly claims |
| Validate linguistic operations |
Semantic Tools (4)
Tool | Description |
| Identify conceptual frameworks (causal, revelational, performative) |
| Distinguish indeterminacy from subdetermination |
| Identify performative speech acts |
| Detect imported post-biblical concepts |
Cognitive Tools (4)
Tool | Description |
| Validate query and output compliance |
| Scan for unauthorized connectors |
| Get allowed operations per text type |
| Generate compliant response when violations detected |
Extraction Validators (14)
Tool | Description |
| Verify quoted text exists EXACTLY in source |
| Check if segments are adjacent |
| Get segments within proximity constraint |
| Detect who is speaking in a segment |
| Detect pattern completion not in source |
| Validate pure data extraction |
| Distinguish voice types in text |
| Distinguish EXECUTED vs REFERENCED actions |
| Identify genre based on structure |
| Find actions without speech verbs |
| Detect unsupported generalizations |
| Validate YES/NO question responses |
| Create closed vocabulary from document |
| Check if output uses only source vocabulary |
Domain-Agnostic Architecture
All extraction validators accept an optional DomainVocabulary parameter:
Example: Biblical Text
Example: Legal Documents
Usage Examples
1. Ingest a document
2. Search for content
3. Validate narrative voice
4. Validate agency execution
5. Detect text genre
Technical Stack
Python 3.11+ - Modern Python with type hints
FastMCP 2.x - MCP server framework with decorator-based tools
Pydantic 2.x - Schema validation
SQLite - Local storage with WAL mode
pdfplumber - PDF text extraction
ebooklib - EPUB support
beautifulsoup4 - HTML parsing
NLTK - NLP tokenization
Development
Local Installation
Local Testing with Claude Desktop
Architecture Highlights
Structural Pattern Matching
Pure structural patterns detect grammatical structure without vocabulary
Dynamic pattern generation combines structure + agent-provided vocabulary
Fallback mechanisms work with generic patterns when no vocabulary provided
No Hardcoded Assumptions
Zero biblical terms hardcoded in validation logic
Zero legal terms hardcoded
Zero religious assumptions
Agent provides ALL domain-specific vocabulary at runtime
Separation of Concerns
SPEECH_VERB_WHITELIST: 38 speech verbs (said, spoke, called, etc.)
CAUSAL_ACTION_VERBS: 90+ action verbs (caused, drove, made, etc.)
STRUCTURAL_NARRATIVE_VOICE_PATTERNS: Grammar-only patterns
DomainVocabulary: Agent-provided dynamic vocabulary
Changelog
V16: Python Migration (2026-01-10)
Complete rewrite from TypeScript to Python:
Framework: FastMCP 2.x with decorator-based tool registration
Distribution: uvx-ready (zero-clone install from GitHub)
Database: SQLite with WAL mode (same schema, compatible)
Validation: Pydantic replacing Zod
Total: 31 MCP tools migrated and tested
V15: Domain-Agnostic Extraction Validators
Expanded DomainVocabulary interface with 7 dynamic properties
Refactored all validators to accept optional vocabulary parameter
Zero hardcoded domain-specific terms
V14: Speech vs Action Verb Separation
Created SPEECH_VERB_WHITELIST (38 speech verbs)
Created CAUSAL_ACTION_VERBS (90+ action verbs)
V1-V13: Core Infrastructure
Multi-format document ingestion (txt, md, PDF, EPUB, HTML)
Automatic segmentation by chapters and sections
TF-IDF search implementation
SQLite storage with WAL mode
27 extraction validation tools
License
MIT
Contributing
We welcome contributions! Areas of interest:
Additional domain vocabularies (legal, academic, literary)
New extraction validators
Performance optimizations
Documentation improvements
Support
This server cannot be installed