obsidian-mcp

obsidian-mcp

Enables reading, writing, searching, and managing an Obsidian vault through Claude, operating directly on markdown files via Node.js fs without requiring the Obsidian app.

Category
访问服务器

README

Obsidian MCP Server

License: MIT

An MCP (Model Context Protocol) server that exposes your Obsidian vault as tools for Claude. This lets any Claude session — Claude Code, Claude Desktop, claude -p scripts — read, write, search, and manage your vault.

It operates directly on vault files via Node.js fs — no Obsidian app, CLI, or plugins required. An Obsidian vault is just a folder of markdown files, and this server works with that directly.

Prerequisites

  • Node.js 18+
  • An Obsidian-compatible vault (any folder of markdown files)

Install

git clone <this-repo>
cd obsidian-mcp-server
npm install
npm run build

This compiles TypeScript from src/ into build/.

Configure

Claude Code

Register the server globally so every Claude Code session has vault access:

claude mcp add --transport stdio -s user obsidian \
  -e OBSIDIAN_VAULT="/path/to/your/vault" \
  -- node /path/to/obsidian-mcp-server/build/index.js

This writes to ~/.claude.json:

{
  "mcpServers": {
    "obsidian": {
      "type": "stdio",
      "command": "node",
      "args": ["/path/to/obsidian-mcp-server/build/index.js"],
      "env": {
        "OBSIDIAN_VAULT": "/path/to/your/vault"
      }
    }
  }
}
  • OBSIDIAN_VAULT — path to your vault folder. If not set, the server looks for vaults in Obsidian's config (~/.config/obsidian/obsidian.json on Linux, ~/Library/Application Support/obsidian/obsidian.json on macOS).

To verify it's working, start Claude Code in any project and look for the obsidian tools (they'll appear as MCP tools like vault_read, vault_search, etc.).

To remove:

claude mcp remove -s user obsidian

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "obsidian": {
      "command": "node",
      "args": ["/path/to/obsidian-mcp-server/build/index.js"],
      "env": {
        "OBSIDIAN_VAULT": "/path/to/your/vault"
      }
    }
  }
}

Create the file if it doesn't exist. Restart Claude Desktop after editing.

Tools

16 tools are available. All accept an optional vault parameter for multi-vault setups. If omitted, the default vault is used (set via OBSIDIAN_VAULT env var).

Read

Tool Description
vault_read Read a note by name (file) or exact path (path)
vault_daily_read Read today's daily note
vault_search Full-text search across the vault. Set context: true for matching line context
vault_files List all files, optionally filtered by folder
vault_tags List all tags (sorted by count), or look up a specific tag by name
vault_tasks List tasks. Filter by status (todo/done) and daily (today only)
vault_links List outgoing links from a note
vault_backlinks List notes that link to a given note
vault_properties Read YAML frontmatter properties, or a specific property by name

Write

Tool Description
vault_create Create a new note. Supports content, template, and overwrite
vault_append Append content to an existing note
vault_daily_append Append content to today's daily note
vault_property_set Set a YAML frontmatter property. Supports type (text, list, number, etc.)
vault_move Move or rename a note
vault_attachment Write a binary file (image, PDF, etc.) into the vault. Returns embed syntax ![[filename]]

Vault

Tool Description
vault_list List all known Obsidian vaults

Skills

The MCP server gives Claude the raw tools, but tools alone don't tell Claude when to use them, what vault conventions to follow, or how to structure notes. Skills provide that context.

MCP Skills (skills/) — portable, for any project

These skills are written to use the MCP tools (vault_read, vault_create, etc.). Copy them into any project where you want Claude to interact with your vault.

Skill Command What it does
capture /capture <thought> Quick-capture a thought to today's daily note with timestamp
log /log <text> Append a minimal timestamped entry to the daily note
note /note <title> Create a new structured note with frontmatter and tags
today /today Overview of the day — daily note, tasks, recent activity
find /find <query> Deep search — text, tags, links, backlinks, synthesis
review /review [day|week|month] Review accomplishments and outstanding items
standup /standup Yesterday / Today / Blockers standup format
tidy /tidy <note> Clean up a raw or voice-transcribed note

How to add skills to a project

Copy the skills you want from this repo's skills/ directory into the target project's .claude/skills/:

# Copy all vault skills to another project
cp -r /path/to/obsidian-mcp-server/skills/* /path/to/myproject/.claude/skills/

# Or copy only specific skills
mkdir -p /path/to/myproject/.claude/skills/capture
cp /path/to/obsidian-mcp-server/skills/capture/SKILL.md /path/to/myproject/.claude/skills/capture/

mkdir -p /path/to/myproject/.claude/skills/today
cp /path/to/obsidian-mcp-server/skills/today/SKILL.md /path/to/myproject/.claude/skills/today/

After copying, start Claude Code in that project and the skills will appear as /capture, /today, etc.

Choosing what to copy

You don't need all skills in every project. Pick what's relevant:

  • Minimal — just capture and today for quick vault interaction
  • Standard — add note, find, log for full read/write
  • Full — all 8 skills for complete vault management from any project

Attachments

The vault_attachment tool handles binary files (images, PDFs, receipts, etc.) by writing them directly to the vault's filesystem. Obsidian's file watcher picks them up automatically.

Parameters:

  • name — filename with extension (e.g. receipt-2026-03-02.png)
  • data — base64-encoded file contents
  • folder — subfolder within vault (default: attachments)

Example workflow (e.g. from a Telegram bot):

  1. User sends a photo of a receipt with "Add this to expenses"
  2. Claude calls vault_attachment with the base64-encoded image → returns receipt.png
  3. Claude calls vault_append on an Expenses note with ![[receipt.png]] to embed it

If a file with the same name already exists, a timestamp is appended to avoid overwriting. Max file size is 10 MB.

Multi-Vault

The server defaults to the vault specified by OBSIDIAN_VAULT env var. If unset, it reads Obsidian's config file to discover known vaults. To target a different vault per-call, pass the vault parameter:

vault_read(file="My Note", vault="Work Vault")

Development

npm run dev     # Watch mode — recompiles on save
npm run build   # One-time build

The server uses stdio transport (JSON-RPC over stdin/stdout). console.error() is used for logging — never console.log(), which would corrupt the protocol.

Project Structure

├── src/
│   ├── index.ts              # Server entry point — McpServer + stdio transport
│   ├── tools.ts              # 15 MCP tool definitions with Zod schemas
│   └── obsidian.ts           # Vault engine — direct filesystem operations
├── build/                    # Compiled JS (generated by npm run build)
├── skills/                   # MCP skills — copy these into other projects
│   ├── capture/SKILL.md
│   ├── find/SKILL.md
│   ├── log/SKILL.md
│   ├── note/SKILL.md
│   ├── review/SKILL.md
│   ├── standup/SKILL.md
│   ├── tidy/SKILL.md
│   └── today/SKILL.md
├── package.json
└── tsconfig.json

Troubleshooting

Tools not appearing in Claude Code: Run claude mcp list to verify the server is registered. Check that the build path is correct.

Skills not appearing: Make sure the SKILL.md files are in the project's .claude/skills/<name>/SKILL.md directory structure. Claude Code auto-discovers skills from .claude/skills/.

"Vault not found" or "ENOENT" errors: Check that OBSIDIAN_VAULT points to a valid directory. The value should be the vault's folder path (e.g. /Users/you/Documents/My Vault). Verify with ls "$OBSIDIAN_VAULT".

File permission errors: The server needs read/write access to the vault directory. Check ownership and permissions on the vault folder.

Changes not appearing in Obsidian: The server writes directly to the filesystem. Obsidian's file watcher typically picks up changes within 1-2 seconds. If not, try switching to another note and back, or restarting Obsidian.

Rebuild after changes: If you edit source files, run npm run build. Claude Code loads the compiled JS from build/.

License

MIT

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选