Publish, update, list, delete, or manage HTML files with the Pagr CLI or remote MCP server...
Use this skill when the user wants to publish, update, list, delete, or manage HTML files with the Pagr CLI or through the remote MCP server.
pagr upload <file> for HTML files.<meta name="pagr-id"> or <meta name="pagr-slug">, pagr upload <file> may update the existing page instead of creating a new one.PAGR_API_KEY in CI instead of writing ~/.pagr/config.json.You can connect to Pagr's remote Model Context Protocol (MCP) server over SSE (Server-Sent Events) to allow any MCP-compatible agent to publish files directly.
The remote MCP server endpoint is:
https://mcp.getpagr.co/mcp?PAGR_API_KEY=pagr_tW2NdRvtqZq2CIb0oJ137rfh75ystZoeoOQiSd7aMDc
When using an MCP-compatible client (like Claude.ai Web App Custom Connectors, Cursor IDE, or others), configure the Server URL pointing to the endpoint above. This allows the client to call tools like upload_file and publish pages seamlessly.
npm install -g @getpagr/cli
Pagr CLI requires Node.js 20 or newer. The installed command is pagr.
Browser login:
pagr login
pagr login starts a browser login flow, authenticates with Pagr, receives a CLI API key through a local callback, and saves it to ~/.pagr/config.json.
Manual login for SSH, headless, or locked-down environments:
pagr login --manual
Save a key without prompting:
pagr login --key pagr_...
Set a key directly in local config:
pagr config set-key pagr_...
API keys must start with pagr_.
Config location:
~/.pagr/config.json
Auth lookup order:
PAGR_API_KEY~/.pagr/config.jsonpagr upload report.html
Behavior:
CI is set, also prints:PAGR_SLUG=...
PAGR_URL=...
Set a page title:
pagr upload report.html --title "Weekly report"
pagr upload report.html -t "Weekly report"
Request a stable readable slug:
pagr upload report.html --slug weekly-report
pagr upload report.html -s weekly-report
Use both:
pagr upload report.html --slug weekly-report --title "Weekly report"
--title sends X-Pagr-Title. --slug requests a stable readable URL. Custom slugs can be plan-gated.
pagr upload report.html --update --slug weekly-report
pagr upload report.html -u -s weekly-report
Behavior:
<meta name="pagr-id" content="...">
<meta name="pagr-slug" content="weekly-report">
Update priority:
pagr-id updates by stable document ID.pagr-slug updates by slug.--update --slug forces update by slug.Inject Pagr metadata into the source file:
pagr upload report.html --inject
--inject writes Pagr metadata into the local HTML source after upload. If a new upload has no pagr-slug, the CLI auto-injects metadata for future updates. This modifies the local source HTML file.
pagr ls
pagr ls --limit 20
Default limit is 50. Output includes slug, views, plan, title, and URL. If no files exist, the CLI prints No files found.
pagr rm weekly-report
pagr rm weekly-report --yes
pagr rm weekly-report -y
Without --yes, the CLI asks for confirmation and accepts y or yes. Delete is not reversible.
pagr config show
pagr config set-key pagr_...
pagr config set-url https://pagr.link
pagr config show masks the API key. set-key requires a pagr_ prefix. set-url overrides the Worker API URL in local config. Environment variables override local config.
pagr init
pagr init --no-claude
pagr init --no-mcp
pagr init writes:
SKILL.md.claude/skills/pagr/SKILL.md unless --no-claude.agents/skills/pagr/SKILL.md.claude/settings.json MCP server config unless --no-mcpMCP config:
{
"mcpServers": {
"pagr": {
"command": "npx",
"args": ["-y", "@getpagr/mcp"]
}
}
}
Use PAGR_API_KEY in CI. Do not write ~/.pagr/config.json in CI.
- name: Publish HTML report
run: pagr upload output/report.html --title "Nightly report"
env:
PAGR_API_KEY: ${{ secrets.PAGR_API_KEY }}
When CI is set, use the machine-readable PAGR_SLUG and PAGR_URL output lines.
PAGR_API_KEY: overrides the locally saved key.PAGR_WORKER_URL: overrides the Worker API URL. Default is https://pagr.link.PAGR_APP_URL: overrides the app URL used by pagr login. Default is https://app.getpagr.co.CI: makes upload print machine-readable PAGR_SLUG and PAGR_URL.Common failures:
pagr login, run pagr login --manual, or set PAGR_API_KEY.pagr_.--update or use the correct slug.If browser login fails, use pagr login --manual. If upload fails due to plan or file limit, surface the CLI error and tell the user to check account plan and file size.
--slug.pagr-id or pagr-slug, use plain pagr upload <file> unless the user asks for a new page.pagr upload <file> --update --slug <slug>
PAGR_URL.