Skip to main content

MCP server to work with Obsidian via the remote REST plugin

Project description

# MCP Obsidian Server

An [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server that allows LLMs to interact with your Obsidian vault via the [Local REST API](https://github.com/codemirror/obsidian-local-rest-api).

This server enables AI agents (like Claude Desktop) to read, write, search, and analyze your personal knowledge base with built-in stability features like circuit breakers and exponential backoff.

## 🚀 Features

*   **Full File Management**: List, read, create, append, and patch notes.
*   **Powerful Search**: Supports both simple text queries and complex JSON-logic searches.
*   **Vault Analytics**: Tools to calculate link density, identify orphaned notes, and track top tags.
*   **Resilience**: 
    *   **Retry Logic**: Exponential backoff with jitter for transient network errors.
    *   **Circuit Breaker**: Automatically pauses requests if the Obsidian API becomes unreachable to prevent resource exhaustion.
*   **Periodic Notes**: Deep integration for Daily, Weekly, and Monthly notes.

## 📋 Prerequisites

1.  **Obsidian** must be open with the vault you wish to access.
2.  **Local REST API Plugin**:
    *   Install it via Obsidian Community Plugins.
    *   Enable the plugin and toggle "Enable Northbound" if required.
    *   Copy your **API Key** from the plugin settings.
    *   Note your port (default is `27124`).

## 🛠 Installation

### Via Smithery

The easiest way to install this for Claude Desktop is via [Smithery](https://smithery.ai/server/mcp-obsidian):
```bash
npx @smithery/cli install mcp-obsidian --config '{"OBSIDIAN_API_KEY":"your_api_key_here"}'

Manual Installation (Development)

  1. Clone and Install:

    git clone [https://github.com/Sivasindhuja/mcp-server.git](https://github.com/Sivasindhuja/mcp-server.git)
    cd mcp-obsidian
    pip install .
    
  2. Environment Setup: Create a .env file in the root directory:

    OBSIDIAN_API_KEY=your_api_key_here
    OBSIDIAN_HOST=127.0.0.1
    OBSIDIAN_PORT=27124
    OBSIDIAN_PROTOCOL=https
    

🔌 Configuration for Claude Desktop

Add this to your claude_desktop_config.json:

{
  "mcpServers": {
    "obsidian": {
      "command": "mcp-obsidian",
      "env": {
        "OBSIDIAN_API_KEY": "your_api_key_here",
        "OBSIDIAN_HOST": "127.0.0.1"
      }
    }
  }
}

🧰 Available Tools

Tool Description
list_files_in_vault Returns a list of all files in your vault.
get_file_contents Fetches the full text content of a specific note.
simple_search Searches the vault for a specific string.
create_note Creates a new note with specified content.
get_vault_stats Provides statistics on links, tags, and orphaned files.
append_content Adds text to the end of an existing note.
check_connection Diagnostic tool to verify the connection to Obsidian.

🛡️ Safety & Reliability

This server implements a Circuit Breaker pattern. If the connection to Obsidian fails 3 times consecutively, the circuit opens for 10 seconds, immediately rejecting further calls to allow the service to recover. This prevents the LLM from getting stuck in a loop of failed requests.

📝 License

MIT - Developed by Siva Sindhuja

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_obsidian_sindhutsundupalli-0.2.1.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file mcp_obsidian_sindhutsundupalli-0.2.1.tar.gz.

File metadata

File hashes

Hashes for mcp_obsidian_sindhutsundupalli-0.2.1.tar.gz
Algorithm Hash digest
SHA256 c4e44b3c22416e4a6a4efa9e5166240f3261a5591e19dcac93e852bf4f77ff58
MD5 6d1503b697a47d7a006ae97354125517
BLAKE2b-256 ab34cacc0ad09f571d0d6d1239c4a5860f9ae71d0415d21d764628d7bdc1b8e6

See more details on using hashes here.

File details

Details for the file mcp_obsidian_sindhutsundupalli-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_obsidian_sindhutsundupalli-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 da0cc759c4f59e3496ae4a56be23009ec07066e7d202f33520f318460bdbe2d3
MD5 d2a411df31d6b1608b015b7e4a02ae9d
BLAKE2b-256 c542db90bfbe35eaa73a452950b6ebbbd71874d19f884b8b4ef8a8819658335e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page