obsidian-vault-mcp

obsidian-vault-mcp

Enables AI agents to list, read, search, create, update, rename, and delete markdown notes in a local Obsidian vault via an HTTP MCP endpoint.

Category
访问服务器

README

Obsidian Vault MCP

HTTP Model Context Protocol server that gives AI agents controlled access to a local Obsidian vault.

Built for agent runtimes (Grok bots, Claude, OpenClaw, custom MCP clients) that need to list, read, search, create, update, rename, and carefully delete markdown notes.

Features

  • Streamable HTTP MCP endpoint (/mcp)
  • Bearer / API-key auth
  • Full-vault mode (ALLOWLIST=*) or folder allowlists
  • Read tools: list_notes, list_folder, read_note, search_notes
  • Write tools: create_note, append_note, update_note, create_folder, rename_path, delete_path
  • Blocks .obsidian, .git, dotfiles, .env, and key material
  • Atomic writes + size limits
  • Health endpoint for ops: /healthz

Quick start

npm install
export VAULT_ROOT="/absolute/path/to/your/vault"
export BEARER_TOKEN="$(openssl rand -hex 32)"
export ALLOWLIST="*"
export WRITE_ALLOWLIST="*"
export MODE="read-write"
export PORT=8790
export BIND=127.0.0.1
export PUBLIC_BASE="http://127.0.0.1:8790"
npm start

Health check:

curl -s http://127.0.0.1:8790/healthz | jq .

Environment variables

Variable Required Default Description
VAULT_ROOT yes Absolute path to the Obsidian vault
BEARER_TOKEN yes Shared secret for MCP clients
ALLOWLIST no sample folders Comma list of relative folders, or * for whole vault
WRITE_ALLOWLIST no same as ALLOWLIST Write scope; * = whole vault (still blocks secrets/dotfiles)
MODE no read-write read-write or read-only
PORT no 8790 Listen port
BIND no 127.0.0.1 Bind address
PUBLIC_BASE no http://127.0.0.1:8790 Public base URL advertised in metadata
MAX_SEARCH_HITS no 25 Search result cap
MAX_FILE_BYTES no 400000 Max note size for reads
MAX_WRITE_BYTES no 350000 Max note size for writes

Auth headers accepted:

  • Authorization: Bearer <token>
  • X-Api-Key: <token>
  • X-Obsidian-Token: <token>

MCP tools

Read

  • list_notes — list markdown paths (optional prefix)
  • list_folder — list files/dirs (recursive optional)
  • read_note — read one note + simple frontmatter
  • search_notes — case-insensitive substring search

Write (when MODE=read-write)

  • create_note — create markdown note (overwrite optional)
  • append_note — append to note
  • update_note — replace full note
  • create_folder — create folder tree
  • rename_path — rename/move file or folder
  • delete_path — delete markdown file or folder (recursive for non-empty)

Safety:

  • never serves .obsidian, .git, hidden paths, .env, or key files
  • write limited to .md / .markdown / .txt
  • protected top-level structure anchors cannot be deleted wholesale
  • no secrets belong in the vault or this server config committed to git

Reverse proxy example (nginx)

location ^~ /obsidian-mcp/ {
  proxy_pass http://127.0.0.1:8790/;
  proxy_http_version 1.1;
  proxy_set_header Host $host;
  proxy_set_header Authorization $http_authorization;
  proxy_set_header X-Api-Key $http_x_api_key;
  proxy_buffering off;
}

Expose only over HTTPS and keep BIND=127.0.0.1 on the Node process.

Grok / agent prompt snippet

You have MCP tools for an Obsidian vault via obsidian-vault-mcp.

Rules:
1. First call list_folder path="" to see top-level structure.
2. Read OBSIDIAN-STRUCTURE.md if present before reorganizing.
3. Prefer append_note for changelogs; do not rewrite history casually.
4. Create notes only as .md under clear topic folders.
5. Never store secrets, tokens, private keys, or .env values.
6. Use search_notes before creating near-duplicate docs.
7. Use rename_path to organize; use delete_path only for clearly obsolete drafts.

Security notes

  • This server is powerful. Treat BEARER_TOKEN like a password.
  • Prefer network isolation + reverse proxy auth in production.
  • Full-vault write mode is intentional for trusted internal agents; tighten WRITE_ALLOWLIST for less-trusted bots.
  • Do not commit .env, tokens, or real vault contents.

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

官方
精选