What the MCP server does
The Pagr MCP server exposes publishing tools to MCP-compatible AI agents. It gives agents a safe, explicit way to turn generated HTML into public https://uc.pagr.link/<slug> URLs without asking them to invent upload code.
The MCP server always requires authentication. ChatGPT uses Pagr’s OAuth login flow; local and bearer-token clients can use Pagr API keys. Use the CLI directly if you need anonymous one-shot publishing.
Native remote MCP
Pagr’s native remote MCP endpoint is:
https://mcp.getpagr.co/mcp
Use this endpoint with ChatGPT apps or other clients that support remote MCP over HTTP.
ChatGPT discovers OAuth metadata from the MCP host, opens Pagr login, and receives a scoped bearer token for the signed-in account.
For clients that do not support OAuth, pass a Pagr API key with one of these methods:
Authorization: Bearer pagr_...PAGR_API_KEY: pagr_...X-Pagr-Api-Key: pagr_...https://mcp.getpagr.co/mcp?PAGR_API_KEY=pagr_...
Prefer bearer-token or secret-field configuration when the client supports it. Query-string keys are convenient but can appear in client logs.
Local install
npm install -g @getpagr/mcp
Run without installing
npx -y @getpagr/mcp
This is the recommended command for local MCP client configuration because it keeps the server easy to update.
Required environment
Create a Pagr API key in the app and expose it to the MCP process.
export PAGR_API_KEY="pagr_..."
Optional environment
Override the Worker API URL when developing locally or testing a non-production worker.
export PAGR_WORKER_URL="https://pagr.link"
Claude Code config
Add Pagr as a local MCP server in .claude/settings.json.
{
"mcpServers": {
"pagr": {
"command": "npx",
"args": ["-y", "@getpagr/mcp"],
"env": {
"PAGR_API_KEY": "pagr_..."
}
}
}
}
For remote MCP, configure an SSE/HTTP server entry when your client supports it:
{
"mcpServers": {
"pagr": {
"type": "sse",
"url": "https://mcp.getpagr.co/mcp",
"headers": {
"Authorization": "Bearer pagr_..."
}
}
}
}
Claude Desktop config
Use the same local server entry in the Claude Desktop MCP configuration.
{
"mcpServers": {
"pagr": {
"command": "npx",
"args": ["-y", "@getpagr/mcp"],
"env": {
"PAGR_API_KEY": "pagr_..."
}
}
}
}
Available tools
upload_filepublishes a new HTML file and can request a custom slug.update_filereplaces the current HTML content for an existing slug.update_file_by_idreplaces HTML by stable document ID when a slug may have changed.list_fileslists files for the authenticated account.delete_filedeletes a file by slug.rename_filerenames a file slug and can update the title.
Update tools overwrite the current page content. Pagr does not keep older copies for restore.
Smithery
The Pagr MCP server is published on Smithery as getpagr/pagr.
Add the Smithery-hosted server:
npx -y smithery mcp add getpagr/pagr
Smithery lists the direct hosted endpoint as:
https://pagr.run.tools
See the Smithery integration guide for the verified backlink and setup notes.
Client examples
For Cursor, choose a remote MCP or SSE server if available, set the URL to https://mcp.getpagr.co/mcp, and add an Authorization: Bearer pagr_... header.
For ChatGPT, connect the Pagr app from the ChatGPT Apps marketplace. ChatGPT uses Pagr’s OAuth login — no API key needed. See the ChatGPT app guide for step-by-step instructions.
For Claude.ai Custom Connectors, use https://mcp.getpagr.co/mcp when the connector supports bearer auth. If it only accepts a URL, use the PAGR_API_KEY query parameter and rotate the key if the connector logs URLs.
For Windsurf and other local-only clients, use the npx -y @getpagr/mcp command with PAGR_API_KEY in the MCP environment.
Suggested agent workflow
Ask the agent to create the final HTML artifact locally, publish it with the Pagr MCP upload_file tool, and include the returned URL in its final response. When updating an existing artifact, store and reuse documentId with update_file_by_id.
Security notes
Do not put API keys directly into prompts. Prefer MCP environment configuration, bearer-token fields, or client secret storage. Treat generated HTML as public unless you add account-level protection such as password access.
Troubleshooting
If the local MCP server fails to start, confirm Node.js 20 or newer is available and that the MCP client can run npx. If tools return Missing PAGR_API_KEY, pass the key through the MCP server environment.
If the remote MCP server returns Missing bearer token, use the OAuth login flow in ChatGPT or configure Authorization: Bearer pagr_..., an API-key header, or a PAGR_API_KEY query parameter in API-key based clients.