Expand description
§TurboVault Server
Main server implementation and CLI for the Model Context Protocol (MCP) Obsidian vault manager.
TurboVault provides a production-grade MCP server that transforms Obsidian vaults into intelligent knowledge systems for AI agents. It offers advanced editing, search, graph analysis, and batch operations.
§Features
- MCP Server Framework: Full Model Context Protocol implementation
- Vault Management: File operations, watching, and atomic changesets
- Advanced Search: Full-text search with Tantivy
- Graph Analysis: Link relationships, backlinks, and health analysis
- Batch Operations: Validated, sequential fail-fast file operations
- Multiple Transports: Stdio (default), HTTP, WebSocket, TCP, Unix sockets
- Export & Reporting: JSON/CSV export for analysis results
§Architecture
The crate is organized into several modules:
tools- MCP tool implementations for vault operations- Re-exports from
turbovault_core- Core types and models - Re-exports from
turbovault_tools- Tool framework and utilities
§Quick Start
use turbovault_core::ServerConfig;
use turbovault_vault::VaultManager;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Initialize vault configuration
let config = ServerConfig::default();
// Create vault manager
let _manager = VaultManager::new(config)?;
Ok(())
}§Transport Features
By default, the server uses stdio transport (suitable for Claude Desktop). Optional transports can be enabled via Cargo features:
stdio- Standard input/output (always included)http- HTTP server supportwebsocket- WebSocket supporttcp- TCP socket supportunix- Unix domain socket supportfull- All transports combined
§Documentation
See the main modules for detailed API documentation:
tools- Tool implementationsturbovault_core- Core types and error handling (see https://docs.rs/turbovault-core)turbovault_tools- MCP tools framework (see https://docs.rs/turbovault-tools)turbovault_vault- Vault operations (see https://docs.rs/turbovault-vault)turbovault_parser- Markdown parsing (see https://docs.rs/turbovault-parser)turbovault_graph- Graph analysis (see https://docs.rs/turbovault-graph)turbovault_batch- Batch operations (see https://docs.rs/turbovault-batch)
Re-exports§
pub use tools::ObsidianMcpServer;
Modules§
- analysis_
tools - Vault analysis tools for statistics and relationship analysis
- audit_
tools - Audit trail tools for querying operation history and managing rollbacks
- batch_
tools - Batch operation tools for coordinated multi-file operations
- cli
- TurboVault command-line parsing and runtime orchestration.
- diff_
tools - Note diff tools for comparing vault notes
- duplicate_
tools - Duplicate and near-duplicate note detection
- export_
tools - Export tools for vault analysis data
- file_
tools - File operation tools for the Obsidian MCP server
- git_
file_ tools - Git-backed write tools (GWS.12).
- graph_
tools - Graph operations and link analysis tools
- grounding
- Grounding primitives — data an external LLM judge consumes.
- metadata_
tools - Metadata query tools for finding and extracting file metadata
- okf_
tools - Open Knowledge Format (OKF) tools.
- output_
formatter - Output formatting for different transport types
- quality_
tools - Content quality evaluation tools
- reindex
- Lazy GSU (Graph + Search Update) queue + apply (GWS.14).
- relationship_
tools - Relationship analysis tools for link strength, suggestions, and centrality
- resources
- Static resource documentation embedded directly in code. These resources are served via MCP resources and tool endpoints.
- response_
utils - Response utilities for Phase 2 LLMX enhancements
- search_
engine - Full-text search engine powered by tantivy
- search_
tools - Search and relationship discovery tools
- similarity_
engine - TF-IDF cosine similarity engine for semantic note search
- sql_
engine - Re-export of
turbovault_sqltypes for convenience. - templates
- Template system for LLM-managed vault notes
- tool_
visibility - tools
- MCP tool implementations for Obsidian vault
- validation_
tools - Content validation tools
- vault_
lifecycle - Vault lifecycle management tools
- viewer
- Self-contained HTML visualization of a vault’s concept graph.
- wikilink_
rewriter - Wikilink rewriter for atomic move_note + delete_note (turbovault-lqr / oz6).
- write_
tools - Backend-dispatching write surface (GWS.12).
Structs§
- Analysis
Tools - Analysis tools context
- Audit
Tools - Audit tools for querying and managing the operation audit trail
- Batch
Result - Result of batch execution
- Batch
Tools - Batch operation tools
- Block
- A block in vault content (Obsidian block reference with ^id)
- Broken
Link Info - Simplified broken link for JSON serialization
- Callout
- A callout block in vault content
- Citation
- A citation backing a claim in a concept body (spec §8).
- Commit
Locks - A process-wide registry of per-worktree commit mutexes. Share one
Arcacross everyVaultReposo handles to the same worktree serialize. - Compare
Result - Detailed comparison of two notes
- Composite
Validator - Composite validator that runs multiple validators
- Concept
Conformance - Per-document OKF conformance result (spec §9).
- Content
Validator - Validates file content structure
- Counter
- A lock-free counter metric (monotonically increasing)
- Diff
Result - Result of comparing two notes
- Diff
Summary - Summary statistics for a diff
- Diff
Tools - Diff tools for comparing notes
- Duplicate
Group - A group of near-duplicate notes
- Duplicate
Tools - Duplicate detection tools
- Export
Tools - Export tools for vault analysis and reporting
- Fanout
Info - Stateless handle to an open fan-out scratch worktree — everything needed
to merge OR abandon the fan-out later, without holding a borrowed
FanoutWorktreeacross the wait (e.g. between MCP tool calls). - File
Metadata - File metadata
- File
Tools - File tools context
- Frontmatter
- YAML frontmatter
- Frontmatter
SqlEngine - SQL-based frontmatter query engine backed by GlueSQL.
- Frontmatter
Validator - Validates frontmatter structure and required fields
- Generate
Index Report - Result of an index-generation run.
- Generated
Index - One generated/previewed index file.
- GitFile
Tools - Write-side tools backed by the git substrate.
- Graph
Tools - Graph tools context
- Grounding
Analysis - Per-note grounding analysis — the material a judge scores.
- Grounding
Tools - Grounding analysis over a vault.
- Heading
- A heading in vault content
- Health
Info - Simplified health report for JSON serialization
- Histogram
- A histogram for tracking value distributions
- Line
Index - Pre-computed line starts for O(log n) line/column lookup.
- Link
- A link in vault content
- Link
Validator - Validates link syntax and format
- List
Item - A list item with optional checkbox and nested content.
- Metadata
Tools - Metadata tools for querying and extracting file metadata
- Metrics
Context - Global metrics context registry (rarely used)
- Move
With Links Result - turbovault-lqr: result of an atomic
move_file_with_link_updates. The rename + every link-source rewrite landed as ONE commit. Reports which sources were rewritten so the caller can surface the diff to the user. - Multi
Vault Manager - Multi-vault manager coordinating multiple vaults
- Note
Info - Lightweight note metadata (no content read)
- Oid
- Unique identity of any object (commit, tree, blob, tag).
- OkfConcept
Info - OKF metadata and conformance for a single document.
- OkfTools
- OKF tooling over a vault.
- OkfValidate
Report - Vault-wide OKF conformance report.
- Orphan
Fanout - One fan-out artifact (
wip-<id>worktree +wip/<id>branch) found on disk byVaultRepo::list_orphan_fanouts. Whether a given entry is truly “orphan” — i.e. not tracked by a live caller — is a server-layer concern; the substrate just enumerates. - Quality
Score - Composite quality score for a single note
- Quality
Tools - Quality evaluation tools
- Reindex
Queue - Per-vault queue of commit oids awaiting graph/search reindex.
- Relationship
Tools - Relationship analysis tools
- Response
Formatter - Formatter for converting responses to different formats
- Search
Engine - Search engine for vault discovery (powered by tantivy)
- Search
Query - Advanced search builder for LLMs
- Search
Result Info - Search result metadata for LLM consumption
- Search
Tools - Search tools context
- Server
Config - Global server configuration
- Similarity
Engine - TF-IDF cosine similarity engine
- Similarity
Result - Similarity search result
- Source
Position - Position in source text (line, column, byte offset)
- Tag
- A tag in vault content
- Task
Item - A task item in vault content
- Template
Definition - Complete template definition
- Template
Engine - Template engine for vault
- Template
Field - Template field definition
- Ungrounded
Note - A note that asserts claims without citing any source.
- Ungrounded
Report - Vault-wide ungrounded-note report.
- Validation
Issue - A validation issue found in content
- Validation
Report - Result of validating content
- Validation
Report Info - Simplified validation report for JSON serialization
- Validation
Tools - Validation tools context
- Vault
Config - Configuration for a single vault
- Vault
File - A complete vault file with parsed content
- Vault
Info - Information about a registered vault
- Vault
Lifecycle Tools - Vault lifecycle operations
- Vault
Quality Report - Vault-wide quality report
- Vault
Repo - A handle to the git repository backing a vault.
- Vault
Stats - Statistics response structure
- Viewer
Tools - Builds HTML visualizations of a vault.
- Visualization
Result - Summary returned to the caller after generating a visualization.
Enums§
- Batch
Operation - Individual batch operation to execute
- Callout
Type - Type of callout block
- Config
Profile - Profile selector for pre-configured deployments
- Content
Block - A parsed content block in a markdown document.
- Error
- The core error type for all Obsidian operations.
- GitMerge
Strategy - How a fan-out merges back into main.
- Inline
Element - An inline element within a block.
- Link
Type - Type of link in Obsidian content
- Output
Format - Output format preference for HTTP/WebSocket/TCP transports
- Reserved
File - A reserved OKF filename with defined meaning at any level of the hierarchy.
- Severity
- Severity level for validation issues
- Table
Alignment - Table column alignment.
- Template
Field Type - Field types for template parameters
- Write
Mode - Write mode for write_file operations
- Write
Tools - Per-vault write surface. One dispatch site per method; the MCP layer is backend-agnostic.
Traits§
- Validator
- Trait for content validators
Functions§
- apply_
commit_ diff - Apply one commit’s diff to the link graph. Reads the working tree for changed/added paths (working-tree == HEAD invariant) and removes deleted paths from the graph.
- check_
concept - Check a single document for OKF v0.1 conformance (§9).
- concept_
id - Compute the OKF concept ID for a document: its path within the bundle
with the
.mdsuffix removed and/separators. - obsidian_
uri - Generate an Obsidian URI for a note
- watch_
ref_ changes - turbovault-bou / architecture §8.4 + §8.5: HEAD-ref polling listener.
Type Aliases§
- Cached
Repo - turbovault-a0l (PERF-1): a per-vault cached substrate handle.
VaultRepowraps agit2::Repositorywhich isSend + !Sync(libgit2 raw pointers), so it lives behind astd::sync::Mutex; theArclets the MCP server cache one handle per vault and hand a clone to eachGitFileTools. Reusing it elides the ~140µsRepository::open(config re-parse + odb/strmap setup) that otherwise fired on every write. TheMutexserializes commit sections exactly whereCommitLocksalready does, so net concurrency is unchanged, and cross-process CAS stays safe (libgit2 re-reads refs underlock_ref— guarded bycas::tests::reused_handle_detects_external_ref_advance_no_lost_update). - CasCollision
Flush - Callback invoked before returning a
ConcurrencyErrorfrom the internalGitFileTools::apply_txnpath (GWS.14b). The MCP server installs one that drains the per-vault reindex queue — so the agent’s re-read (which the error tells it to do) sees a coherent graph + search state, not the pre-conflict snapshot. - Commit
Hook - Callback fired by
VaultRepo::commit_changesetafter a successful commit + materialize, inside the commit lock. Arguments are the commit’s first-parent oid (orNonefor the initial commit on an unborn branch) and the new commit oid. - Result
- Convenient Result type alias