MCP ExplorerExplorer

Obsidian

@StevenStavrakison 2 months ago
377 MIT
FreeCommunity
Knowledge Base
#Obsidian#AI#Notes#Productivity
(by Steven Stavrakis) An MCP server for Obsidian.md with tools for searching, reading, writing, and organizing notes.

Overview

What is Obsidian

The Obsidian MCP Server is a tool designed for AI assistants to interact with Obsidian vaults through the Model Context Protocol (MCP). It facilitates various operations like reading, creating, and managing notes and tags within an Obsidian vault.

Use cases

Users can utilize the server to enhance their note-taking experience by automating the management of notes, conducting searches, and organizing tags. This is particularly useful for anyone looking to streamline their workflow in Obsidian or integrate AI assistance into their note-taking practices.

How to use

To use the Obsidian MCP Server, users must configure their Claude Desktop application by adding the server configuration with the path to their Obsidian vault. After installation, users can perform actions like reading and editing notes through commands, and they can also manage tags within their vault.

Key features

Key features include reading and searching notes, creating and editing existing notes, managing the organization of notes and directories, and handling tags (adding, removing, and renaming). It also supports searching vault contents efficiently.

Where to use

This server is to be used with the Claude Desktop application, specifically tailored for users with an Obsidian vault. It is suitable for those who want to automate and enhance their note management process within the Obsidian environment.

Content

Obsidian MCP Server

smithery badge

An MCP (Model Context Protocol) server that enables AI assistants to interact with Obsidian vaults, providing tools for reading, creating, editing and managing notes and tags.

Warning!!!

This MCP has read and write access (if you allow it). Please. PLEASE backup your Obsidian vault prior to using obsidian-mcp to manage your notes. I recommend using git, but any backup method will work. These tools have been tested, but not thoroughly, and this MCP is in active development.

Features

  • Read and search notes in your vault
  • Create new notes and directories
  • Edit existing notes
  • Move and delete notes
  • Manage tags (add, remove, rename)
  • Search vault contents

Requirements

  • Node.js 20 or higher (might work on lower, but I haven’t tested it)
  • An Obsidian vault

Install

Installing Manually

Add to your Claude Desktop configuration:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "obsidian": {
      "command": "npx",
      "args": [
        "-y",
        "obsidian-mcp",
        "/path/to/your/vault",
        "/path/to/your/vault2"
      ]
    }
  }
}

Replace /path/to/your/vault with the absolute path to your Obsidian vault. For example:

MacOS/Linux:

"/Users/username/Documents/MyVault"

Windows:

"C:\\Users\\username\\Documents\\MyVault"

Restart Claude for Desktop after saving the configuration. You should see the hammer icon appear, indicating the server is connected.

If you have connection issues, check the logs at:

  • MacOS: ~/Library/Logs/Claude/mcp*.log
  • Windows: %APPDATA%\Claude\logs\mcp*.log

Installing via Smithery

Warning: I am not affiliated with Smithery. I have not tested using it and encourage users to install manually if they can.

To install Obsidian for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install obsidian-mcp --client claude

Development

# Clone the repository
git clone https://github.com/StevenStavrakis/obsidian-mcp
cd obsidian-mcp

# Install dependencies
npm install

# Build
npm run build

Then add to your Claude Desktop configuration:

{
  "mcpServers": {
    "obsidian": {
      "command": "node",
      "args": [
        "<absolute-path-to-obsidian-mcp>/build/main.js",
        "/path/to/your/vault",
        "/path/to/your/vault2"
      ]
    }
  }
}

Available Tools

  • read-note - Read the contents of a note
  • create-note - Create a new note
  • edit-note - Edit an existing note
  • delete-note - Delete a note
  • move-note - Move a note to a different location
  • create-directory - Create a new directory
  • search-vault - Search notes in the vault
  • add-tags - Add tags to a note
  • remove-tags - Remove tags from a note
  • rename-tag - Rename a tag across all notes
  • manage-tags - List and organize tags
  • list-available-vaults - List all available vaults (helps with multi-vault setups)

Documentation

Additional documentation can be found in the docs directory:

  • creating-tools.md - Guide for creating new tools
  • tool-examples.md - Examples of using the available tools

Security

This server requires access to your Obsidian vault directory. When configuring the server, make sure to:

  • Only provide access to your intended vault directory
  • Review tool actions before approving them

Troubleshooting

Common issues:

  1. Server not showing up in Claude Desktop

    • Verify your configuration file syntax
    • Make sure the vault path is absolute and exists
    • Restart Claude Desktop
  2. Permission errors

    • Ensure the vault path is readable/writable
    • Check file permissions in your vault
  3. Tool execution failures

    • Check Claude Desktop logs at:
      • macOS: ~/Library/Logs/Claude/mcp*.log
      • Windows: %APPDATA%\Claude\logs\mcp*.log

License

MIT

Tools

create-note
Create a new note in the specified vault with markdown content. Examples: - Root note: { "vault": "vault1", "filename": "note.md" } - Subfolder note: { "vault": "vault2", "filename": "note.md", "folder": "journal/2024" } - INCORRECT: { "filename": "journal/2024/note.md" } (don't put path in filename)
list-available-vaults
Lists all available vaults that can be used with other tools
edit-note
Edit an existing note in the specified vault. There is a limited and discrete list of supported operations: - append: Appends content to the end of the note - prepend: Prepends content to the beginning of the note - replace: Replaces the entire content of the note Examples: - Root note: { "vault": "vault1", "filename": "note.md", "operation": "append", "content": "new content" } - Subfolder note: { "vault": "vault2", "filename": "note.md", "folder": "journal/2024", "operation": "append", "content": "new content" } - INCORRECT: { "filename": "journal/2024/note.md" } (don't put path in filename)
search-vault
Search for specific content within vault notes (NOT for listing available vaults - use the list-vaults prompt for that). This tool searches through note contents and filenames for specific text or tags: - Content search: { "vault": "vault1", "query": "hello world", "searchType": "content" } - Filename search: { "vault": "vault2", "query": "meeting-notes", "searchType": "filename" } - Search both: { "vault": "vault1", "query": "project", "searchType": "both" } - Tag search: { "vault": "vault2", "query": "tag:status/active" } - Search in subfolder: { "vault": "vault1", "query": "hello", "path": "journal/2024" } Note: To get a list of available vaults, use the list-vaults prompt instead of this search tool.
move-note
Move/rename a note while preserving links
create-directory
Create a new directory in the specified vault
delete-note
Delete a note, moving it to .trash by default or permanently deleting if specified
add-tags
Add tags to notes in frontmatter and/or content. Examples: - Add to both locations: { "files": ["note.md"], "tags": ["status/active"] } - Add to frontmatter only: { "files": ["note.md"], "tags": ["project/docs"], "location": "frontmatter" } - Add to start of content: { "files": ["note.md"], "tags": ["type/meeting"], "location": "content", "position": "start" }
remove-tags
Remove tags from notes in frontmatter and/or content. Examples: - Simple: { "files": ["note.md"], "tags": ["project", "status"] } - With hierarchy: { "files": ["note.md"], "tags": ["work/active", "priority/high"] } - With options: { "files": ["note.md"], "tags": ["status"], "options": { "location": "frontmatter" } } - Pattern matching: { "files": ["note.md"], "options": { "patterns": ["status/*"] } } - INCORRECT: { "tags": ["#project"] } (don't include # symbol)
rename-tag
Safely renames tags throughout the vault while preserving hierarchies. Examples: - Simple rename: { "oldTag": "project", "newTag": "projects" } - Rename with hierarchy: { "oldTag": "work/active", "newTag": "projects/current" } - With options: { "oldTag": "status", "newTag": "state", "normalize": true, "createBackup": true } - INCORRECT: { "oldTag": "#project" } (don't include # symbol)
read-note
Read the content of an existing note in the vault. Examples: - Root note: { "vault": "vault1", "filename": "note.md" } - Subfolder note: { "vault": "vault1", "filename": "note.md", "folder": "journal/2024" } - INCORRECT: { "filename": "journal/2024/note.md" } (don't put path in filename)

Comments

Recommend MCP Servers

View All MCP Servers