vault-map

vault-map

MCP server that provides a navigable map of an Obsidian vault for coding agents, with tools to outline notes, fetch sections, query frontmatter, and grep content, reducing token usage compared to reading whole notes.

Category
访问服务器

README

vault-map

A navigable map of your Obsidian vault for coding agents (MCP server). Skeletons of your notes — headings with line ranges, queryable frontmatter, outgoing links — so the agent stops loading whole notes just to find its way around.

It is the markdown counterpart of repo-map (which does the same for source code).

Why

An agent that reads a 2 500-line note to answer one question burns ~49 000 tokens. With outline() + get_section() it reads the table of contents and the one chapter it needs: ~5 200 tokens — an 89 % cut, measured on a real vault (python _smoke.py <vault> reproduces the measurement on yours).

The point isn't only cost: an agent that can afford to look around actually looks around, instead of answering from memory.

Tools

Tool What it gives you
vault_map() whole-vault map: folder, key frontmatter, H2 titles, outgoing links
outline(note) one note's heading tree with line numbers — call this before reading
get_section(note, title) the body of a single section, nothing else
query(filter) filter notes by frontmatter without opening them (status:draft, score>5)
grep_notes(pattern) regex search through note text, each hit located as note › section (Ln)
index(path) (re)target the server at another vault / folder of .md files

query also understands two pseudo-fields for finding a note by name: title:<word> and path:<folder>.

Freshness is automatic: the map is rebuilt whenever a note changes (signature = aggregated mtime + size), so an outline never lies. A stale outline is worse than an honest read.

Requirements

Python 3.10+. One dependency (mcp) — the engine itself is pure stdlib.

Install

git clone https://github.com/noambinabout-boop/vault-map.git
cd vault-map
python -m venv .venv
.venv/Scripts/pip install -r requirements.txt     # Windows
# .venv/bin/pip install -r requirements.txt       # macOS / Linux

Then register it with your agent. For Claude Code, from anywhere:

# Windows
claude mcp add vault-map --scope user -- C:\path\to\vault-map\.venv\Scripts\python.exe C:\path\to\vault-map\server.py

# macOS / Linux
claude mcp add vault-map --scope user -- /path/to/vault-map/.venv/bin/python /path/to/vault-map/server.py

Check with /mcp inside Claude Code. Any MCP-capable client works the same way — it is a plain stdio server: <python> server.py.

Point it at your vault

By default the server targets the current working directory. Two ways to change that:

  • Per call: index("/path/to/vault") — retargets on the fly.
  • Always the same vault, whatever project you launched the agent in: set VAULT_MAP_TARGET. In ~/.claude.json, on the server entry:
"vault-map": {
  "type": "stdio",
  "command": "C:\\path\\to\\vault-map\\.venv\\Scripts\\python.exe",
  "args": ["C:\\path\\to\\vault-map\\server.py"],
  "env": {
    "VAULT_MAP_TARGET": "C:\\path\\to\\your\\vault",
    "PYTHONIOENCODING": "utf-8"
  }
}

On Windows, PYTHONIOENCODING: utf-8 avoids a crash when a note contains an emoji.

Make the agent actually use it

Tools nobody calls save nothing. Put the reflex in your CLAUDE.md (or equivalent):

To find your way around the vault, use vault-map, not Read:
1. vault_map() for the big picture, query(filter) to filter by frontmatter
2. outline(note) before opening any note
3. get_section(note, title) to read only the part that matters
4. grep_notes(pattern) to search by content
Raw Grep/Read: last resort only.

If your client defers tool schemas, mark the server "alwaysLoad": true so the tools are there from the first message.

Verify your install

python _handshake.py            # full MCP stdio round-trip
python _smoke.py <your-vault>   # builds the map and prints the token saving

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

官方
精选