New:Microsoft Teams Notifications Are Now Available in Socket.Learn more
Get Started

sharedoc-mcp

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sharedoc-mcp

Share agent-generated Markdown as links — GitHub gists today, your own server tomorrow. An MCP server.

Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
36
-25%
Maintainers
1
Weekly downloads
 
Created
Source

sharedoc-mcp

Share agent-generated Markdown as links. An MCP server that turns "here's the report" into a URL you can hand to anyone — backed by GitHub gists (zero setup) or your own machine (passwords, expiry, full control).

English | 繁體中文

Version 1.0.0 · CHANGELOG · MIT

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. sharedoc-mcp gives your agent 8 tools to publish, update, search, and revoke shareable documents, so "send this to my teammate" becomes a link.

Two backends, one interface

🅰 gist (default)🅱 selfhost
Setupnone — uses your logged-in gh CLInone extra — data stays on your machine
Doc lives onGitHub (secret gist)your machine (SQLite)
Link reachableanywhere, immediatelylocalhost — add a tunnel to share externally
Password✗ (the secret URL is the protection)✓ server-verified (bcrypt), rate-limited
Expirylazy — expired gists are deleted on next useenforced — expired links return 410
Revokegist deleted immediately, irreversiblyimmediate 410, content purged after a 7-day grace
File sharing✗ (gists are text-only)✓ (no password/expiry on files — link is the only protection)

The 8 MCP tools are identical on both; when a backend can't honor a parameter (e.g. password on gist), it returns a clear error instead of silently ignoring it.

Install

Requires Node.js ≥ 22.13.0. For the gist backend: GitHub CLI logged in (gh auth login).

Claude Code:

claude mcp add sharedoc --scope user -- npx -y sharedoc-mcp

Codex CLI (~/.codex/config.toml):

[mcp_servers.sharedoc]
command = "npx"
args = ["-y", "sharedoc-mcp"]

Any other MCP client: run npx -y sharedoc-mcp as a stdio server.

Quickstart (gist backend)

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 — use selfhost when you need passwords.

A local index (~/.config/sharedoc-mcp/index.json) tracks what you've shared, powering search_shared_docs and expiry cleanup. Expiry on this backend is lazy: expired gists are deleted the next time any tool runs, not at the exact expiry moment.

Selfhost backend

claude mcp add sharedoc --scope user --env SHAREDOC_BACKEND=selfhost -- npx -y sharedoc-mcp

Docs live in SQLite at ~/.local/share/sharedoc-mcp/; a viewer serves them at http://127.0.0.1:8377. The server only ever binds 127.0.0.1 — exposing it to the internet is deliberately left to a tunnel you control:

RecipeFits you ifSetup
Tailscale Funnel (recommended)no domain, want a stable URLinstall Tailscale, then tailscale funnel 8377 → stable https://<machine>.<tailnet>.ts.net; set SHAREDOC_PUBLIC_URL to it
Cloudflare named tunnelyou own a domainadd the domain to Cloudflare, cloudflared tunnel create + route a hostname to http://127.0.0.1:8377; set SHAREDOC_PUBLIC_URL
cloudflared quick tunnelone-off sharingcloudflared tunnel --url http://127.0.0.1:8377 → random trycloudflare.com URL that changes every restart; set SHAREDOC_PUBLIC_URL per session

Environment variables:

VariableDefaultMeaning
SHAREDOC_BACKENDgistgist or selfhost
SHAREDOC_PORT8377viewer port (selfhost)
SHAREDOC_PUBLIC_URLhttp://127.0.0.1:<port>the URL prefix returned in share links — set it to your tunnel hostname
SHAREDOC_DATA_DIR~/.local/share/sharedoc-mcpSQLite + files location (selfhost)
SHAREDOC_INDEX_PATH~/.config/sharedoc-mcp/index.jsonlocal index (gist)
MCP_CALLERdefault author attribution for created docs

Security semantics, honestly

  • Passwords are bcrypt-hashed and verified server-side before content is served; wrong-password attempts are rate-limited (5/minute per source+doc, HTTP 429). Behind a tunnel, all external visitors share one source address, so the practical limit is 5/minute per doc — stricter than per-visitor, and one person mistyping can briefly lock a doc for others.
  • Document content is rendered through marked and sanitized with sanitize-html — scripts, event handlers, and javascript: URLs in shared content are stripped.
  • Shared files have no password or expiry: the unguessable link is the only protection, indefinitely, and downloads are not rate-limited.
  • Two MCP clients can point at the same data dir: SQLite runs in WAL mode with a busy timeout, and if the viewer port is already taken by another sharedoc-mcp instance the second client keeps its tools and relies on the existing viewer.

The 8 tools

ToolDoes
create_shared_doctitle + Markdown (+ optional password / expires_in_hours / author) → share URL. Identical unprotected retries within 5 min return the same URL; a retry that adds a password or expiry always creates a new doc.
create_shared_fileshare a local file (selfhost only)
append_to_shared_docappend Markdown to an existing doc (not idempotent — a retry appends twice)
extend_shared_docextend expiry by N hours
reset_shared_doc_passwordset / change / remove (null) the password (selfhost only)
update_shared_doc_titlerename
revoke_shared_dockill the link (see backend table for semantics)
search_shared_docstitle substring + status filter

Develop

git clone https://github.com/AugustusW/sharedoc-mcp.git
cd sharedoc-mcp
npm install
npm test        # builds, then runs 52 offline tests — gh CLI is mocked, HTTP tests hit 127.0.0.1 only

Versioning: every release bumps version in package.json, adds a CHANGELOG entry, and is published as a git tag + GitHub Release + npm. Your index, docs DB, and files all live outside the package — updating never touches them.

License

MIT © AugustusW

FAQs

Package last updated on 25 Jul 2026

Related posts