# Paste

> Paste (https://paste.bea.sh) is a pastebin for sharing text, code, logs, and files by link. Create a paste with one HTTP POST of the raw content and get its URL back; no account or API key is needed. Pastes can expire, be deleted after one read, and carry a language for syntax highlighting.

Agents can use the HTTP API below or the MCP server at `https://paste.bea.sh/mcp`.

- Anyone with a paste link can read or delete it. Do not paste secrets unless the user asks you to.
- Pastes are limited to 8 MiB. Without `ttl`, a paste expires after 30 days.
- Reading a burn-after-reading paste deletes it, so read it only when the user wants its contents.

## Create a paste

`POST https://paste.bea.sh/` with the raw content as the request body (not form-encoded, not JSON). Send `Accept: application/json` to get a JSON object instead of the plain-text link.

```sh
curl -q -fsS --data-binary @notes.txt -H 'Accept: application/json' 'https://paste.bea.sh/?ttl=3600&lang=python'
```

```json
{"id":"…","url":"https://paste.bea.sh/…","raw_url":"https://paste.bea.sh/raw/…","download_url":"https://paste.bea.sh/download/…","lang":"python","size":42,"burn":false,"encrypted":false,"expires_at":"2026-01-01T12:00:00.000Z"}
```

Query parameters (all optional):

- `ttl`: seconds until expiry; `0` never expires (when the server allows it).
- `burn`: `true` deletes the paste after it is read once.
- `lang`: highlighting language for the web view, e.g. `bash`, `python`, `json`, `diff`, `markdown`.

Give the user `url` to view the paste in a browser and `raw_url` for its plain contents.

## Read and delete

- `GET https://paste.bea.sh/raw/<id>`: the contents as `text/plain` (404 if missing, expired, or already burned).
- `GET https://paste.bea.sh/download/<id>`: the contents as a file download.
- `GET https://paste.bea.sh/<id>`: the highlighted HTML page for people; agents should prefer `/raw/<id>`.
- `DELETE https://paste.bea.sh/<id>`: deletes the paste.

Errors are plain text: 413 (too large), 422 (invalid parameter), 503 (maintenance, creation disabled).

## MCP

`https://paste.bea.sh/mcp` is a stateless MCP server over Streamable HTTP with no authentication. Tools: `create_paste`, `read_paste`, `delete_paste`.

```sh
claude mcp add --transport http paste https://paste.bea.sh/mcp
```

## Reference

- [OpenAPI 3.1 description](https://paste.bea.sh/openapi.json)
- [API catalog (RFC 9727)](https://paste.bea.sh/.well-known/api-catalog)
- [Command-line guide with shell and Python examples](https://paste.bea.sh/usage)
- [Web editor](https://paste.bea.sh/new)
