Obsidian MCP server

Lightweight server for reading, modifying, searching, and navigating Obsidian notes through the Obsidian Local REST API, enabling granular content manipulation across Markdown files.
Back to servers
Provider
Greg Konush
Release date
Mar 10, 2025
Language
TypeScript
Stats
3 stars

The MCP Obsidian server implements the Model Context Protocol (MCP) to integrate AI assistants with your Obsidian vault. This enables AI assistants to read, create, and manipulate notes directly in Obsidian, providing a seamless experience for content management and knowledge work.

Features

  • Read the active file in Obsidian
  • Delete the active file
  • Insert content at specific positions (headings, block references, frontmatter)
  • Append content to files
  • Open specific files
  • List files in your vault
  • Search through your notes

Prerequisites

Before installing MCP Obsidian, ensure you have:

  • Bun runtime installed
  • Obsidian desktop application
  • An MCP-compatible AI assistant

Installation

  1. Clone the repository:

    git clone https://github.com/gregkonush/mcp-obsidian.git
    cd mcp-obsidian
    
  2. Install dependencies:

    bun install
    
  3. Create and configure the environment file:

    cp .env.example .env
    

Configuration

Edit the .env file with your specific settings:

OBSIDIAN_BASE_URL=http://localhost:27123
OBSIDIAN_TOKEN=your_token_here
DEBUG=false

Setting Up with Add to Cursor

Place your secret in the .env file, then use the MCP command and enter:

bun __REPO_PATH__/src/index.ts

Usage

Start the MCP server with:

bun run src/index.ts

The server will communicate with MCP-compatible AI assistants via standard I/O.

Available Tools

MCP Obsidian provides the following tools for AI assistants:

File Management

  • get_active_file: Retrieves the content of the currently active file
  • delete_active_file: Deletes the currently active file
  • insert_active_file: Modifies content relative to a heading, block reference, or frontmatter field
  • append_active_file: Appends content to the end of the active file
  • open_file: Opens a specific file in Obsidian

Search and Navigation

  • search_simple: Searches for documents matching a text query
  • list_files: Lists files in the root directory of your vault
  • list_directory_files: Lists files in a specific directory of your vault

Example Use Cases

Modifying Content

To append content to the active file:

// The AI would use the append_active_file tool
// with parameters like:
{
  "content": "## New Section\nThis is new content added by the AI assistant."
}

Searching Your Vault

To find notes related to a specific topic:

// The AI would use the search_simple tool
// with parameters like:
{
  "query": "project management"
}

Opening a Specific Note

To navigate to a particular file:

// The AI would use the open_file tool
// with parameters like:
{
  "file": "Projects/2023/Annual Review.md"
}

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later