sharedoc-mcp — Claude Code MCP server: turn agent Markdown into links
Publishes agent-written Markdown as a shareable link, using a secret gist through gh or a local SQLite server with passwords and expiry.
claude mcp add --env SHAREDOC_BACKEND=<SHAREDOC_BACKEND> --env SHAREDOC_PUBLIC_URL=<SHAREDOC_PUBLIC_URL> --transport stdio sharedoc-mcp -- npx -y sharedoc-mcpWhat sharedoc-mcp does
Agents keep producing Markdown: reports, digests, meeting notes. Handing that to someone else usually means dumping a wall of text into chat. This stdio server exposes nine tools so the agent can create a document, append to it, rewrite the content, extend the deadline, change the password, rename, revoke, delete and search by text.
One interface, two backends, chosen by an environment variable. The gist mode needs no setup: the document lands in a secret gist via a gh CLI you already signed into, and the unguessable URL is the only protection. The selfhost mode keeps everything on your disk in SQLite, checks passwords with bcrypt, throttles failed attempts and enforces expiry. A backend that cannot honour a parameter reports an error rather than ignoring it.
Node.js 22.13 or newer is required; the gist path also needs gh auth login. The viewer answers on 127.0.0.1 only, so exposing a link externally takes a tunnel you set up. A daemon mode, sharedoc-mcp serve, keeps selfhost links alive once the MCP client exits.
What it helps with
- hand off an agent report as one link instead of pasted text
- append new sections to a document that is already published
- lock a draft behind a password and an expiry date
- locate an old share link by its contents rather than its title
- rotate the password or revoke a document that went to the wrong person
Example prompts for the agent
- Publish this report as a document and give me the link
- Find the document where I wrote up that incident
- Put a password on this document and set it to expire in a week
How to install sharedoc-mcp
Platform CLI
claude mcp add --env SHAREDOC_BACKEND=<SHAREDOC_BACKEND> --env SHAREDOC_PUBLIC_URL=<SHAREDOC_PUBLIC_URL> --transport stdio sharedoc-mcp -- npx -y sharedoc-mcpReplace <…> with your own values
Platform CLI
codex mcp add sharedoc-mcp --env SHAREDOC_BACKEND=<SHAREDOC_BACKEND> --env SHAREDOC_PUBLIC_URL=<SHAREDOC_PUBLIC_URL> -- npx -y sharedoc-mcpReplace <…> with your own values
Config file
{
"mcpServers": {
"sharedoc-mcp": {
"command": "npx",
"args": [
"-y",
"sharedoc-mcp"
],
"env": {
"SHAREDOC_BACKEND": "<SHAREDOC_BACKEND>",
"SHAREDOC_PUBLIC_URL": "<SHAREDOC_PUBLIC_URL>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"sharedoc-mcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"sharedoc-mcp"
],
"env": {
"SHAREDOC_BACKEND": "<SHAREDOC_BACKEND>",
"SHAREDOC_PUBLIC_URL": "<SHAREDOC_PUBLIC_URL>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e SHAREDOC_BACKEND=<SHAREDOC_BACKEND> -e SHAREDOC_PUBLIC_URL=<SHAREDOC_PUBLIC_URL> sharedoc-mcp npx -y sharedoc-mcpReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about sharedoc-mcp
How do I install sharedoc-mcp in Claude Code?
Run claude mcp add sharedoc-mcp -- npx -y sharedoc-mcp. To pick a backend and a public URL, pass both as env vars: `claude mcp add --env SHAREDOC_BACKEND=<SHAREDOC_BACKEND> --env SHAREDOC_PUBLIC_URL=<SHAREDOC_PUBLIC_URL> --transport stdio sharedoc-mcp -- npx -y sharedoc-mcp`.
What does sharedoc-mcp do?
It gives the agent tools to publish Markdown documents and hands back a link. Search, expiry extension, password rotation and revocation come with it.
How is the gist backend different from selfhost?
The gist backend stores each document as a secret GitHub gist and needs only a signed-in gh. Selfhost keeps documents in SQLite on your machine and adds server-checked passwords with attempt limits plus enforced expiry.