<!-- Markdown rendering of tutorial.html for AI agents.
     The HTML page is the same content with diagrams and styling;
     this view exists so an agent spends its context on the instructions. -->
# Tutorials

Two ways to get documents out of PitchStation: share one or several files straight from your browser, or wire up your AI assistant — Claude Code, Codex, Kimi — to publish for you.

## Share multiple files as one link

A **bundle** packs several files into a single tracked share. Recipients open one link and get a sidebar to switch between every file — slides, a PDF appendix, images, notes — all under the same password, expiry, and analytics. You do it entirely from the browser; no tokens or config.

### Open the Share composer

Click **Share** in the top bar of any page — or press ⌘K / Ctrl K. (Signed out? You'll be asked to sign in first.)

### Add your files

On the **Upload file** tab, drag in several files at once — or click to browse and multi-select. Each appears in a staged list with its type and size.

**Supported:** HTML, PDF, images (PNG/JPG/GIF/WebP), Markdown, plain text, Word (.docx), and PowerPoint (.pptx). Up to **25 files**, 25 MB each and 100 MB per bundle.

### Pick the primary & tidy the list

With two or more files staged, choose one as **primary** (it seeds the share's preview and title) using the radio beside it, and remove any file with its **×**. Files keep the order you add them in.

### Set controls & create the link

Add a title (optional — auto-detected from a single HTML file), pick a preset — **Investor link**, **Team doc**, or **One-time view** — or open **Custom** for access, expiry, password, max views, watermark, downloads, and forwarding. Hit **Create link** to get a `/s/` URL, a password (if generated), and a QR code.

One page with a **file sidebar** on the left and the active file on the right. PDFs, images, HTML, and Markdown render inline; Office files show a clean download card. If you enabled downloads, a **Download all** button zips the whole bundle. The viewer chrome follows the reader's language (EN / 中文).

Manage it on your [Links](/shares.html) page — bundles carry a bundle badge and list their files, and analytics count opens across the whole bundle. **Replace** is hidden for bundles — to change the files, publish a new bundle.

**Prefer to do it from Claude Code?** The same bundle is created by passing a `files: [ … ]` array to `pitchstation_publish` — set that up below.

## Let your AI agent set itself up

You do **one** manual thing — create a token in step 1 and paste it into the field above. Then copy this prompt into Claude Code (or any MCP-capable agent) and it will download, register, and verify everything itself. Agents can also discover all of this on their own at [`/llms.txt`](/llms.txt).

## What you're connecting

### The MCP server

A tiny stdio JSON-RPC bridge — a **single file you download in step 2** (needs Node 18+) — that exposes three tools to your AI host: **publish**, **list**, and **revoke**. It authenticates to PitchStation with a Personal Access Token and talks to `/api/share` over HTTP(S).

### The skill

A Claude Code **skill** (a `SKILL.md` you download in step 4) that teaches the agent _when_ and _how_ to call those tools — mapping plain language like “share with a 7-day expiry and a password” onto the right arguments.

## Fill these in once

Every command and config block below updates live as you type. Nothing is sent anywhere — it's all rendered in your browser.

Your PAT is a credential. If you paste it here, don't share a screenshot of this page — the token is the equivalent of your password for the API.

### Create a Personal Access Token

The MCP server (and any direct API call) authenticates as you with a Personal Access Token — the `pst_…` value. It's shown once at creation; only a hash is stored, so PitchStation can never see it again.

- Open the [API Tokens](/tokens.html) page — it's under **Account** in the sidebar (or use the button below).

- Enter a descriptive **name** (e.g. `mcp-claude-code`) so you can recognise it later, then click **Create token**.

- Your `pst_…` token appears **once** — copy it immediately. Only its hash is stored, so it can't be shown again.

- Paste it into the **Personal Access Token** field above, or set it as your MCP host's `PITCHSTATION_TOKEN` environment variable (any casing works, e.g. `pitchstation_token`).

- Manage or **revoke** tokens anytime from the same page — revoking takes effect immediately.

### Download the MCP server

One file, no install, no dependencies — it runs with the Node.js (18+) you already have. This command downloads it straight from this server into your install folder:

Prefer a browser? [Download pitchstation-mcp-server.js](/downloads/pitchstation-mcp-server.js) and save it into that folder yourself.

### Register the MCP server

Point your MCP host at the downloaded file and pass the two env vars it needs: `PITCHSTATION_URL` and `PITCHSTATION_TOKEN` (key casing doesn't matter — `pitchstation_token` works too). Use an **absolute path** to the file — most MCP hosts don't expand `~`.

Recommended. Run this once; Claude Code stores it in your config.

Or edit `~/.claude/mcp_servers.json` (or your host's MCP config) directly:

**Other hosts** (Cline, Continue, …) use the same `command` + `args` + `env`. See your host's MCP configuration docs for where the JSON lives.

### Install the skill

Drop the skill into your Claude Code skills tree so the agent knows to reach for PitchStation when you ask to “share” or “publish”. It downloads from this server too:

Restart Claude Code (or reload skills) after installing, so it picks up the new skill and MCP server.

### Use it

In any Claude Code conversation, just ask. The skill maps your words onto the right share controls.

The agent invokes `pitchstation_publish`, which returns a `/s/` URL (plus any generated password). Manage everything afterward on your [Links](/shares.html) page.

## Test without Claude (optional)

Drive the MCP server directly over stdio to confirm the token + path work end to end. Paste your PAT above first so this is ready to run.

A successful run returns a `tools/call` result containing a `/s/…` URL.

## Tools & controls

### Three tools

| Tool | What it does |

| --- | --- |

| pitchstation_publish | Publishes content and returns a `/s/` URL. |

| pitchstation_list | Lists shares you own (optionally filtered by deck). |

| pitchstation_replace | Updates a shared document in place — same URL, same analytics. |

| pitchstation_revoke | Kills a share by slug. |

| pitchstation_space_create / _add / _list | Branded collections of shares behind one `/space/` URL. |

| pitchstation_expense_create | Creates an expense pack (receipts → AI itemize → approvable link). |

| pitchstation_invoice_create | Creates an invoice — with `send: true` it numbers, links, and emails the client in one call. |

### Access modes

| Mode | Who can open it |

| --- | --- |

| account | safe default Signed-in PitchStation users. Name people in `viewers` (emails or usernames): they become the allowlist and are **emailed the link automatically** — password included when protected, and signed in they skip the password screen. |

| link | Anyone with the URL. Pair with an expiry + password. |

| recipient | Per-person magic links — each recipient gets their own. |

### Say this → get this

| You ask for… | Control applied |

| --- | --- |

| “link anyone can open” | access: "link" |

| “expires in a week” | expires_in: "7d" |

| “one-time link” | max_views: 1 |

| “with a password” | password: true |

| “watermark with the viewer name” | watermark: true |

| “let people forward it” | allow_forward: true |

| “bundle these files as one share” | files: [ … ] |

| “share with alice and email her” | access: "account", viewers: ["alice@…"] |

## When something's off

| Symptom | Fix |

| --- | --- |

| `PITCHSTATION_TOKEN env var is required` | Set it in the MCP host's env (the `env` block in step 2). |

| HTTP 401 / 403 — invalid token | The PAT is missing, wrong, or revoked. Create a fresh one on [API Tokens](/tokens.html). |

| HTTP 413 — payload too large | 10 MB cap. Strip embedded base64 images, or publish as a PDF. |

| `pdfBase64 is not a valid PDF` | The input doesn't start with `%PDF-` — don't base64 an HTML file by accident. |

| `viewers only applies to account-mode shares` | `viewers` names who can sign in and open it — pair it with `access: "account"`. (`aclUsernames` is a legacy alias: same allowlist, no auto-email.) |

| Agent doesn't offer to publish | Confirm the skill is installed (step 3) and Claude Code was restarted; check the MCP server shows as connected. |

Want to read what you're installing? Both files are plain text: [the MCP server](/downloads/pitchstation-mcp-server.js) and [the skill](/downloads/publish-to-pitchstation-SKILL.md).
