Rust Mcp
VAULT
Fromsko

Rust Mcp

High-performance MCP server that gives AI agents structured, read/write access to an Obsidian vault via fast Rust tooling.

Obsidian Rust MCP

δΈ­ζ–‡ζ–‡ζ‘£

A high-performance MCP (Model Context Protocol) server for Obsidian knowledge base management, built with Rust.

Features

  • πŸ“‚ File Tree Indexing - Get complete vault structure and tag overview
  • πŸ” Smart Search - Query notes by tags, exact name, or fuzzy keyword matching
  • πŸ“ Note Management - Read, write, and delete notes with automatic frontmatter generation
  • πŸ”„ Append or Overwrite - Choose between append mode (default) or overwrite mode for existing files
  • πŸ“ Subdirectory Support - Organize notes in nested directories (e.g., projects/easytier, journal/2026-03)
  • πŸ›‘οΈ Input Validation - Directory whitelist, filename sanitization, path traversal protection
  • 🏷️ Tag System - Organize notes with tags and aliases
  • ⚑ High Performance - Built with Rust for speed and reliability

Installation

cargo build --release

Migration (v0.3 breaking change)

The MCP surface exposes only help and executeCommand. Legacy flat tools are removed:

Legacy toolv0.3 replacement
write_note_tipsexecuteCommand β†’ obsidian.guide
query_noteexecuteCommand β†’ obsidian.search
write_noteexecuteCommand β†’ obsidian.write
read_noteexecuteCommand β†’ obsidian.read
note_index_treeexecuteCommand β†’ obsidian.index
delete_noteexecuteCommand β†’ obsidian.delete

Usage (CLI model β€” v0.3)

The MCP server exposes only two tools to save client tokens:

ToolPurpose
helpCommand manual (short catalog or detailed usage)
executeCommandRun a registered obsidian.* command

Typical flow: help β†’ obsidian.guide β†’ obsidian.search β†’ obsidian.write

help

{}
{ "topic": "obsidian.write", "detail": true }

executeCommand

{
  "command": "obsidian.search",
  "args": { "tags": ["docker"], "keyword": "nginx" }
}
{
  "command": "obsidian.write",
  "args": {
    "directory": "tech",
    "filename": "nginx-guide",
    "tags": ["nginx"],
    "aliases": ["Nginx Guide"],
    "status": "active",
    "content": "markdown body",
    "append": true
  }
}

Registered commands (obsidian.*)

CommandDescription
obsidian.guideVault writing guidelines (call before first write)
obsidian.searchSearch by tags / keyword / exact name (include_index optional)
obsidian.writeCreate or append note (append default true)
obsidian.readRead note by path (advanced)
obsidian.indexFull file tree + tag stats (advanced)
obsidian.deleteDelete note (see help with detail)

See docs/arch.md for architecture and docs/todo.md for roadmap.

Configuration

Option 1: Environment Variable (Recommended)

Set the OBSIDIAN_VAULT_ROOT environment variable to point to your Obsidian vault:

# Linux/macOS
export OBSIDIAN_VAULT_ROOT="/path/to/your/vault"

# Windows (cmd)
set OBSIDIAN_VAULT_ROOT=D:\notes\Fromsko

# Windows (PowerShell)
$env:OBSIDIAN_VAULT_ROOT="D:\notes\Fromsko"

Option 2: Hardcoded Path

Edit the VAULT_ROOT constant in src/config.rs:

pub const VAULT_ROOT: &str = r"D:\notes\Fromsko";

Option 3: MCP Client Configuration (Recommended for MCP clients)

Configure the vault path directly in your MCP client configuration:

{
  "fromsko-note": {
    "command": "/path/to/obsidian-mcp",
    "disabled": false,
    "env": {
      "OBSIDIAN_VAULT_ROOT": "/path/to/your/vault"
    }
  }
}

Replace /path/to/obsidian-mcp with the actual path to your compiled binary, and /path/to/your/vault with your Obsidian vault path.

Note: This is the recommended approach when using this MCP server with clients like Claude Desktop, Cursor, or other MCP-compatible tools.

Configuration

VariableDescription
OBSIDIAN_VAULT_ROOTVault root directory (default .)
OBSIDIAN_CONFIGPath to JSON config file
OBSIDIAN_VALID_DIRSComma-separated top-level directory whitelist
OBSIDIAN_VAULT_BACKENDlocal or cloud
OBSIDIAN_CLOUD_URLCloud API base URL (sync on write/delete)

See docs/obsidian-mcp.example.json and docs/STRUCTURE.md.

Valid Directories

Default top-level directories (override via config):

Notes can be organized in the following top-level directories (nested subdirectories supported at any depth):

  • tech - Technical notes
  • ai - AI/ML related notes
  • projects - Project documentation
  • methods - Methodologies and processes
  • career - Career development
  • ideas - Ideas and brainstorming
  • cheatsheet - Quick reference guides
  • journal - Daily journals

Project Structure

See docs/STRUCTURE.md for the full layout. Summary:

src/
  config/       # AppConfig (env + JSON)
  validation/   # Path/directory rules
  vault/        # LocalVault + CloudVault
  note/         # frontmatter, index, semantic search
  service/      # ObsidianService
  command/      # registry, help, dispatch
  mcp/          # MCP: help + executeCommand
docs/
  arch.md, STRUCTURE.md, write-note-tips.md
tests/
  service_integration.rs, mcp_stdio.rs, registry.rs

Testing

cargo test   # unit + integration + MCP stdio

Screenshots

Agent Integration

Agent Integration

Note Example

Note Example

License

MIT - see LICENSE file for details.

Related

How to Install

  1. Download the ZIP or clone the repository
  2. Open the folder as a vault in Obsidian (File β†’ Open Vault)
  3. Obsidian will prompt you to install required plugins

Stats

Stars

2

Forks

0

License

MIT

Last updated 7d ago

Categories

Tags

high-performancemcp