Skip to main content
Glama

Obsidian MCP Server

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
OBSIDIAN_HOSTNoThe host address for Obsidian Local REST API (usually localhost)127.0.0.1
OBSIDIAN_PORTNoThe port for Obsidian Local REST API (default: 27124)27124
OBSIDIAN_API_KEYYesYour Obsidian Local REST API key

Schema

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Tools

Functions exposed to the LLM to take actions

NameDescription
obsidian_list_files_in_vault

List all files and directories in the vault root.

This tool shows the top-level structure of your Obsidian vault, helping you understand the organization and locate folders for Zettelkasten notes. Returns: str: Formatted list of directories and files in the vault root Example: Returns a markdown-formatted list showing all top-level folders and files.
obsidian_list_files_in_dir

List files and directories in a specific vault directory.

Use this tool to explore the contents of a specific folder, such as your Zettelkasten directory or any other organized section of your vault. Args: params (ListFilesInput): Contains: - dirpath (str): Relative path to directory (empty for root) Returns: str: Formatted list of directories and files in the specified path Example: For dirpath="Zettelkasten", lists all notes in your Zettelkasten folder.
obsidian_get_file_contents

Read the complete contents of a single file from the vault.

Use this to read existing Zettelkasten notes, understand their structure, and find connections for creating new atomic notes. Args: params (GetFileInput): Contains: - filepath (str): Path to file relative to vault root Returns: str: File contents including frontmatter and body Example: For filepath="Zettelkasten/202411061234.md", returns the full note content.
obsidian_batch_get_file_contents

Read multiple files at once, concatenated with headers.

Efficient way to read several related Zettelkasten notes together to understand connections and context before creating new atomic notes. Args: params (BatchGetFilesInput): Contains: - filepaths (List[str]): List of file paths to read (max 20) Returns: str: All file contents concatenated with clear separators Example: Reads multiple related notes to understand a concept network.
obsidian_search

Search vault using powerful JsonLogic queries.

Essential for Zettelkasten workflow: find notes by patterns, content, tags, or complex criteria. Uses JsonLogic for flexible and powerful searches across your vault. Args: params (SearchInput): Contains: - query (Dict): JsonLogic query object Returns: str: List of matching files Common Examples: 1. Find all markdown files: {'glob': ['*.md', {'var': 'path'}]} 2. Search for text in content (case-insensitive): {'in': ['search term', {'lower': [{'var': 'content'}]}]} 3. Find files by name pattern: {'glob': ['*zettel*', {'var': 'path'}]} 4. Combine conditions (files with "system" in content): {'and': [ {'glob': ['*.md', {'var': 'path'}]}, {'in': ['system', {'lower': [{'var': 'content'}]}]} ]} JsonLogic Documentation: https://jsonlogic.com/ Available variables: 'path' (file path), 'content' (file content), 'stat' (file stats)
obsidian_write_note

Create or modify notes with content and optional frontmatter.

Primary tool for Zettelkasten note creation. Supports multiple modes: - CREATE: Only creates new notes (safe, won't overwrite) - OVERWRITE: Replaces entire file - APPEND: Adds content to end - PREPEND: Adds content to beginning Args: params (WriteNoteInput): Contains: - filepath (str): Where to write the note - content (str): Note content - mode (WriteMode): create/overwrite/append/prepend (default: create) - frontmatter (Dict, optional): YAML frontmatter metadata Returns: str: Success message with note location Example: Create atomic note: filepath="Zettelkasten/202411061234 Systems Thinking.md", content="# Systems Thinking...", frontmatter={'tags': ['zettelkasten', 'concepts']}
obsidian_append_content

Append content to the end of an existing file or create new file.

Quick way to add content to notes. Useful for adding new thoughts, references, or connections to existing Zettelkasten notes. Args: params (AppendContentInput): Contains: - filepath (str): Path to file - content (str): Content to append Returns: str: Success message with updated file info Example: Add a new related concept to an existing note.
obsidian_patch_content

Insert content at specific locations within notes using headings, blocks, or frontmatter.

CRITICAL: For heading targets, you MUST provide the FULL HIERARCHICAL PATH. Args: params (PatchContentInput): Contains: - filepath (str): Path to file - target_type (TargetType): 'heading', 'block', or 'frontmatter' - target (str): See examples below for correct format - operation (PatchOperation): 'append', 'prepend', or 'replace' - content (str): Content to insert Returns: str: Success message with patch details HEADING PATH EXAMPLES (MUST use full path with '/'): ✅ CORRECT: - target="Introduction" (for top-level # Introduction) - target="Methods/Data Collection" (for ## Data Collection under # Methods) - target="Results/Analysis/Statistical Tests" (for ### Statistical Tests under ## Analysis under # Results) ❌ WRONG: - target="Data Collection" (missing parent "Methods") - target="Statistical Tests" (missing parents "Results/Analysis") BLOCK REFERENCE EXAMPLE: - target_type="block", target="^unique-block-id" FRONTMATTER EXAMPLE: - target_type="frontmatter", target="tags" Note: Always read the file first to see the exact heading structure before patching.
obsidian_delete_file

Delete a file or directory from the vault.

DESTRUCTIVE OPERATION. Requires explicit confirmation. Use carefully when removing outdated or duplicate notes from your Zettelkasten. Args: params (DeleteFileInput): Contains: - filepath (str): Path to file/directory to delete - confirm (bool): Must be True to proceed with deletion Returns: str: Success or error message Example: Delete a duplicate note after merging content into another note.
obsidian_get_frontmatter

Extract YAML frontmatter metadata from a note.

Read metadata like tags, creation date, and other properties from Zettelkasten notes without loading the full content. Args: params (GetFrontmatterInput): Contains: - filepath (str): Path to file Returns: str: JSON object containing frontmatter fields Example: Get tags and metadata from a note to understand its classification.
obsidian_update_frontmatter

Update YAML frontmatter metadata without modifying note content.

Add or update metadata fields like tags, status, or custom properties in Zettelkasten notes while preserving all content. Args: params (UpdateFrontmatterInput): Contains: - filepath (str): Path to file - updates (Dict): Frontmatter fields to add/update Returns: str: Success message with updated frontmatter Example: Add tags to existing note: updates={'tags': ['zettelkasten', 'systems-thinking']}
obsidian_manage_tags

Add, remove, or list tags in note frontmatter.

Manage tags for organizing Zettelkasten notes. Essential for maintaining topic clusters and enabling efficient retrieval of related atomic notes. Args: params (ManageTagsInput): Contains: - filepath (str): Path to note - action (TagAction): 'add', 'remove', or 'list' - tags (List[str], optional): Tags to add/remove (not needed for 'list') Returns: str: Current tags after operation Example: Add tags: action='add', tags=['systems-thinking', 'mental-models'] Remove tag: action='remove', tags=['draft'] List tags: action='list'
obsidian_get_notes_info

Get metadata for multiple notes including tags, dates, and sizes.

Efficient way to get overview information about several Zettelkasten notes without reading full content. Useful for analyzing note collections. Args: params (GetNotesInfoInput): Contains: - filepaths (List[str]): Paths to files (max 50) Returns: str: JSON array with metadata for each file Example: Get info about all notes in a topic cluster to understand their relationships.

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Shepherd-Creative/obsidian-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server