MCP server
PDF Invoice runs a remote Model Context Protocol (opens in a new tab) server. One server serves every store; the credential you send decides which store you work on.
| Server URL | https://pdfinvoice.apps.avada.io/mcp/v1 |
| Transport | Streamable HTTP, JSON responses only (POST). SSE is not supported, a GET returns 405. |
| Protocol | JSON-RPC 2.0. MCP versions 2025-06-18, 2025-03-26 and 2024-11-05 |
| Methods | initialize, notifications/initialized, ping, tools/list, tools/call |
The merchant-facing setup for each AI tool is in AI connections.
Authentication
There are two ways to authenticate. Both are created and managed by the merchant in Settings > AI connections.
API key
For clients that take a static token (Claude Code, Cursor, VS Code, scripts and your own agents).
- In the app, go to Settings > AI connections, select your tool or Other, then Generate API key.
- Send the key as a Bearer token on every request:
POST /mcp/v1 HTTP/1.1
Host: pdfinvoice.apps.avada.io
Authorization: Bearer pdfmcp_xxxxxxxxxxxxxxxx
Content-Type: application/json
{"jsonrpc":"2.0","id":1,"method":"tools/list"}- Keys start with
pdfmcp_. - A key expires after 30, 60 or 90 days (default 90), or never. The merchant chooses when creating it.
- The full key is shown only once. After a page reload the app shows its last 4 characters.
OAuth 2.1
For clients that sign in (Claude, ChatGPT). Point the client at the server URL and it discovers everything else:
| Endpoint | Path |
|---|---|
| Protected resource metadata | /.well-known/oauth-protected-resource |
| Authorization server metadata | /.well-known/oauth-authorization-server |
| Dynamic client registration | /oauth/register |
| Authorize | /oauth/authorize |
| Token | /oauth/token |
- Authorization code flow with PKCE (
S256). Public clients, no client secret. - Scopes:
read(Read only) orfull(Full access). The merchant picks one on the Shopify consent screen. - Access tokens last 1 hour. Refresh tokens last 90 days, and the 90 days restart each time the token is refreshed.
- A store can have up to 10 sign-in connections at a time.
An unauthenticated request returns 401 with a WWW-Authenticate header that points to the resource metadata.
Permissions
Each tool needs one permission. A tool the credential isn't allowed to use is hidden from tools/list, and calling it returns an error that tells the merchant to grant it under Settings > AI connections > Edit access.
| Group | Permission | Tools |
|---|---|---|
| Read | orders.read | Orders and invoice email status |
| Read | templates.read | Templates, designs, Liquid, variables, preview |
| Read | settings.read | App settings |
| Read | emails.read | Automatic invoice email |
| Read | deliveries.read | FTP, SFTP and Google Drive deliveries |
| Read | analytics.read | Invoice and email counts |
| Actions | templates.write | Create and edit templates |
| Actions | settings.write | Edit app settings |
| Actions | emails.write | Edit and turn on/off the automatic email |
| Actions | emails.send | Re-send an invoice email |
Read only grants every Read permission. Full access grants everything. Custom grants only what the merchant ticks.
Tools that change data only run when the call includes "confirm": true (a real boolean). Ask the user before you send it.
See the Tool reference for the permission of each tool.
Limits and errors
- Rate limit: 60
tools/callrequests per minute per key or sign-in connection. Over the limit, the call returns a tool error and aRetry-Afterheader. - Plan: below the Professional plan,
initializeandtools/liststill work, but every tool call returns an error. Keys are kept and work again after an upgrade. - Paused, revoked or expired credential:
401. The merchant can resume a paused key; an expired or revoked one must be replaced. - Secrets are never returned: SMTP passwords, delivery credentials and other secrets are left out of every response.
Quick test with curl
curl -s https://pdfinvoice.apps.avada.io/mcp/v1 \
-H "Authorization: Bearer $PDF_INVOICE_MCP_KEY" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"get_invoice_status","arguments":{"order_name":"#1001"}}}'