Share agent-generated Markdown as links β GitHub gists today, your own server tomorrow.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste into ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
Agent-generated Markdown β a link you can hand to anyone. GitHub gists today, your own server tomorrow.
English | ηΉι«δΈζ
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.
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.
sharedoc-mcp serve daemon mode β selfhost links keep working after your MCP client closesGET /healthz β identity-aware health probe for external monitoring / restart automationgh CLI β no tokens to manage, nothing new to hostnode:sqlite β zero native modules)marked + sanitize-html β scripts, event handlers, and javascript: URLs in shared content are strippeddefault-src 'none', nosniff, DENY framing, no-referrer, no-store) β exposure is a tunnel you control (recipes below)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_docs supports offset pagination (hasMore in the response) and, on selfhost, view stats (viewCount/lastViewedAt, counted on a successful render only)serve daemon, defaults to the same 127.0.0.1-only binding as everywhere elsenpm test passes on a clean checkoutRequires 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.1.0) if you want zero drift.
π
° gist (default) | π
± selfhost | |
|---|---|---|
| Setup | none β uses your logged-in gh CLI | none extra β data stays on your machine |
| Doc lives on | GitHub (secret gist) | your machine (SQLite) |
| Link reachable | anywhere, immediately | localhost β add a tunnel to share externally |
| Password | β (the secret URL is the protection) | β server-verified (bcrypt), rate-limited |
| Expiry | lazy β expired gists deleted on next use | enforced β expired links return 410 |
| Revoke | gist deleted immediately, irreversibly | immediate 410, content purged after 7-day grace |
| View stats | β (GitHub's gist API exposes no view-count data) | β viewCount + lastViewedAt, counted on a successful render only |
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.
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.
| Recipe | Fits you if | Setup |
|---|---|---|
| Tailscale private (recommended) | recipients are your own devices / people you can invite to your tailnet | tailscale serve --bg 8377 β https://<machine>.<tailnet>.ts.net, reachable only inside your tailnet β nothing is exposed to the public internet |
| Tailscale Funnel | share with anyone, no domain | tailscale funnel 8377 β same stable URL, but public |
| Cloudflare named tunnel | you own a domain | domain on Cloudflare, cloudflared tunnel create + route a hostname to http://127.0.0.1:8377 |
| cloudflared quick tunnel | one-off sharing | cloudflared tunnel --url http://127.0.0.1:8377 β random URL, changes every restart |
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.
Runs the same standalone serve daemon as above, in a container:
-v sharedoc-data:/data persists docs.db in a named volume β recreating the container keeps your docs.SHAREDOC_BIND_HOST=0.0.0.0 is required to reach the container at all. The viewer binds 127.0.0.1 by default β same as every other deployment in this README β and inside a container that's unreachable through docker run -p, because -p forwards to the container's network interface, not its loopback. Without this env var, docker logs will show the viewer listening, but the mapped host port will refuse every connection.0.0.0.0 means 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:8377 straight to the internet. Password-protecting individual docs (this backend's built-in feature) is not a substitute for that.http://<host>:8377 (a reverse proxy, a domain, a tunnel), set SHAREDOC_PUBLIC_URL too β the container has no way to infer it.npx -y sharedoc-mcp on the host as usual; only the standalone viewer daemon belongs in the container.Environment variables:
| Variable | Default | Meaning |
|---|---|---|
SHAREDOC_BACKEND | gist | gist or selfhost |
SHAREDOC_PORT | 8377 | viewer port (selfhost) |
SHAREDOC_BIND_HOST | 127.0.0.1 | viewer bind address (selfhost) β 0.0.0.0 to reach it from outside a Docker container; see Docker for the exposure tradeoff before changing this |
SHAREDOC_PUBLIC_URL | http://127.0.0.1:<port> | URL prefix in share links β set to your tunnel hostname |
SHAREDOC_DATA_DIR | ~/.local/share/sharedoc-mcp | SQLite location (selfhost) |
SHAREDOC_INDEX_PATH | ~/.config/sharedoc-mcp/index.json | local index (gist) |
MCP_CALLER | β | default author attribution for created docs |
| Tool | Does |
|---|---|
create_shared_doc | title + Markdown (+ optional password / expires_in_hours / author) β share URL |
append_to_shared_doc | append Markdown (not idempotent β a retry appends twice) |
update_shared_doc_content | replace the entire content (title/password/expiry unchanged) β idempotent, safe to retry |
extend_shared_doc | extend expiry by N hours |
reset_shared_doc_password | set / change / remove (null) the password (selfhost only) |
update_shared_doc_title | rename |
revoke_shared_doc | kill the link, keep the record (see backend table for semantics) |
delete_shared_doc | kill the link AND erase the record β irreversible; requires confirm: true (agents should get explicit user approval first) |
search_shared_docs | no args = list newest links; title substring, body-text search (selfhost: full content; gist: opening excerpt), status filter, offset paging (hasMore in the response), view stats on selfhost |
Data flow, by backend:
~/.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 own gh CLI..env, keys) β a hijacked agent could publish secrets. Removed rather than allowlisted.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.
v2.1.0 (CHANGELOG) β core logic is covered by 105 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:
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.
MIT Β© AugustusW
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/sharedoc-mcp)<a href="https://allmcps.com/mcp/sharedoc-mcp"><img src="https://allmcps.com/api/badge/sharedoc-mcp?style=directory" alt="Sharedoc Mcp on AllMCPs" /></a>