MCP Vault

MCP Vault

Enables AI assistants to interact with Obsidian vaults through file operations like moving/renaming files and analyzing markdown heading structures. Bridges AI assistants with Obsidian using the Local REST API plugin for seamless vault management.

Category
访问服务器

README

mcp-vault

A Model Context Protocol (MCP) server for interacting with Obsidian vaults. This server provides tools that allow AI assistants to perform operations on your Obsidian vault through the MCP protocol.

Overview

mcp-vault bridges AI assistants (like Claude) with your Obsidian vault, enabling them to:

  • Move and rename files within your vault
  • Extract and analyze markdown heading structures
  • Navigate heading hierarchies with parent chain resolution

The server communicates with Obsidian through the Local REST API plugin for file operations, and directly reads markdown files for heading analysis.

Details

For the move_file functionality, I'm relying on a fork of the plugin (from an open PR) which implements the MOVE functionality. See below:

  • The discussion: https://github.com/coddingtonbear/obsidian-local-rest-api/discussions/190
  • The 'solution' (open PR): https://github.com/coddingtonbear/obsidian-local-rest-api/pull/191
  • The custom impl (base of the PR): https://github.com/mairas/obsidian-local-rest-api/tree/move-only

To properly use this MCP server as a whole (for now), you need to clone, compile and use the 'move-only' branch of the fork. See USAGE for more details.

Note that the heading operations that support mcp-obsidian's patch_content tool work without this custom modification.

Prerequisites

  • Python >=3.13
  • uv for dependency management
  • Obsidian with the Local REST API plugin installed and configured
  • The Local REST API plugin must be running on localhost:27124

Installation

# Clone the repository
git clone https://github.com/phate45/mcp-vault
cd mcp-vault

# Install dependencies
uv sync

Configuration

Example from Claude Code's ~/.claude.json:

	"mcpServers": {
      "mcp-vault": {
        "type": "stdio",
        "command": "uv",
        "args": [
          "run",
          "--directory",
          "/home/user/Projects/mcp-vault",
          "mcp-vault"
        ],
        "env": {
          "VAULT_PATH": "/home/user/Documents/vault/"
        }
      }
    },

Can be added with the claude mcp add as such:

claude mcp add --transport stdio mcp-vault \
    --env VAULT_PATH="/home/user/Documents/vault/"
    -- uv run --directory "/home/user/Projects/mcp-vault" mcp-vault

Available Tools

move_file

Move or rename a file within your vault using the Obsidian Local REST API.

Arguments:

  • from_path (string): Source file path (relative to vault root)
  • to_path (string): Destination file path (relative to vault root)

Usage: If you move vault files around outside of Obsidian, the backlinks won't be properly updated. This calls Obsidian api directly to make sure everything is updated.

list_headings

Extract all markdown headings from a file.

Arguments:

  • file_path (string): Path to the markdown file (relative to vault root)

Returns: List of headings with their levels (e.g., ## Heading Name)

Usage: Enable the agent to quickly skim the file structure without having to read the whole file into context.

nail_heading

Get the full parent chain for a specific heading, useful for creating unambiguous heading references.

Arguments:

  • file_path (string): Path to the markdown file (relative to vault root)
  • heading (string): The heading title to find

Returns: Parent chain in the format Parent::Child::Target (returns just the heading name if it has no parents)

Usage: Create the proper 'target' string for the mcp-obsidian's obsidian_patch_content function.

Development

# Run the server
VAULT_PATH=<path> uv run mcp-vault

However, i would recommend to simply add the server to Claude or Codex and test it 'live' with the model using the MCP tool calls directly. The 'bare' stdio interface isn't very user friendly for direct testing.

Disclaimer

Parts of the project were written by Claude Code. Nothing went into it that i did not personally review, though. The AI was used mostly to provide quick feedback/second pair of eyes, and, of course, for testing the server itself.

Open TODOs

  • [ ] Add more detailed documentation regarding the usage (custom compiled version of the plugin, etc)
  • [ ] Add proper testing (perhaps some github workflows?)
  • [ ] Troubleshooting issues? (suppose i'll wait until someone reports an issue or i run into one myself)
  • [ ] Create a a proper CHANGELOG (in case of continued development)
  • [ ] Badges/screenshots/roadmap/other nice-to-haves

Inspiration

This project wouldn't be possible if several others didn't exist:

  • Claudesidian - The origin of the desire to integrate and automate: https://github.com/heyitsnoah/claudesidian
  • mcp-obsidian - The integration that inspired me to fix what was 'missing': https://github.com/MarkusPfundstein/mcp-obsidian
  • obsidian-local-rest-api plugin - The great enabler: https://github.com/coddingtonbear/obsidian-local-rest-api

License

MIT - Use this however you want. Make it your own.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选