home / mcp / obsidian mcp server

Obsidian MCP Server

Provides an MCP interface to Obsidian via the Local REST API for vault read/write actions and commands.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "fazer-ai-mcp-obsidian": {
      "command": "bunx",
      "args": [
        "@fazer-ai/mcp-obsidian@latest"
      ],
      "env": {
        "OBSIDIAN_HOST": "localhost",
        "OBSIDIAN_PORT": "27123",
        "OBSIDIAN_API_KEY": "your-obsidian-api-key",
        "OBSIDIAN_PROTOCOL": "http"
      }
    }
  }
}

You can run an MCP server that lets Claude or any MCP-compatible LLM interact with your Obsidian vault using Obsidian’s Local REST API. This server translates model requests into vault actions and returns results, enabling automation, summarization, search, and content manipulation inside Obsidian from your MCP client.

How to use

Set up your MCP client to talk to the Obsidian MCP server through a local or remote endpoint. You will authenticate with your Obsidian Local REST API key and then issue commands through the MCP interface. You can perform actions such as retrieving the active note, patching or appending content, listing files, running Obsidian commands, and performing vault-wide searches.

How to install

{
  "mcpServers": {
    "@fazer-ai/mcp-obsidian": {
      "command": "bunx",
      "args": ["@fazer-ai/mcp-obsidian@latest"],
      "env": {
        "OBSIDIAN_API_KEY": "your-obsidian-api-key"
      }
    }
  }
}

Additional setup and usage notes

Environment variables control how the server connects to Obsidian. Use the following example in your environment file or directly in your MCP client configuration.

OBSIDIAN_API_KEY=   # Obtain this from the Obsidian Local REST API settings
OBSIDIAN_PROTOCOL=http
OBSIDIAN_HOST=localhost
OBSIDIAN_PORT=27123   # Port the Local REST API plugin is bound to

Configuration options you will set

Two ways to provide the Obsidian API key to the server exist. You can pass it directly in your MCP client configuration or supply it via an .env file placed in the working directory where the MCP server runs.

// claude_desktop_config.json
{
  "mcpServers": {
    "@fazer-ai/mcp-obsidian": {
      "command": "bunx",
      "args": ["@fazer-ai/mcp-obsidian@latest"],
      "env": {
        "OBSIDIAN_API_KEY": "your-obsidian-api-key"
      }
    }
  }
}

Debugging and development

If you are developing locally, you can run a dev version directly from your source. The MCP server can be started with Bun so you can point to the source entry file.

# Development start example (local source)
bun /path/to/repo/src/index.ts
```
Note: open the MCP Inspector URL to monitor requests and logs in real time.

Security considerations

Keep your Obsidian API key secure. Do not share your key in logs or configuration files that are publicly accessible. Use environment variables to protect sensitive values and restrict access to the MCP server. If you revoke or rotate the API key, update all clients accordingly.

Troubleshooting

If the server cannot reach Obsidian, verify that Obsidian is running with the Local REST API plugin enabled, the API key is valid, and the host/port match what you configured. Use the MCP Inspector tool to observe requests and logs as they flow through the server.

Notes

This MCP server exposes actions such as getting the active note, patching content, posting content, listing vault files, executing Obsidian commands, and performing searches across the vault. You can combine these actions in conversations with your MCP client to automate routine vault tasks.

Available tools

obsidian_status

Returns basic details about the Obsidian Local REST API server and your authentication status

obsidian_delete_active

Deletes the note that is currently active in the Obsidian UI

obsidian_get_active

Retrieves the full content of the active note (Markdown or JSON view)

obsidian_patch_active

Inserts, replaces or prepends content in the active note relative to a heading, block reference, or front-matter field

obsidian_post_active

Appends Markdown to the end of the active note

obsidian_put_active

Replaces the entire body of the active note

obsidian_get_commands

Lists every command available in Obsidian’s command palette

obsidian_execute_command

Executes a specific Obsidian command by its ID

obsidian_open_file

Opens the given file inside Obsidian (creates it if missing); optional flag to open in a new leaf

obsidian_delete_periodic

Deletes the current daily / weekly / monthly / quarterly / yearly note for the requested period

obsidian_get_periodic

Returns the content of the current periodic note for the requested period

obsidian_patch_periodic

Inserts / replaces content in a periodic note relative to a heading, block reference, or front-matter field

obsidian_post_periodic

Appends Markdown to the periodic note (creates it if it doesn’t exist)

obsidian_put_periodic

Replaces the entire body of a periodic note

obsidian_search_dataview

Runs a Dataview-DQL query across the vault and returns matching rows

obsidian_search_json_logic

Runs a JsonLogic query against structured note metadata

obsidian_simple_search

Performs a plain-text fuzzy search with optional surrounding context

obsidian_list_vault_root

Lists all files and directories at the root of your vault

obsidian_list_vault_directory

Lists files and directories inside a specific folder of the vault

obsidian_delete_file

Deletes a specific file (or directory) in the vault

obsidian_get_file

Retrieves the content of a file in the vault (Markdown or JSON view)

obsidian_patch_file

Inserts / replaces content in an arbitrary file relative to a heading, block reference, or front-matter field

obsidian_post_file

Appends Markdown to a file (creates it if it doesn’t exist)

obsidian_put_file

Creates a new file or replaces the entire body of an existing file