mdshare API
Base URL: https://mdshare.live
Zero-login markdown sharing. Upload, get links, collaborate. No accounts needed.
Raw markdown: curl https://mdshare.live/docs/raw
Quick Start
Upload a document
curl -X POST https://mdshare.live/api/documents \
-H "Content-Type: text/markdown" \
--data-binary @your-file.mdResponse:
{
"document_id": "abc123",
"admin_key": "adm_xK9mQ4r8...",
"admin_url": "https://mdshare.live/d/abc123?key=adm_xK9mQ4r8..."
}Save the admin_key — it's your master key. If lost, admin access is lost.
Read a document
# JSON (default)
curl "https://mdshare.live/api/d/{id}?key={any_valid_key}"
# Raw markdown
curl -H "Accept: text/markdown" "https://mdshare.live/api/d/{id}?key={key}"Update a document
curl -X PUT "https://mdshare.live/api/d/{id}?key={edit_or_admin_key}" \
-H "Content-Type: text/markdown" \
--data-binary @updated.mdPatch a document (find/replace)
curl -X PATCH "https://mdshare.live/api/d/{id}?key={edit_or_admin_key}" \
-H "Content-Type: application/json" \
-d '{
"operations": [
{ "find": "old text", "replace": "new text" }
],
"author": "Your Name"
}'Response:
{
"applied": 1,
"operations": [{ "index": 0, "status": "ok" }],
"content_hash": "abc123..."
}Each find must be unique in the document. Set replace_all: true to replace all occurrences. Statuses: ok, not_found, ambiguous, invalid.
Generate a share link (admin only)
curl -X POST "https://mdshare.live/api/d/{id}/links?key={admin_key}" \
-H "Content-Type: application/json" \
-d '{"permission": "edit", "label": "for-team"}'Key Types
| Prefix | Permission | Can do |
|---|---|---|
adm_ | Admin | Read, write, delete, manage links, manage comments |
edt_ | Edit | Read, write, comment |
cmt_ | Comment | Read, add comments |
viw_ | View | Read only |
Endpoints
Documents
| Method | Endpoint | Auth | Description |
|---|---|---|---|
POST | /api/documents | None | Create document |
GET | /api/d/:id?key=KEY | Any | Read document |
PUT | /api/d/:id?key=KEY | Edit/Admin | Update document (full rewrite) |
PATCH | /api/d/:id?key=KEY | Edit/Admin | Patch document (find/replace) |
DELETE | /api/d/:id?key=KEY | Admin | Delete document |
Links (admin only)
| Method | Endpoint | Auth | Description |
|---|---|---|---|
POST | /api/d/:id/links?key=KEY | Admin | Create share link |
GET | /api/d/:id/links?key=KEY | Admin | List all links |
PATCH | /api/links/:token?key=KEY | Admin | Modify or revoke link (set is_active, permission, label) |
DELETE | /api/links/:token?key=KEY | Admin | Delete link permanently |
Comments
| Method | Endpoint | Auth | Description |
|---|---|---|---|
POST | /api/d/:id/comments?key=KEY | Comment/Edit/Admin | Add comment (body: content, author_name, anchor_text, parent_id). Replies nest one level. |
GET | /api/d/:id/comments?key=KEY | Any | List comments |
PATCH | /api/comments/:id?key=KEY | Edit/Admin | Resolve comment |
Versions (edit history)
| Method | Endpoint | Auth | Description |
|---|---|---|---|
GET | /api/d/:id/versions?key=KEY | Any | List edit history (who, when, via what) |
The GET /api/d/:id response also includes last_edited_by, last_edited_via, and last_edited_at.
Presence
| Method | Endpoint | Auth | Description |
|---|---|---|---|
POST | /api/d/:id/presence?key=KEY | Any | Heartbeat (body: session_id, name) |
GET | /api/d/:id/presence?key=KEY | Any | Get who's online |
Rate Limits
| Endpoint | Limit |
|---|---|
POST /api/documents | 10 per minute per IP |
PUT /api/d/:id | 30 per minute per IP |
POST /api/d/:id/comments | 20 per minute per IP |
Errors
| Code | Meaning |
|---|---|
400 | Invalid content (binary, empty, too large) |
403 | Insufficient permission |
404 | Document not found or invalid key |
429 | Rate limited (check Retry-After header) |
Notes
- Content is sanitized server-side (no raw HTML, XSS protection)
- Binary files are rejected (magic byte detection)
- Links only allow
http:,https:,mailto:protocols - All content should be treated as user-generated
- API responses include
X-Content-Source: user-generatedheader - Write endpoints (POST/PUT/PATCH) return
Server-Timingheaders and aprocessing_msfield for latency tracking
Use with AI
See /share-markdown-with-ai for a dedicated guide with per-client setup, tool reference, and FAQs.
MCP Setup
mdshare works as an MCP server with Claude, ChatGPT/Codex, and Gemini CLI.
npx mdshare-mcpClaude Desktop / Claude Code
Add to ~/.claude/claude_desktop_config.json:
{
"mcpServers": {
"mdshare": {
"command": "npx",
"args": ["mdshare-mcp"]
}
}
}OpenAI Codex CLI
Add to ~/.codex/config.json:
{
"mcpServers": {
"mdshare": {
"command": "npx",
"args": ["mdshare-mcp"]
}
}
}Gemini CLI
Add to ~/.gemini/settings.json:
{
"mcpServers": {
"mdshare": {
"command": "npx",
"args": ["mdshare-mcp"]
}
}
}Cursor
Add to ~/.cursor/mcp.json:
{
"mcpServers": {
"mdshare": {
"command": "npx",
"args": ["mdshare-mcp"]
}
}
}Windsurf
Add to ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"mdshare": {
"command": "npx",
"args": ["mdshare-mcp"]
}
}
}What to tell your AI
- “Upload my-notes.md to mdshare and give me an edit link”
- “Read this mdshare document and summarize the comments”
- “Incorporate the feedback and resolve the comments”
- “Share this markdown with view-only access”
- “Who edited this document last?”
- “Post a comment on the budget section”
- “List all links for this document”
- “Revoke the edit link I shared with the team”
- “Save this mdshare document to /tmp/notes.md”
Tip: When uploading a file already on disk, the MCP server reads it directly via file_path instead of echoing the bytes through the conversation. This is dramatically faster for AI workflows. Same for downloads via output_path.
Without MCP (works with any AI)
No setup needed. Just tell your AI chatbot:
Read https://mdshare.live/docs/raw to learn the mdshare API,
then upload this markdown and give me a share link.Works with Claude, ChatGPT, Gemini, Copilot, or any AI that can make HTTP calls.
VS Code Extension
Share markdown files directly from VS Code. Right-click any .md file or select text and share it instantly. Also works in Cursor and Windsurf since they support the VS Code extension format.
Install
- Open the Extensions panel in VS Code (
Cmd+Shift+XorCtrl+Shift+X) - Search for mdshare and click Install, or install directly from the Marketplace page
Or install manually: download mdshare-vscode.vsix, then Cmd+Shift+P → Install from VSIX.
Usage
- Share a file: Right-click a
.mdfile in the Explorer → “Share on mdshare” - Share a selection: Select text in any editor → right-click → “Share Selection on mdshare”
The admin URL is automatically copied to your clipboard.
Obsidian Plugin
Share markdown files directly from Obsidian. Right-click any file, select text, or use the command palette. Listed in the official Obsidian Community Plugins directory.
Install via Community Plugins (recommended)
- Open Obsidian → Settings → Community Plugins
- If you haven’t already, turn off Restricted Mode
- Click Browse and search for
mdshare - Click Install, then Enable
Alternative: BRAT (for beta builds)
- Install BRAT from Community Plugins
- In BRAT settings, click “Add Beta Plugin”
- Enter:
urbanmorph/obsidian-mdshare
Use BRAT only if you want to test pre-release builds before they ship to the directory.
Alternative: manual install
- Download main.js and manifest.json
- Create a folder:
<your-vault>/.obsidian/plugins/mdshare/ - Copy both files into that folder
- Enable in Settings → Community Plugins
Usage
- Share a file: Right-click a file in the explorer → “Share on mdshare”
- Share a selection: Select text → right-click → “Share selection on mdshare”
- Command palette:
Cmd/Ctrl+P→ “mdshare: Share current file”
The admin URL is automatically copied to your clipboard.