Markpin

dev.markpinv0.7.1更新於 Oct 4, 2026

Search and read the web pages and highlights you saved with the Markpin Chrome extension.

概覽

AI 產生的概覽

讓助理搜尋並閱讀你用 Markpin Chrome 擴充功能儲存的網頁與摘錄,並可在確認後編輯它們。

功能
透過 stdio 在本機執行,讀取 Markpin 資料夾中的 Markdown 頁面檔案。讀取工具包括對標題、內容、摘錄、筆記與標籤的全文搜尋、以 id 或 URL 取得單一頁面的 get_page、list_recent 與 list_tags。加上 --allow-write 後會增加十個寫入工具,例如 save_page、update_tags、add_clip、set_summary、delete_pages、restore_pages,以及書籤與已讀標記工具。它會監看該資料夾,新儲存的頁面會在下一次查詢時出現。
適用情境
適合你維護著一個 Markpin 儲存頁面與摘錄的資料庫,並希望助理在 Claude Code、Claude Desktop 或 Cursor 中搜尋、摘要、加標籤或整理它。唯讀使用除了資料夾路徑外不需額外設定。
執行需求
需要 Node.js 20.1 或更新版本,透過 npx @markpin/mcp 執行,並必須以 --dir 指定包含 pages/ 目錄的 Markpin 資料夾。Markpin Chrome 擴充功能需將儲存位置設為本機資料夾或 Google Drive;使用 Google Drive 時還需要 Google Drive for Desktop 將資料夾同步到磁碟。未宣告帳號、API 金鑰或環境變數。
安裝前請注意
預設為唯讀;寫入需要 --allow-write 旗標,且在用戶端支援時每次變更都會顯示確認對話框。寫入工具可以新增、修改、加標籤、標記刪除或還原你資料夾中的頁面,save_page 只在你接受後才會抓取該 URL。伺服器本身從不刪除檔案;擴充功能會在 30 天後清除已刪除的頁面。不要手動編輯頁面檔案中的內部 JSON 區塊。

安裝

在 SourceWeft 中

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

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

其他 MCP 客戶端

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

README

@markpin/mcp

MCP server for a Markpin folder. Markpin is a Chrome extension that saves web pages and clips as Markdown files in a folder you own — this server lets an AI client (Claude Code, Claude Desktop, Cursor, …) search and read those files, and optionally edit them with your confirmation.

  • Read-only by default. Writes need --allow-write and a confirmation dialog for every change.
  • Runs locally over stdio. Nothing leaves your computer.
  • Watches the folder, so pages you save in the browser show up in the next query without a restart.

Requirements

  • Node.js 20.1 or newer (node -v).
  • The Markpin Chrome extension with storage set to Local folder or Google Drive. With Google Drive you also need Google Drive for Desktop so the folder exists on disk.

Run

bash
npx -y @markpin/mcp --dir "<your Markpin folder>"

Options:

FlagMeaning
--dir <path>Required. The Markpin folder (the one that contains pages/). ~ is expanded.
--allow-writeRegisters the ten write tools. Without it the server is read-only.
--lang ko|en|ja|es|pt-BR|de|frLanguage of the confirmation dialog. Default: taken from your system locale (pt* → pt-BR), otherwise en. The Markpin extension's setup guide fills this in from your Chrome language.

On success the server logs serving N pages from <dir> to stderr. stdout carries the MCP protocol, so all logs go to stderr — that line is the quickest way to check the path.

Find your Markpin folder

The folder must contain a pages/ directory. If it doesn't, the extension hasn't uploaded anything there yet — save a page in Chrome first.

Local folder — the folder you picked in Markpin settings.

  • macOS: in Finder, right-click the folder, hold ⌥ Option, choose Copy "…" as Pathname.
  • Windows: Shift + right-click the folder, choose Copy as path (remove the surrounding quotes).

Google Drive — Drive for Desktop mirrors your Drive to disk. The Markpin folder sits at the top of My Drive, whose name follows your Google account language — My Drive (en), 내 드라이브 (ko), マイドライブ (ja), Mi unidad (es), Meu Drive (pt-BR), Meine Ablage (de), Mon Drive (fr):

  • macOS: ~/Library/CloudStorage/GoogleDrive-<your email>/My Drive/Markpin
  • Windows: G:\My Drive\Markpin (the drive letter can differ — check File Explorer)

The Markpin settings page in Chrome has an MCP setup guide button that fills these paths (and --lang) in for you.

Register the server

Replace <dir> with your folder path. Add --allow-write at the end of the arguments if you want the write tools.

Claude Code

bash
claude mcp add -s user markpin -- npx -y @markpin/mcp --dir "<dir>"

-s user registers it for every project; drop the flag to keep it to the current directory only.

Then claude mcp list should show markpin: … - ✓ Connected.

Claude Desktop

Edit the config file (Claude → Settings → Developer → Edit Config):

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

macOS:

json
{  "mcpServers": {    "markpin": {      "command": "npx",      "args": ["-y", "@markpin/mcp", "--dir", "<dir>"]    }  }}

Windows (Claude Desktop spawns without a shell, so npx needs cmd /c; escape backslashes in the path):

json
{  "mcpServers": {    "markpin": {      "command": "cmd",      "args": ["/c", "npx", "-y", "@markpin/mcp", "--dir", "G:\\My Drive\\Markpin"]    }  }}

Restart Claude Desktop. The hammer/plug icon in the chat box lists the Markpin tools.

Cursor

Add the same JSON to ~/.cursor/mcp.json (all projects) or .cursor/mcp.json (one project), then enable the server in Cursor Settings → MCP.

File format

Each page is one Markdown file. The frontmatter holds only the human-facing keys (title, url, savedAt, tags, summary, readAt, deletedAt) so note apps such as Obsidian show a clean Properties panel. Everything Markpin needs internally (id, rev, updatedAt, clips with their anchors, bookmark) lives in a one-line JSON block at the very end of the file:

<!-- markpin{"v":2,"id":"…","rev":3,"updatedAt":"…","domain":"…","clips":[…]}-->

Do not edit that block by hand. Files written before 0.7.0 (markpin: 1 in the frontmatter) are still read; they are rewritten in the new shape the next time anything changes them.

markpin.json (Markdown template)

The extension writes markpin.json at the folder root when you pick a Markdown template or turn on .trash/ in its options. This server reads it on start and on every rescan, and renders the files it writes with the same template (default or obsidian, or a custom template string), so pages saved through MCP look like the ones saved from the browser. Only the body below the frontmatter changes; the frontmatter is always Markpin's own. Moving deleted files to .trash/ is done by the extension, not by this server.

Read-only vs. --allow-write

Without --allow-write the server exposes four read tools and cannot change any file. With it, ten write tools are added. Every write passes three gates:

  1. The flag. You decided at registration time that writes are allowed at all.
  2. Client permission. The tools are marked non-read-only (delete_pages as destructive), so clients such as Claude Code ask before each call.
  3. Your confirmation. If the client supports MCP elicitation (Claude Code does), the server shows a dialog describing the exact change — for example "Add tag frontend to 'React Docs'?" — and writes only when you accept. If the client cannot show that dialog, the result carries "gate": "client" so the assistant can tell you that the client's own prompt was the only confirmation.

The confirmation waits up to 10 minutes. A save_page fetch happens only after you accept, so a declined URL is never requested.

Tools

Read (always):

ToolWhat it does
searchFull-text search over titles, content, clipped text, notes and tags. Empty query = most recent, optionally filtered by tags. bookmarked: true = only pages with a reading bookmark.
get_pageOne page in full by id or URL: metadata, tags, summary, content, clips with notes and colors, bookmark, file path, image paths.
list_recentMost recently updated pages. bookmarked: true = pages with a reading bookmark, newest bookmark first.
list_tagsEvery tag with its page count.

Write (--allow-write):

ToolWhat it does
save_pageSaves a URL as a new page (fetches and extracts the article unless you pass content). Takes an optional summary (one or two sentences) and tags — the assistant is asked to supply both whenever it has read the page, since Markpin's built-in AI only runs for pages saved from the browser. One page per URL — an existing page is returned unchanged.
update_tagsAdds and/or removes tags on one or more pages.
add_clipAdds a quoted text clip, with an optional note and highlight color (amber, green, blue, pink), to a page.
set_clip_noteReplaces the note on a clip (empty clears it).
set_summaryReplaces a page's summary (empty clears it). Handy for pages saved without one.
delete_pagesMarks pages deleted. The Markpin extension keeps them for 30 days and can restore them; this server never deletes files.
restore_pagesBrings back pages deleted within the last 30 days.
set_bookmarkPuts the reading bookmark on a page — from the start, or at a quote from the content to resume there. Replaces any existing bookmark and clears the read mark.
clear_bookmarkRemoves the bookmark without marking the page read.
mark_readMarks a page as read and removes its bookmark.

Every write returns a note and a gate field ("elicitation" when you confirmed in the dialog, "client" when only the client's prompt stood between the assistant and the write). update_tags, set_clip_note and set_summary also return before/after; the others return the affected page(s).

Limits

  • Google Drive + new pages. With Google Drive storage the extension can only read files it created itself (drive.file scope), so save_page writes new pages to inbox.jsonl in your Markpin folder and the extension turns them into page files on its next sync. The extension creates and manages that file — do not delete it. Edits to existing pages are written in place. With a local folder there is normally no inbox and everything is written directly; if an inbox.jsonl exists in the folder (for example a former Drive mirror), the server uses it the same way.
  • No region clips. Image/area clips need the page DOM; the server adds text clips only.
  • Side panel delay. While the side panel is open it polls every 15 seconds, so changes show up within about 30 seconds; when it is closed they show up the moment you open it. A full sync also runs every 5 minutes. With Google Drive, add the time Drive for Desktop needs to upload.
  • Concurrent edits. If the extension wrote the same page after the server read it, the write is refused with Page changed on disk since it was read; re-read it and try again. Ask again.
  • Tombstones. Deleted pages are only purged by the extension. A folder used by this server alone keeps them.

Troubleshooting

SymptomCause / fix
Not a directory: …Typo in --dir, or Drive for Desktop is not running / the folder is not mirrored. Open the path in Finder or Explorer first.
serving 0 pagesThe folder has no pages/ yet or it is empty. Save a page in Chrome; with Drive wait for the upload.
Client says the server failed to startRun node -v (needs 20.1+). On Windows use the cmd /c npx form. Run the npx line in a terminal to see the error.
Pages saved just now don't appearThe server rescans about 300 ms after a file change. With Drive, the file appears when Drive for Desktop finishes syncing.
A page saved by the assistant is missing in the side panelKeep the side panel open for about 30 seconds. With Google Drive, Drive for Desktop must be running so inbox.jsonl reaches Drive.
Pages are missing after updating the Chrome extensionFiles are now written in format v2 (see File format). Servers before 0.7.0 skip them — run npx -y @markpin/mcp@latest or re-register with the current version.
Write tools missingYou registered without --allow-write. Re-register, then restart the client so it spawns the server again.
A page saved by the assistant has no summary or tagsThe assistant saved it without reading the page. Ask it to write the summary and tags (set_summary, update_tags).
Not an HTML page / the server cannot fetch a URLThe site blocks bots or needs a login. Ask the assistant to read the page itself and pass content to save_page.
User declined / No response to the confirmationYou declined the dialog, or it timed out after 10 minutes. Nothing was written.

Development

bash
yarn build:mcp                 # bundles to mcp-server/dist/index.jsnode mcp-server/dist/index.js --dir "<dir>"

License MIT.

來源:mcp-server/README.md,提交 772b4b1

工具

0
工具後設資料尚未被收錄。

版本歷史

1
  1. v0.7.1最新Oct 4, 2026