# MCP server The official [`@pagedrop/mcp`](https://pagedrop.space/downloads) server exposes the v1 REST API as ten tools for Claude Code, Cursor, Claude Desktop and custom clients built with the [MCP SDK](https://github.com/modelcontextprotocol). Use **stdio** for local clients or **streamable HTTP** for your own remote deployment. ## Available tools | Tool | API | |---|---| | `pagedrop_upload(name, content, kind, folderId?, share?)` | `POST /v1/files` (multipart; a share block is **deferred**, not created — see below) | | `pagedrop_share({ fileId, ...policy })` | `POST /v1/shares` (file must have cleared its scan) | | `pagedrop_revoke(shareId)` | `DELETE /v1/shares/:id` | | `pagedrop_list_shares(fileId?)` | `GET /v1/shares` (how to find the share id `pagedrop_revoke` needs) | | `pagedrop_delete_file(fileId)` | `DELETE /v1/files/:id` (soft delete; revokes that file's share links) | | `pagedrop_get(fileId)` | `GET /v1/files/:id` | | `pagedrop_list_versions(fileId)` | `GET /v1/files/:id/versions` — the version ids a share can be pinned to with `lockedVersionId` | | `pagedrop_list(folderId?)` | `GET /v1/files` | | `pagedrop_me()` | `GET /v1/me` (the token's folder scope; call it after a 403 `FORBIDDEN`) | | `pagedrop_validate(content, kind)` | `POST /v1/validate` | API failures return MCP `isError: true` with `{ code, status, message }` in the content. Handle codes such as `RATE_LIMITED`, `INFECTED` and `SLUG_TAKEN` explicitly. ## ⚠️ Uploading is not sharing: wait for the scan The step agents get wrong most often. The workflow is always three calls: 1. **`pagedrop_upload`** returns a file id with `scanStatus: PENDING`. Even if you pass a `share` block, **no share is created** — the file cannot have cleared its security scan yet. The response reports `shareDeferred: true` with no `url`. 2. **`pagedrop_get`** in a loop until `scanStatus` is `CLEAN`. 3. **`pagedrop_share`** now creates the link and returns its URL. Calling `pagedrop_share` too early fails with `SCAN_PENDING` (425, retryable). `SCAN_ERROR` (scan service down) does not block sharing, but the file was never actually scanned — tell the user so. Overwriting an already-shared file sends it back to `PENDING`: until the new version passes, every share link on that file returns 425. ## stdio: Claude Code, Cursor and Claude Desktop ### Install ```bash npm install -g https://pagedrop.space/downloads/pagedrop-mcp-0.2.0.tgz ``` Alternatively run `npx -y https://pagedrop.space/downloads/pagedrop-mcp-0.2.0.tgz` without a global install. The npm name is reserved as `@pagedrop/mcp`; once published, `npm i -g @pagedrop/mcp` replaces the tarball URL. Note that an unrelated `pagedrop-mcp` package exists on npm (someone else’s HTML deployment tool) — this project only uses the scoped name. ### Configure For Claude Code, use a project `.mcp.json` (keep credentials out of Git) or `claude mcp add --scope user`: ```json { "mcpServers": { "pagedrop": { "command": "pagedrop-mcp", "env": { "PAGEDROP_API_URL": "https://pagedrop.space", "PAGEDROP_API_KEY": "pd_XXXXXXXX_YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY" } } } } ``` Cursor uses `~/.cursor/mcp.json`. Claude Desktop on macOS uses `~/Library/Application Support/Claude/claude_desktop_config.json`. Use the same JSON structure and the corresponding configuration path on other platforms. Restart your client; all seven `pagedrop_*` tools should appear. ### Get a token Open [API tokens](/developers/tokens), create a token and copy it into `PAGEDROP_API_KEY`. The plaintext token is shown only once. ## Streamable HTTP: your own remote deployment ```bash PAGEDROP_API_URL=https://pagedrop.space PAGEDROP_API_KEY=pd_xxx_yyy PORT=7180 HOST=0.0.0.0 pagedrop-mcp-http ``` Client configuration: ```json { "mcpServers": { "pagedrop": { "url": "http://your-host:7180/mcp", "transport": "streamable-http" } } } ``` The server is single-tenant: one process uses one `PAGEDROP_API_KEY`. Protect a production HTTP deployment with TLS and authenticated reverse proxy access. The default `HOST=127.0.0.1` binds only locally. PageDrop does not offer a public unauthenticated MCP endpoint. Health check: `GET /healthz` returns `{ ok: true, server: '@pagedrop/mcp', mode: 'streamable-http' }`. ## Prompt-to-upload example > Turn these notes into a clean Markdown summary, upload it to PageDrop and create a link valid for seven days: pricing increases by 5%; operations move to GMT; no hiring before Q4. Expected sequence: 1. Draft the Markdown. 2. Call `pagedrop_validate({ content, kind: 'MARKDOWN' })` to check line endings and code fences. 3. Call `pagedrop_upload({ name: 'notes.md', kind: 'MARKDOWN', content })` and keep the `fileId` — there is **no link yet**, the response reports `shareDeferred: true`. 4. Poll `pagedrop_get({ fileId })` until `scanStatus` is `CLEAN`. 5. Call `pagedrop_share({ fileId, expiresInDays: 7 })`. 6. Return the API's `url` and explain the applied access and expiration settings. ## Source and package downloads - Packages: - Source: `packages/mcp/src/` in the PageDrop repository - Tool schemas: `packages/mcp/src/tools.ts`