
Sharedoc Mcp
io.github.AugustusW由 GitHub 帳號 AugustusW 發布v2.1.4更新於 Oct 28, 2026
Share agent-generated Markdown as links — GitHub gists today, your own server tomorrow.
概覽
把代理產生的 Markdown 變成可分享的連結,可發佈到 GitHub 私密 gist,或存進本機 SQLite 檢視器並支援密碼與到期時間。
- 可以做什麼
- 用標題和 Markdown 建立分享連結,可選密碼、到期時數與作者
- 對既有文件附加內容、整份取代內容、重新命名、延長有效期或重設密碼
- 撤銷連結,或徹底刪除紀錄(刪除需明確確認)
- 依標題或內文搜尋、列出已分享文件,支援分頁,自架後端另提供瀏覽次數
- 以獨立常駐程式執行檢視器,讓自架連結在 MCP 用戶端關閉後仍可開啟
- 適用情境
- 適合代理產出報告、研究摘要或會議紀錄等 Markdown 內容,而你希望把一條連結交給他人、而不是貼上一大段文字,之後還能撤銷、延期或更新。gist 後端適合快速分享;自架後端適合把內容留在自己的機器上並啟用密碼與強制到期。
- 執行需求
- 透過 npx 以 stdio 在本機執行,需要 Node.js 22.13.0 以上版本。預設 gist 後端還需安裝並登入 GitHub CLI。自架後端不需額外帳號,但要在本機之外分享需自備通道或反向代理並設定 SHAREDOC_PUBLIC_URL。可選變數:SHAREDOC_BACKEND、SHAREDOC_PORT、SHAREDOC_BIND_HOST、SHAREDOC_DATA_DIR、SHAREDOC_INDEX_PATH、MCP_CALLER。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Sharedoc Mcp,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
sharedoc-mcp
Agent-generated Markdown → a link you can hand to anyone. GitHub gists today, your own server tomorrow.
English | 繁體中文
[npm] [npm downloads] [MCP Registry] [Release] [License] [Node] [MCP] [Claude Code] [Codex]
[Add to Cursor] [Install in VS Code]
An MCP stdio server — works in Claude Code, Codex CLI, and any MCP client — that gives your agent 9 tools to publish, update, search, and revoke shareable documents. Two pluggable backends behind one interface: gist (zero setup, rides your logged-in gh CLI) and selfhost (SQLite on your machine, passwords, enforced expiry).
When a backend can't honor a parameter (e.g.
passwordon gist), it returns a clear error instead of silently ignoring it.
Why?
AI agents produce Markdown constantly — reports, research digests, meeting notes. Getting that to another human usually means copy-pasting walls of text into a chat window.
Where do those Markdown digests come from? Often another skill — e.g. audio-tldr turns videos and podcasts into Markdown digests; sharedoc-mcp turns them into links.
Features
- ✓ 9 MCP tools: create / append / update content / extend / reset password / rename / revoke / delete / search
- ✓
sharedoc-mcp servedaemon mode — selfhost links keep working after your MCP client closes - ✓ Content search: find old share links by what's in them, not just the title
- ✓
GET /healthz— identity-aware health probe for external monitoring / restart automation - ✓ Two backends, one interface — switch with a single env var, tool schemas stay identical
- ✓ Gist backend (default): secret gists via your logged-in
ghCLI — no tokens to manage, nothing new to host - ✓ Selfhost backend: docs stay on your machine (SQLite via built-in
node:sqlite— zero native modules) - ✓ Server-verified passwords (bcrypt) with rate-limited attempts — 5/minute, HTTP 429, counters persisted in SQLite so a restart can't reset them (selfhost)
- ✓ Enforced expiry (410) and revoke with a 7-day content-purge grace (selfhost); lazy expiry cleanup (gist)
- ✓ Markdown rendered through
marked+sanitize-html— scripts, event handlers, andjavascript:URLs in shared content are stripped - ✓ Viewer binds 127.0.0.1 only, answers with a strict security-header set (CSP
default-src 'none', nosniff, DENY framing, no-referrer, no-store) — exposure is a tunnel you control (recipes below) - ✓ Local index for
search_shared_docs+ create dedup (identical unprotected retries within 5 min return the same URL; a retry that adds a password/expiry always creates a new doc) - ✓
search_shared_docssupports offset pagination (hasMorein the response) and, on selfhost, view stats (viewCount/lastViewedAt, counted on a successful render only) - ✓ Docker one-liner for the standalone
servedaemon, defaults to the same 127.0.0.1-only binding as everywhere else - ✓ Two MCP clients can share one data dir: SQLite WAL + busy timeout, graceful port sharing
- ✓ 110 offline tests;
npm testpasses on a clean checkout
Install
Requires Node.js ≥ 22.13.0. Gist backend additionally needs GitHub CLI logged in (gh auth login).
Option A — Claude Code (one line):
Option B — Codex CLI (~/.codex/config.toml):
Option C — Cursor (one click): hit Add to Cursor, or merge into ~/.cursor/mcp.json:
Option D — VS Code (one click): hit Install in VS Code, or from a terminal:
Option E — any other MCP client: run npx -y sharedoc-mcp@^2 as a stdio server.
Why
@^2? A barenpx -y sharedoc-mcpresolves the latest published version on every cold start — a future 3.0 could change behavior (or remove a tool) under you without warning.@^2follows 2.x fixes but never crosses a breaking major; pin an exact version (@2.2.0) if you want zero drift.
Pick your backend
Gist quickstart
Ask your agent to "share this as a doc" — it calls create_shared_doc and returns a secret gist URL. Secret gists are not listed publicly and the URL is unguessable, but anyone who has the link can read it — that's the whole security model of this backend. Need passwords? Use selfhost.
A local index (~/.config/sharedoc-mcp/index.json) tracks what you've shared, powering search and expiry cleanup. Expiry here is lazy: expired gists are deleted the next time any tool runs, not at the exact expiry moment.
Selfhost quickstart
Docs live in SQLite at ~/.local/share/sharedoc-mcp/; a viewer serves them at http://127.0.0.1:8377. To share beyond your machine, put a tunnel in front and set SHAREDOC_PUBLIC_URL:
Links that outlive your editor: in MCP mode the viewer dies with the MCP client — close Claude Code and selfhost links stop answering until the next session (data is safe in SQLite). Run the standalone daemon to keep links alive around the clock:
MCP clients detect the daemon already owns the port and simply use it.
When to set this up: the moment you first hand a link to someone else — do it together with your tunnel (both should be long-running, e.g. under launchd/systemd). Until then the MCP-mode viewer is enough, and gist-backend users never need it.
Own a domain? Cloudflare named tunnel, step by step
A branded, stable share URL like https://docs.example.com/docs/<uuid> — TLS handled by Cloudflare, works from behind NAT:
~/.cloudflared/config.yml:
Run cloudflared tunnel run sharedoc (or install it as a service for always-on), and register the MCP server with the public URL:
Extras this unlocks: Cloudflare's DDoS protection comes free; you can layer WAF rules, or put Cloudflare Access (SSO) in front of everything except the share paths — an "SSO inside, password-protected shares outside" split.
Alternative — always-on without a home machine: run sharedoc-mcp on a VPS (where your agent also runs) and point nginx/caddy at 127.0.0.1:8377 with your domain and auto-TLS; no tunnel needed.
Docker
Runs the same standalone serve daemon as above, in a container:
-v sharedoc-data:/datapersistsdocs.dbin a named volume — recreating the container keeps your docs.SHAREDOC_BIND_HOST=0.0.0.0is required to reach the container at all. The viewer binds127.0.0.1by default — same as every other deployment in this README — and inside a container that's unreachable throughdocker run -p, because-pforwards to the container's network interface, not its loopback. Without this env var,docker logswill show the viewer listening, but the mapped host port will refuse every connection.- Setting it to
0.0.0.0means any process that can reach the container's exposed port reaches the viewer, unauthenticated by network position — the same exposure tradeoff as running any other unauthenticated app in a container without a proxy in front. Put it behind the same kind of front door as any other selfhost recipe above (a reverse proxy on the host, a Tailscale sidecar, a Cloudflare tunnel) rather than publishing-p 8377:8377straight to the internet. Password-protecting individual docs (this backend's built-in feature) is not a substitute for that. - If the address recipients will use differs from
http://<host>:8377(a reverse proxy, a domain, a tunnel), setSHAREDOC_PUBLIC_URLtoo — the container has no way to infer it. - The MCP stdio server itself isn't meant to run in Docker — it needs a local process wired to an MCP client's stdin/stdout. Point your MCP client at
npx -y sharedoc-mcpon the host as usual; only the standalone viewer daemon belongs in the container.
Environment variables:
The 9 tools
Privacy
Data flow, by backend:
- Gist backend: your document content is uploaded to GitHub as a secret gist under your account — GitHub's terms and retention apply. The local index stays in
~/.config/sharedoc-mcp/— it stores titles, URLs, timestamps, and the first 200 characters of each doc (for local content search); never the full content. Nothing is sent anywhere except GitHub via your ownghCLI. - Selfhost backend: content never leaves your machine unless you attach a tunnel — then it's served to whoever you gave the link (and the tunnel provider relays the traffic). Passwords are stored only as bcrypt hashes.
- sharedoc-mcp itself has no telemetry and calls no third-party service of its own.
Security semantics, honestly
- Gist links are bearer tokens: anyone with the URL reads the doc. Revoke deletes the gist immediately and irreversibly.
- Selfhost passwords are verified server-side before content is served; only WRONG attempts are rate-limited (5/minute per source+doc; a correct unlock clears the counter), with counters persisted in SQLite — restarting the server does not reset them. Behind a tunnel, all external visitors share one source address, so the practical limit is 5/minute per doc — stricter than per-visitor; one person mistyping can briefly lock a doc for others.
- There is deliberately no file-sharing tool: an arbitrary-path "share this file" tool is a prompt-injection exfiltration vector (
.env, keys) — a hijacked agent could publish secrets. Removed rather than allowlisted. - The viewer never binds beyond 127.0.0.1. Whether and how it reaches the internet is entirely your tunnel's configuration.
Develop
Versioning: every release bumps version in package.json, adds a CHANGELOG entry, and is published as a git tag + GitHub Release + npm.
To get update notifications: Watch this repo (Custom → Releases). npx -y fetches the latest published version on each cold run; your index and docs DB live outside the package — updating never touches them.
Status
v2.2.0 (CHANGELOG) — core logic is covered by 110 offline unit/integration tests (the gh CLI is mocked; HTTP tests run against 127.0.0.1 only; no network needed). The full flows have been manually verified (2026-07-25: real secret-gist create/index/delete via the built server over stdio JSON-RPC, and the selfhost password flow end-to-end — form → wrong password 401 → correct password 200 → rate-limit 429 → revoke 410 — plus lsof confirmation of the 127.0.0.1-only bind) on:
- macOS (Apple Silicon), Node v25 — gist + selfhost backends
Tunnel recipes are documented from the tools' standard behavior; Windows/Linux and real-tunnel end-to-end runs have not yet been verified — reports welcome. The manual pass above predates 2.2.0: its additions (update_shared_doc_content, view stats, pagination, Docker) are covered by the test suite but have not had an equivalent hands-on run.
License
MIT © AugustusW
來源:README.md,提交 96537d1
工具
0版本歷史
1- v2.1.4最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分