Margins

io.github.cflorczyk9由 GitHub 帳號 cflorczyk9 發布v0.15.3更新於 Oct 24, 2026

Use your Claude Pro/Max subscription on your Obsidian vault. Reads markdown, proposes writes.

概覽

AI 產生的概覽

一個本機 MCP 伺服器,讓 Claude 讀取 Obsidian 儲存庫或 Markdown 資料夾,並把擬寫入的頁面暫存起來供你審核。

可以做什麼
依全文與檔名搜尋儲存庫,依路徑讀取頁面,列出最近修改的頁面並找出指向某頁的反向連結,另提供供深度研究用戶端使用的 search/fetch 組合。暫存新頁面、字串取代式編輯、附加內容,以及把 raw 中的 PDF、Word 文件、試算表、郵件匯出與 EPUB 等原始文件編譯成結構化來源頁。列出待處理提案及覆寫風險標記,並接受或拒絕提案。為共用同一 slug 的頁面建議 wikilink。記錄並讀取存放在儲存庫內 Markdown 檔案的歸檔與命名偏好。
適用情境
適合以 Obsidian 或 Markdown 資料夾記筆記、希望助理根據筆記回答問題並起草修改而不直接更動現有檔案的情境。也適合需要建立、整理或補充內部連結的儲存庫,以及想沿用現有 Claude 訂閱而非 API 金鑰的使用者。
執行需求
以 Node.js 套件形式透過 stdio 在本機執行,需要 Node.js 18 或更新版本,可全域安裝或經 npx 執行。需在 MARGINS_VAULT 提供儲存庫的絕對路徑,或使用安裝程式的路徑提示。推理依賴 Claude Pro、Max 或 Claude Code 訂閱。可選 MARGINS_INDEX_ROOTS 限定索引的子資料夾。
安裝前請注意
寫入類工具會把檔案暫存在儲存庫內的 proposed/ 目錄,resolve_proposal 選擇 accept 後才會移入正式目錄,接受前請先審核提案。安裝程式會寫入 Claude Desktop 與 Claude Code 的設定檔,並在儲存庫中建立資料夾。匿名遙測在安裝時需選擇加入,會回報工具呼叫次數,可用 MARGINS_TELEMETRY=off 關閉。說明稱儲存庫內容保留在本機磁碟。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Margins,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

margins-mcp

Use your Claude Pro/Max subscription on your Obsidian vault. No API key. No per-token costs. No embedding pipelines. Claude reads your notes and proposes updates; your subscription pays for inference; your files stay on your disk.

margins-mcp is a small Node program that sits between Claude (Desktop or Code) and your Obsidian vault. When you chat with Claude, it reads your notes through margins-mcp. Your files stay local, Claude does the thinking, your existing subscription pays for it.

Which Margins are you?

Margins works for six common starting points. margins_start auto-detects your state on the first call, so you don't have to classify yourself — but knowing which row you're on helps set expectations.

You...PersonaFirst conversation
Obsidian, vault organized with wikilinksA1Q&A on your notes. margins_start then ask anything.
Obsidian, vault is empty or newA2Ask Claude to scaffold daily-note + meeting templates.
Obsidian, many files but few wikilinksA3Run propose_wikilinks on a page to surface connections you missed.
No Obsidian, organized markdownB1Same as A1. Install Obsidian for the proposal-review UX.
No Obsidian, emptyB2Use --starter-vault ~/Margins to scaffold one.
No Obsidian, messy folderB3Run propose_wikilinks on your busiest page. Install Obsidian to review proposals visually.

Requirements

  • Node.js 18 or newer
  • An Obsidian vault, or any folder with notes, PDFs, Office/OpenDocument files, email exports, EPUBs, or plain text
  • A Claude subscription: Pro ($20/mo), Max, or Claude Code

Install

Two commands:

sh
npm install -g margins-mcpmargins-mcp install

The installer prompts for your vault path, detects Claude Desktop and Claude Code, writes the right config files, scaffolds raw/ + proposed/ + .margins/ inside your vault if missing, and runs a verification probe. Restart Claude Desktop (Cmd-Q on macOS, not just close the window), or in Claude Code run /mcp to see Margins listed.

Don't have a vault yet?

Scaffold a Margins-shaped one:

sh
margins-mcp install --starter-vault ~/notes

Finding your Obsidian vault path

If you already use Obsidian and don't know your vault's absolute path:

  • In Obsidian: right-click the vault name in the file tree → "Reveal in Finder" (macOS) or "Show in Explorer" (Windows). The path is in the title bar.
  • macOS common paths: ~/Documents/<VaultName>, or ~/Library/CloudStorage/iCloudDrive/Obsidian/<VaultName> if iCloud-synced.
  • Linux common paths: ~/Documents/<VaultName>, or ~/.local/share/Obsidian/<VaultName>.
  • Windows common paths: %USERPROFILE%\Documents\<VaultName>.

Pass it to the installer via --vault /absolute/path or answer the prompt.

Try-without-installing

sh
npx margins-mcp install --vault /path/to/vault

You'll see a warning that npm may garbage-collect the npx cache and your configs would break weeks later. For real use, prefer npm install -g above. The npx path is fine for kicking the tires.

Manual install

If you'd rather edit config yourself, add this to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS; see Anthropic docs for Windows/Linux paths):

json
{  "mcpServers": {    "margins": {      "command": "node",      "args": ["/absolute/path/to/margins-mcp/bin/margins-mcp.js"],      "env": { "MARGINS_VAULT": "/absolute/path/to/your/vault" }    }  }}

Try it

In a new Claude conversation, ask:

Use margins to give me a summary of my recent notes.

Or:

What pages support the claim that my project deadline is May 30th? Use margins to find them.

Or:

I just dropped a spreadsheet into raw/. Compile it into a structured source page in my wiki.

The model can read your vault, propose new pages, propose edits to existing ones, and pull raw sources into structured wiki pages. propose_compile_from_raw accepts Markdown/plain text, PDFs, Word docs, spreadsheets, decks, email exports, EPUBs, OpenDocument files, RTF, HTML, CSV/TSV, JSON, YAML, and common text-ish formats. Every write stages to proposed/ first; nothing lands without you accepting.

Tools

Context (call once per conversation)

ToolPurpose
margins_startVault stats + pending proposals + uningested raw files + recent preferences + the vault's CLAUDE.md if present. Claude's grounding for the whole conversation.
recall_preferencesRead durable user preferences from .margins/preferences.md (filing conventions, naming patterns, prior corrections). Claude calls this before any propose.

Read

ToolPurpose
search_vaultFull-text + filename search across the vault.
read_pageRead one page by relative path.
list_recentMost recently modified pages.
get_backlinksPages that wikilink to a target slug.
search / fetchChatGPT Deep Research compatibility pair.

Propose writes (staged — nothing lands until accepted)

ToolPurpose
propose_pageStage a new page at proposed/<path>.
propose_editStage a string-replacement edit. before must appear exactly once.
append_toStage an append. Creates the page if missing; stacks on pending proposals.
propose_compile_from_rawTurn a raw transcript, note, PDF, Word doc, spreadsheet, deck, email, EPUB, or other supported document in raw/ into a structured source page.
list_proposalsList pending proposals + overwrite-risk flag per entry.
resolve_proposalaction: "accept" lands the proposal; action: "reject" discards it.

Suggest (for A3 / B3 — vaults with many files but few links)

ToolPurpose
propose_wikilinksScan a page for entity-shaped phrases and propose wikilinks to other vault pages that share the same slug. The model then chains propose_edit calls to apply the ones it likes.

Learn

ToolPurpose
record_preferenceAppend a durable rule to .margins/preferences.md. Claude calls this when the user corrects a proposal in a way that should apply next time (filing path, naming, summary length, etc.).

How the proposal flow works

Every write tool stages to proposed/<path> inside your vault. Nothing touches the live tree until you (or an MCP client acting on your behalf) call resolve_proposal with action: "accept". You can also inspect staged content (ls proposed/) and accept by moving files yourself.

Sequential edits stack: a second propose_edit on the same path reads from the pending proposal, not the vault.

Configuration

Env varDefaultPurpose
MARGINS_VAULT(required)Absolute path to your Obsidian vault or Markdown folder.
MARGINS_INDEX_ROOTSauto-detectedComma-separated subfolders to index. Auto-detection: .obsidian/ present → index root; wiki/ present → index wiki/ only; neither → index root.
MARGINS_TELEMETRY(consent file)Override telemetry: on or off. Default uses the consent decision made during install.

What Margins is NOT

To keep scope crisp:

  • Not an inference layer. Your Claude subscription pays for that. Margins makes zero LLM calls.
  • Not a web app. The chat surface lives in Claude Desktop / Claude Code / claude.ai. Margins is plumbing.
  • Not a cloud sync. Local-first. Your files stay on your disk.
  • Not a CRM integration. Different product.
  • Not API-key-based. Subscription-passthrough is the whole point.

Privacy

  • Vault content never leaves your machine. Margins is a Node process that reads/writes files locally and exposes structured tools over stdio.
  • Anonymous telemetry (opt-in at install time) reports tool-call counts to help me prioritize what to build next. Sample event payload: GET https://margins.goatcounter.com/count?p=/tool/search_vault. No vault content, no file paths, no user identifier beyond the standard 24-hour rolling session token GoatCounter assigns. Disable per-session with MARGINS_TELEMETRY=off. Decision stored at ~/.margins/consent.json.

Develop

sh
git clone https://github.com/cflorczyk9/Margins.gitcd Marginsnpm installnpm testMARGINS_VAULT=/path/to/test/vault npm start

The compiler (src/compiler/) was originally vendored from an earlier Margins web app. The web app and its landing page live on the legacy-webapp branch in this repo. Re-vendor with scripts/vendor-compiler.sh if you ever need to pull updates back from there.

How Margins gets smarter over time

Two things compound:

  1. Your vault's CLAUDE.md is auto-loaded by margins_start. Drop vault-specific rules in there — filing conventions, voice, naming patterns — and Claude obeys them in every conversation. No copy-paste.
  2. .margins/preferences.md is a Margins-maintained file inside your vault. When you correct Claude ("no, that should be in projects, not personal"), Claude calls record_preference to remember the rule. Next conversation it reads them via recall_preferences before proposing writes. The file is plain Markdown — you can audit it, hand-edit it, delete sections that no longer apply.

Both files live in the vault, so they travel with it. Switch machines, switch hosts (Claude Desktop → Claude Code → ChatGPT once that lands), and your conventions follow.

Roadmap

  • v0.6: web onboarding at marginsmcp.com — pick a folder via File System Access, scaffold a vault, get the install command. Closes B2/B3 personas without requiring CLI fluency.
  • v0.6: get_citations (semantic embedding search, opt-in dep).
  • v0.6: OCR/image, legacy Office binary, and audio/video ingestion for propose_compile_from_raw.
  • v0.7: HTTP / Streamable transport for claude.ai web and ChatGPT custom connectors.
  • v0.7+: Obsidian community plugin alongside MCP, if signal supports it.
  • v0.8+: file watcher / auto-scaffold on drop into raw/.

License

MIT

來源:README.md,提交 69b6af2

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.15.3最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分