Developers
API & MCP for Developers and AI Agents
TextShareNow Pro includes a small HTTP API and an MCP server, so scripts and AI agents can create and receive shares without a browser. Your license key is the only credential — no extra account, no OAuth.
Step 1
Your license key is the API key
There is no separate token to generate. Subscribe to Pro, copy the license key from your Gumroad receipt, and send it as a Bearer token. The same key unlocks the website and the API, and it works on every device you own.
textsharenow.com over HTTPS, stored in your client config, and cached server-side only as a SHA-256 hash. Never commit it to a public repo. Step 2
Add the MCP server
textsharenow-mcp is a local stdio MCP server. It talks to the TextShareNow API with your key and exposes four tools to the agent. Requires Node 18 or newer.
opencode
Add this to ~/.config/opencode/opencode.json (or a project-level opencode.json):
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"textsharenow": {
"type": "local",
"command": ["npx", "-y", "textsharenow-mcp@latest"],
"enabled": true,
"environment": {
"TEXTSHARENOW_LICENSE_KEY": "YOUR-LICENSE-KEY"
}
}
}
}Claude Code
claude mcp add textsharenow \
--env TEXTSHARENOW_LICENSE_KEY=YOUR-LICENSE-KEY \
-- npx -y textsharenow-mcp@latestClaude Desktop and Cursor
Both use an mcpServers block. For Claude Desktop, edit claude_desktop_config.json; for Cursor, use .cursor/mcp.json.
{
"mcpServers": {
"textsharenow": {
"command": "npx",
"args": ["-y", "textsharenow-mcp@latest"],
"env": {
"TEXTSHARENOW_LICENSE_KEY": "YOUR-LICENSE-KEY"
}
}
}
}What the agent can do
| Tool | Purpose |
|---|---|
| share_text | Create a share link with optional expiry, read limit, password, and custom code. |
| peek_share | Check expiry, remaining reads, and password status without consuming a read. |
| receive_text | Fetch the text behind a code. Consumes one read; single-use shares are deleted. |
| delete_share | Delete a share created with the same license key. |
Example prompts
- “Share this JSON as a link that expires in 10 minutes, then give me the URL.”
- “Peek at code K7Q2P — has it been read yet?”
- “Receive code K7Q2P. The password is hunter2.”
- “Delete the share you just created.”
Package: textsharenow-mcp · Set TEXTSHARENOW_API_BASE only if you self-host the API.
Step 3
Or call the HTTP API
Every endpoint is the same one the website uses. Send Authorization: Bearer <license-key> for Pro limits; omit it for free-plan limits. Retrieving and peeking need no auth — the code itself is the capability.
| Method | Path | Auth | Purpose |
|---|---|---|---|
| POST | /api/share | Optional key | Create a share. Pro limits with a license key, free limits without. |
| GET | /api/share/:code | None | Read the text. Consumes one read. |
| GET | /api/share/:code/meta | None | Peek at expiry, reads, and password status. |
| DELETE | /api/share/:code | License key | Delete a share you created. |
| GET | /api/pro/status | License key | Validate a key; returns { pro, via }. |
Create a share
export TSN_KEY="YOUR-LICENSE-KEY"
curl -X POST https://www.textsharenow.com/api/share \
-H "Authorization: Bearer $TSN_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"hello from the API","ttl":600,"maxReads":5}'{
"code": "K7Q2P",
"ttl": 600
} The share opens at https://www.textsharenow.com/r?code=K7Q2P.
Request body
text— required, up to 100,000 characters on Pro (10,000 free).ttl— seconds: 600, 1800, 3600 on free; Pro adds 86400, 604800, 2592000, or 0 (never). Default 600.maxReads— 1, 5, 10, or 0 (unlimited). Pro only. Default 1.customCode— 3–30 characters (letters, numbers, - and _). Pro only.passwordHash— Pro only; a PBKDF2 verifier in the formp2$210000$<salt-hex>$<derived-hex>. (The browser's private mode uses a p3 verifier for zero-knowledge shares — p3 is not needed for API shares.)
Read, peek, delete
# Read — consumes one read
curl https://www.textsharenow.com/api/share/K7Q2P
# Peek — no read consumed, no content returned
curl https://www.textsharenow.com/api/share/K7Q2P/meta
# Delete — only shares created with the same license key
curl -X DELETE https://www.textsharenow.com/api/share/K7Q2P \
-H "Authorization: Bearer $TSN_KEY" Reading returns {"text":"…","readsLeft":4}. Peeking returns expiry, read counts, and whether a password is required. Deleting returns {"ok":true}.
Passwords
Plaintext passwords never reach the server. Derive the hash client-side with PBKDF2-HMAC-SHA256 (210,000 iterations, a random 16-byte salt, 32-byte output), then send it at creation:
import { pbkdf2Sync, randomBytes } from "node:crypto";
const salt = randomBytes(16).toString("hex");
const derived = pbkdf2Sync(password, Buffer.from(salt, "hex"), 210000, 32, "sha256").toString("hex");
const passwordHash = `p2$210000$${salt}$${derived}`; A read without a password returns 401 with the salt and iteration count. Derive the same value and retry with the x-share-password header — not the URL, so the verifier never lands in access logs:
curl https://www.textsharenow.com/api/share/K7Q2P \
-H "x-share-password: $PASSWORD_HASH"The MCP server does this for you.
Step 4
Limits, errors, and safety
The API is intentionally small and bounded. Shares behave exactly like website shares: same expiry, same read limits, same password rules, same auto-deletion.
Rate limits
- Create: 10/min per IP and 20/min per license.
- Read: 20/min per IP.
- Peek: 60/min per IP.
- Delete: 20/min per IP.
Error codes
- 401 — password required (includes KDF params).
- 403 — not Pro, wrong password, or not your share.
- 404 — code expired or never existed.
- 422 — invalid input or plan limit exceeded.
- 429 — rate limited; retry after a minute.
Ownership. Delete only works for shares created with the same license key. Anyone with the code can read a share, but only the key that created it can remove it early.
Dashboard. Prefer a UI? Open My Shares with the same license key to list, copy, and delete active text shares.
Key handling. The raw key is never logged; the server caches a SHA-256 hash for 24 hours and re-verifies with Gumroad daily. Invalid Bearer keys fail closed if Gumroad is unreachable.
Files. API and MCP are text-only for now (up to 100,000 characters). File transfers still go through the website.
Give your agent a share tool.
One license key, one npm package, four tools. Works with any MCP client.
Node 18+ · npx -y textsharenow-mcp@latest