Obsidian 的 MCP 服务器 logo

Obsidian 的 MCP 服务器

CommunityPopular
MarkusPfundstein

MCP server that interacts with Obsidian via the Obsidian rest API community plugin

PublisherMarkusPfundstein
Repositorymcp-obsidian
LanguagePython
Forks
503
Stars
4.4K
Available tools
12
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    Obsidian 的 MCP 服务器 exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 12 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    4.4K stars and 503 forks from the linked repository.

MCP server for Obsidian

MCP server to interact with Obsidian via the Local REST API community plugin.

Components

Tools

The server implements multiple tools to interact with Obsidian:

  • list_files_in_vault: Lists all files and directories in the root directory of your Obsidian vault
  • list_files_in_dir: Lists all files and directories in a specific Obsidian directory
  • get_file_contents: Return the content of a single file in your vault.
  • search: Search for documents matching a specified text query across all files in the vault
  • patch_content: Insert content into an existing note relative to a heading, block reference, or frontmatter field.
  • append_content: Append content to a new or existing file in the vault.
  • delete_file: Delete a file or directory from your vault.

Example prompts

Its good to first instruct Claude to use Obsidian. Then it will always call the tool.

The use prompts like this:

  • Get the contents of the last architecture call note and summarize them
  • Search for all files where Azure CosmosDb is mentioned and quickly explain to me the context in which it is mentioned
  • Summarize the last meeting notes and put them into a new note 'summary meeting.md'. Add an introduction so that I can send it via email.

Requirements

  • Python >= 3.11
  • mcp Python SDK >=1.1.0,<2.0.0 (pinned in pyproject.toml). mcp-obsidian currently registers its tool handlers via the mcp 1.x low-level Server API (@app.list_tools() / @app.call_tool()), which was removed in mcp 2.0. Installing with an unconstrained mcp>=2.0 will crash at import with AttributeError: 'Server' object has no attribute 'list_tools'.

Configuration

Obsidian REST API Key

There are two ways to configure the environment with the Obsidian REST API Key.

  1. Add to server config (preferred)
json
{
  "mcp-obsidian": {
    "command": "uvx",
    "args": [
      "mcp-obsidian"
    ],
    "env": {
      "OBSIDIAN_API_KEY": "<your_api_key_here>",
      "OBSIDIAN_HOST": "<your_obsidian_host>",
      "OBSIDIAN_PORT": "<your_obsidian_port>"
    }
  }
}

Sometimes Claude has issues detecting the location of uv / uvx. You can use which uvx to find and paste the full path in above config in such cases.

  1. Create a .env file in the working directory with the following required variables:
OBSIDIAN_API_KEY=your_api_key_here
OBSIDIAN_HOST=your_obsidian_host
OBSIDIAN_PORT=your_obsidian_port

Note:

  • You can find the API key in the Obsidian plugin config
  • Default port is 27124 if not specified
  • Default host is 127.0.0.1 if not specified

Quickstart

Install

Obsidian REST API

You need the Obsidian REST API community plugin running: https://github.com/coddingtonbear/obsidian-local-rest-api

Install and enable it in the settings and copy the api key.

Claude Desktop

On MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json

On Windows: %APPDATA%/Claude/claude_desktop_config.json

json
{
  "mcpServers": {
    "mcp-obsidian": {
      "command": "uv",
      "args": [
        "--directory",
        "<dir_to>/mcp-obsidian",
        "run",
        "mcp-obsidian"
      ],
      "env": {
        "OBSIDIAN_API_KEY": "<your_api_key_here>",
        "OBSIDIAN_HOST": "<your_obsidian_host>",
        "OBSIDIAN_PORT": "<your_obsidian_port>"
      }
    }
  }
}
json
{
  "mcpServers": {
    "mcp-obsidian": {
      "command": "uvx",
      "args": [
        "mcp-obsidian"
      ],
      "env": {
        "OBSIDIAN_API_KEY": "<YOUR_OBSIDIAN_API_KEY>",
        "OBSIDIAN_HOST": "<your_obsidian_host>",
        "OBSIDIAN_PORT": "<your_obsidian_port>"
      }
    }
  }
}

Docker

You can run the server in a container instead of installing uv/Python locally.

  1. Copy .env.example to .env and fill in your Obsidian REST API key:
bash
cp .env.example .env

By default OBSIDIAN_HOST is set to host.docker.internal, which resolves to your host machine from inside the container (works on Linux, Mac and Windows).

  1. Build the image:
bash
docker compose build
  1. Point your MCP client at the container. Since MCP speaks JSON-RPC over stdio, the client must run it with stdin attached and no pseudo-TTY — use docker compose run --rm -T, not docker compose up:
json
{
  "mcpServers": {
    "mcp-obsidian": {
      "command": "docker",
      "args": [
        "compose",
        "-f",
        "<dir_to>/mcp-obsidian/docker-compose.yml",
        "run",
        "--rm",
        "-T",
        "mcp-obsidian"
      ]
    }
  }
}

You can also run it manually to sanity-check the container starts:

bash
docker compose run --rm -T mcp-obsidian

(it will sit waiting for a JSON-RPC message on stdin; Ctrl+C to exit)

Development

Building

To prepare the package for distribution:

  1. Sync dependencies and update lockfile:
bash
uv sync

Debugging

Since MCP servers run over stdio, debugging can be challenging. For the best debugging experience, we strongly recommend using the MCP Inspector.

You can launch the MCP Inspector via npm with this command:

bash
npx @modelcontextprotocol/inspector uv --directory /path/to/mcp-obsidian run mcp-obsidian

Upon launching, the Inspector will display a URL that you can access in your browser to begin debugging.

You can also watch the server logs with this command:

bash
tail -n 20 -f ~/Library/Logs/Claude/mcp-server-mcp-obsidian.log

Installation

TypingMind
{
  "mcpServers": {
    "mcp-obsidian": {
      "command": "uvx",
      "args": [
        "mcp-obsidian"
      ],
      "env": {
        "OBSIDIAN_API_KEY": "<OBSIDIAN_API_KEY>"
      }
    }
  }
}

Available Tools

  • obsidian_list_files_in_dir

    Lists all files and directories that exist in a specific Obsidian directory.

  • obsidian_list_files_in_vault

    Lists all files and directories in the root directory of your Obsidian vault.

  • obsidian_get_file_contents

    Return the content of a single file in your vault.

  • obsidian_simple_search

    Simple search for documents matching a specified text query across all files in the vault. Use this tool when you want to do a simple text search

  • obsidian_patch_content

    Insert content into an existing note relative to a heading, block reference, or frontmatter field.

  • obsidian_append_content

    Append content to a new or existing file in the vault.

  • obsidian_delete_file

    Delete a file or directory from the vault.

  • obsidian_complex_search

    Complex search for documents using a JsonLogic query. Supports standard JsonLogic operators plus 'glob' and 'regexp' for pattern matching. Results must be non-falsy.

           Use this tool when you want to do a complex search, e.g. for all documents with certain tags etc.
    
  • obsidian_batch_get_file_contents

    Return the contents of multiple files in your vault, concatenated with headers.

  • obsidian_get_periodic_note

    Get current periodic note for the specified period.

  • obsidian_get_recent_periodic_notes

    Get most recent periodic notes for the specified period type.

  • obsidian_get_recent_changes

    Get recently modified files in the vault.

Use Obsidian 的 MCP 服务器 MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Obsidian 的 MCP 服务器 is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add Obsidian 的 MCP 服务器 as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the Obsidian 的 MCP 服务器 MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "mcp-obsidian": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Obsidian 的 MCP 服务器 MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the Obsidian 的 MCP 服务器 MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Obsidian 的 MCP 服务器 to help me with this task?
Obsidian 的 MCP 服务器
Sure. I read it.
Here is what I found using Obsidian 的 MCP 服务器.

Frequently asked questions

What is the Obsidian 的 MCP 服务器 MCP server used for?

Obsidian 的 MCP 服务器 is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Obsidian 的 MCP 服务器 MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Obsidian 的 MCP 服务器 with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Obsidian 的 MCP 服务器 MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Obsidian 的 MCP 服务器 connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Obsidian 的 MCP 服务器 MCP to TypingMind?

Obsidian 的 MCP 服务器 runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does Obsidian 的 MCP 服务器 MCP provide in TypingMind?

Obsidian 的 MCP 服务器 exposes 12 MCP tools that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Obsidian 的 MCP 服务器 MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Obsidian 的 MCP 服务器 requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇