MCP HubMCP Hub
StevenStavrakis

obsidian-mcp

by: StevenStavrakis

A simple MCP server for Obsidian

221created 22/12/2024
Visit
Obsidian

📌Overview

Purpose: To provide a server that allows AI assistants to interact seamlessly with Obsidian vaults for effective note management.

Overview: The Obsidian MCP Server is built on the Model Context Protocol (MCP), enabling functionalities for reading, creating, editing, and managing notes and tags within Obsidian vaults. It streamlines the integration of AI capabilities into users' note-taking workflows.

Key Features:

  • Read and Search Notes: Efficiently locate and access any notes within the vault, enhancing productivity.

  • Create and Edit Notes: Allows users to create new notes and modify existing ones, facilitating dynamic content management.

  • Tag Management: Users can add, remove, and rename tags, aiding in organized note categorization.

  • Move and Delete Notes: Provides flexibility in managing the organization of notes by moving or deleting as needed.

  • Manage Multiple Vaults: Features tools to list available vaults, supporting users with multiple Obsidian setups.


Obsidian MCP Server

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 backup your Obsidian vault prior to using obsidian-mcp to manage your notes. Use any backup method you prefer, such as git. 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 untested)
  • An Obsidian vault

Installation

Manual Installation

Add to your Claude Desktop configuration file:

  • 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.

Examples:

macOS/Linux:

"/Users/username/Documents/MyVault"

Windows:

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

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

If connection issues occur, check logs at:

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

Installation via Smithery

Warning: Not affiliated with Smithery. Use manual installation if possible.

To install Obsidian MCP 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 (for 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:

  • 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 configuration file syntax
    • Ensure the vault path is absolute and exists
    • Restart Claude Desktop
  2. Permission errors

    • Ensure the vault path is readable and 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