Skip to main content
Glama
acbrewer12

Obsidian Vault MCP

by acbrewer12

Obsidian Vault MCP(免费,无需信用卡,无需常开电脑)

这能让 Claude(移动端、桌面端、网页端)通过一个托管在 Render 上的小型服务器(免费)读取你的 Obsidian 仓库,该服务器直接从 GitHub 仓库读取数据。你的仓库通过 Obsidian Git 插件从手机和桌面同步到 GitHub——无需任何设备保持开机。

组成部分

  • GitHub 仓库——仓库的权威来源(免费,私有)。

  • Obsidian Git 插件——从桌面端和手机端自动提交/推送/拉取。

  • 此 MCP 服务器——通过 GitHub 的 API 读取仓库,通过 MCP 暴露 list_notesread_notesearch_notes 功能。免费部署在 Render 上。

  • Graphify——可选,在本地运行,将其输出像其他笔记一样提交到仓库中。

Related MCP server: Obsidian MCP Server

1. 创建 GitHub 仓库

  1. github.com → 新建仓库 → 命名为例如 obsidian-vault私有 → 创建。

  2. 设置 → 开发者设置 → 个人访问令牌 → 细粒度令牌

    • 仓库访问:仅此仓库。

    • 权限:内容 → 读取和写入(需要以便 Claude 可以创建和编辑笔记,而不仅仅是读取)。

    • 复制令牌——你将把它作为 GITHUB_TOKEN 粘贴到 Render 中。

2. 配置 Obsidian Git(桌面端 + 手机端)

  1. Obsidian → 设置 → 社区插件 → 浏览 → 安装 Obsidian Git

  2. 将你的仓库文件夹指向仓库的本地克隆(或者在其中执行 git init 并添加 GitHub 仓库作为 origin)。

  3. 在插件设置中,开启按间隔自动备份(例如每 10 分钟)和加载时自动拉取——它会自动为你提交、推送和拉取。

  4. 在手机上:安装 Obsidian 移动版,添加相同的插件(它在 iOS/Android 上都能用),在插件的认证界面登录 GitHub。

现在每个设备都向同一个仓库推送/拉取——该仓库就是你的同步层。

3. 将 MCP 服务器部署到 Render(免费)

  1. 将此文件夹(server.jspackage.jsonrender.yaml)推送到它自己的公共或私有 GitHub 仓库(与仓库仓库分开)。

  2. render.com → 新建 → Web 服务 → 连接该仓库。

  3. 它应该会自动检测 render.yaml。如果没有:构建命令 npm install,启动命令 npm start,计划 免费

  4. 添加环境变量:

    • GITHUB_TOKEN——来自步骤 1 的细粒度令牌

    • GITHUB_OWNER——你的 GitHub 用户名

    • GITHUB_REPO——你的仓库仓库名称(例如 obsidian-vault

    • GITHUB_BRANCH——main(或你的默认分支)

    • MCP_SHARED_SECRET——生成一个随机字符串;这可以防止发现你 Render URL 的随机人员读取你的仓库

  5. 部署。你将获得一个类似 https://obsidian-vault-mcp.onrender.com 的 URL。

免费层说明:空闲约 15 分钟后会休眠,下次请求时需几秒唤醒——对于偶尔的 Claude 查询来说没问题。

4. 连接到 Claude

在 Claude → 设置 → 连接器 → 添加自定义连接器:

  • URL:https://<你的应用>.onrender.com/mcp

  • 标头:Authorization: Bearer <你的 MCP_SHARED_SECRET>

然后只需让 Claude 搜索、读取或编辑你的笔记——它会自动调用 search_notes / read_note / list_notes / write_note / delete_note。写入操作直接提交到仓库,因此下次 Obsidian Git 同步时(或者如果你开启了自动拉取间隔,则立即)它们会出现在你的手机/桌面上。

写入操作提醒: write_note 会覆盖整个文件——要编辑现有笔记,先让 Claude 读取它,然后写回完整的更新内容。delete_note 是一个真实的、永久的 git 提交;在删除任何内容之前,值得让 Claude 与你确认。

5. Graphify——自动、免费、无需托管

Graphify 从你的笔记中构建知识图谱。语义提取需要 LLM,而无需任何托管的免费选项是 Google 的 Gemini API 免费层(无需信用卡,永不过期)。

获取免费的 Gemini 密钥:

  1. 访问 aistudio.google.com,使用 Google 账户登录。

  2. 获取 API 密钥 → 创建 API 密钥。复制它。

添加 GitHub Actions 工作流:

  1. 在你的仓库仓库中,创建 .github/workflows/graphify.yml,内容来自此项目的 vault-workflow/.github/workflows/graphify.yml

  2. 仓库 → 设置 → 密钥和变量 → Actions → 新建仓库密钥:

    • 名称:GEMINI_API_KEY

    • 值:来自 AI Studio 的密钥

  3. 仓库 → 设置 → Actions → 常规 → 工作流权限 → 设置为读取和写入权限(以便工作流可以将图谱提交回去)。

  4. 它每天自动运行一次,并且每当你向仓库推送更改时也会运行。你也可以从仓库的 Actions 选项卡手动触发它。

这会在你的仓库仓库中生成 graphify-out/graph.jsongraphify-out/GRAPH_REPORT.md——无需服务器、无需 Space、无需保持运行。

MCP 服务器已经有相应的工具graph_overviewgraph_find_nodegraph_neighbors)——它们像 read_note 一样直接从 GitHub 读取图谱。无需额外部署;只需将更新后的 server.js 重新部署到 Render,下次 Claude 连接时它们就会出现。

本地测试(可选,在部署之前)

npm install
GITHUB_TOKEN=xxx GITHUB_OWNER=you GITHUB_REPO=obsidian-vault npm start

然后使用 MCP 客户端向 http://localhost:3000/mcp 发送 POST 请求,或者直接部署到 Render 并通过 Claude 进行测试。

A
license - permissive license
-
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

View all related MCP servers

Related MCP Connectors

  • Connect AI assistants to your GitHub-hosted Obsidian vault to seamlessly access, search, and analy…

  • Search and reason over your Obsidian-style Markdown vault, right from ChatGPT.

  • Persistent context for Claude. Your AI always knows your projects and next actions across sessions.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/acbrewer12/obsidian-vault-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server