background-vault-analysis
A lightweight MCP server for intelligent, non-invasive analysis of Obsidian vaults.
README
Background Vault Analysis System š§ āØ
A lightweight MCP (Model Context Protocol) server for intelligent, non-invasive analysis of Obsidian vaults. Provides actionable insights, change tracking, and comprehensive reporting to improve your knowledge management practices.
š Features
š Intelligent Vault Analysis
- Non-invasive scanning - Reads your vault without making any changes
- Markdown parsing - Extracts links, tags, frontmatter, and content structure
- Orphan detection - Identifies isolated notes that need connections
- Hub identification - Finds your most connected knowledge centers
- Content metrics - Word counts, link density, and structural analysis
š” Actionable Insights
- Prioritized recommendations - High/medium/low priority actionable suggestions
- Structural insights - Improve vault organization and connectivity
- Content guidance - Optimize note length and detail
- Productivity tracking - Monitor writing patterns and vault growth
š Change Monitoring
- File-level tracking - Monitor additions, modifications, and deletions
- Activity patterns - Identify productive periods and trends
- Evolution analysis - Track how your vault grows over time
- Daily summaries - See recent activity at a glance
š Flexible Reporting
- Markdown reports - Human-readable analysis summaries
- JSON exports - Structured data for programmatic use
- CSV formats - Data analysis and spreadsheet integration
- Customizable sections - Focus on what matters to you
š ļø Installation & Setup
Prerequisites
- Node.js v18 or higher
- Obsidian vault (any size)
- MCP-compatible client (Claude Desktop, etc.)
Quick Start
- Clone and build:
git clone <repository-url> background-vault-analysis
cd background-vault-analysis
npm install
npm run build
- Test the system:
node dist/test.js
- Configure your MCP client:
Add to your MCP configuration (e.g., Claude Desktop):
{
"mcpServers": {
"background-vault-analysis": {
"command": "node",
"args": ["/path/to/background-vault-analysis/dist/index.js"]
}
}
}
š Available Tools
š scan_vault
Performs comprehensive analysis of your Obsidian vault.
Parameters:
vaultPath(required) - Path to your Obsidian vaultmode- Analysis depth:quick,deep, orincremental(default:quick)focus- Analysis focus:health,content,relationships, orall(default:all)
Example:
await mcp.call('scan_vault', {
vaultPath: '/Users/username/Documents/MyVault',
mode: 'deep',
focus: 'all'
});
š” get_insights
Retrieves actionable insights and recommendations.
Parameters:
vaultPath(required) - Path to your vaultcategory- Filter by:orphans,connections,gaps,productivity, orall(default:all)timeframe- Time range:day,week,month, orall(default:all)priority- Priority filter:high,medium,low, orall(default:all)
Example:
await mcp.call('get_insights', {
vaultPath: '/Users/username/Documents/MyVault',
category: 'orphans',
priority: 'high'
});
š track_changes
Monitors vault evolution and activity patterns.
Parameters:
vaultPath(required) - Path to your vaultsince- Start date for analysis (ISO format, optional)granularity- Time resolution:hourly,daily, orweekly(default:daily)
Example:
await mcp.call('track_changes', {
vaultPath: '/Users/username/Documents/MyVault',
since: '2024-01-01',
granularity: 'daily'
});
š generate_report
Creates comprehensive analysis reports.
Parameters:
vaultPath(required) - Path to your vaultformat- Report format:markdown,json, orcsv(default:markdown)sections- Include sections:['overview', 'insights', 'metrics', 'changes']timeframe- Analysis period (optional)
Example:
await mcp.call('generate_report', {
vaultPath: '/Users/username/Documents/MyVault',
format: 'markdown',
sections: ['overview', 'insights', 'metrics']
});
š¾ Data Storage
The system stores analysis data in your home directory:
~/.background-vault-analysis/
āāā vaults.json # Vault registry
āāā snapshots.json # Analysis snapshots
āāā insights.json # Generated insights
āāā changes.json # Change tracking data
Privacy: All data stays local on your machine. No cloud storage or external services.
šÆ Usage Examples
Daily Vault Health Check
// Quick scan for immediate insights
const analysis = await mcp.call('scan_vault', {
vaultPath: '/Users/username/MyVault',
mode: 'quick',
focus: 'health'
});
// Get high-priority recommendations
const insights = await mcp.call('get_insights', {
vaultPath: '/Users/username/MyVault',
priority: 'high'
});
Weekly Progress Review
// Track changes over the past week
const changes = await mcp.call('track_changes', {
vaultPath: '/Users/username/MyVault',
since: '2024-08-01',
granularity: 'daily'
});
// Generate comprehensive report
const report = await mcp.call('generate_report', {
vaultPath: '/Users/username/MyVault',
format: 'markdown'
});
Deep Vault Analysis
// Full analysis with all insights
const analysis = await mcp.call('scan_vault', {
vaultPath: '/Users/username/MyVault',
mode: 'deep',
focus: 'all'
});
// Export data for external analysis
const dataExport = await mcp.call('generate_report', {
vaultPath: '/Users/username/MyVault',
format: 'json'
});
š§ Architecture
Components
- AnalysisDatabase - JSON-based local storage
- VaultAnalyzer - Core scanning and analysis engine
- InsightGenerator - Recommendation and insight creation
- ChangeTracker - File modification monitoring
- ReportGenerator - Multi-format report creation
Design Principles
- Non-invasive - Only reads, never modifies your vault
- Lightweight - Minimal dependencies and fast execution
- Local-first - All data stored locally for privacy
- Extensible - Modular design for easy feature additions
š Sample Output
Analysis Results
š Vault Analysis Complete
Path: /Users/username/MyVault
Mode: quick
Focus: all
Results:
- Notes analyzed: 247
- Links found: 1,156
- Orphans detected: 23
- Analysis time: 145ms
Key Findings:
- Large vault with 247 notes - consider organization strategies
- High linking density (4.7 links/note) - excellent connectivity
- Low orphan rate (9%) - excellent note connectivity
- Found 12 hub notes with 10+ backlinks - great knowledge centers
Insights Example
š” Vault Insights (all | all priority)
Found 3 actionable insights:
**23 Orphaned Notes Found** (medium)
9% of your notes (23 out of 247) have no incoming links, making them difficult to discover.
Action: Review orphaned notes and create connections to related content. Start with recent notes or those with valuable information.
**Knowledge Hub Notes Identified** (low)
You have 12 notes that serve as knowledge hubs with many connections. These are valuable reference points.
Action: Maintain and expand these hub notes. Consider adding overviews, summaries, or organizing them as MOCs (Maps of Content).
**Strong Note Connectivity** (low)
Your notes average 4.7 backlinks each, indicating good interconnectedness.
Action: Continue building connections between ideas. Consider creating overview notes that link to clusters of related content.
š¤ Contributing
This is a focused, lightweight tool designed for personal knowledge management. The codebase is well-structured and documented for easy understanding and modification.
Development Setup
npm install
npm run build
npm run test # Run the test suite
npm run dev # Build and run in development mode
Code Structure
src/
āāā analysis/ # Core analysis components
ā āāā vault-analyzer.ts
ā āāā change-tracker.ts
āāā database/ # Data storage
ā āāā analysis-db.ts
āāā insights/ # Insight generation and reporting
ā āāā insight-generator.ts
ā āāā report-generator.ts
āāā index.ts # Main MCP server
āāā types.ts # TypeScript definitions
āāā test.ts # Test suite
š License
MIT License - Use freely for personal and commercial projects.
š Related Projects
- Obsidian - The knowledge management application
- Model Context Protocol - The underlying communication protocol
- Brain Manager - Comprehensive project and knowledge management system
Built with ā¤ļø for the Obsidian community
Helping you understand and improve your knowledge management practices through intelligent analysis.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.