@posty5/mcp 1.1.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -12
- package/dist/bin/stdio.js +255 -1900
- package/dist/bin/stdio.js.map +1 -1
- package/dist/bin/stdio.mjs +256 -1901
- package/dist/bin/stdio.mjs.map +1 -1
- package/dist/index.d.mts +16 -9
- package/dist/index.d.ts +16 -9
- package/dist/index.js +311 -1949
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +313 -1951
- package/dist/index.mjs.map +1 -1
- package/package.json +14 -15
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# @posty5/mcp
|
|
2
2
|
|
|
3
|
-
Every Posty5 service — short links, QR codes, hosted HTML pages
|
|
4
|
-
publishing
|
|
3
|
+
Every Posty5 service — short links, QR codes, hosted HTML pages and social
|
|
4
|
+
publishing — as [Model Context Protocol](https://modelcontextprotocol.io)
|
|
5
5
|
tools, for any AI assistant. One package holds the tool catalogue, the server
|
|
6
6
|
that serves it, and a stdio binary for clients that launch local servers.
|
|
7
7
|
|
|
@@ -55,24 +55,28 @@ The server writes the protocol to stdout and everything else to stderr.
|
|
|
55
55
|
|
|
56
56
|
| Toolset | On by default | What it covers |
|
|
57
57
|
| --- | --- | --- |
|
|
58
|
-
| `account` | always | Who the connection is, credits, live operation prices |
|
|
58
|
+
| `account` | always | Who the connection is, credits, credit transfers (read-only), live operation prices |
|
|
59
59
|
| `short-links` | ✅ | Short links, their controls (availability, password, routing, A/B split, UTM, pixels, health checks), tags and link campaigns |
|
|
60
|
-
| `qr-codes` | ✅ | QR codes of every type,
|
|
60
|
+
| `qr-codes` | ✅ | QR codes of every type, QR templates, download links (PNG / SVG / print PDF) and scannability checks |
|
|
61
61
|
| `html-hosting` | ✅ | Hosted pages, their variables, form submissions |
|
|
62
62
|
| `social-publisher` | ✅ | Workspaces, connected accounts, posts to every platform |
|
|
63
|
-
|
|
64
|
-
| `store-catalog` | — | Products and tags |
|
|
65
|
-
| `store-orders` | — | Orders and customers — shoppers' personal data reaches the assistant's provider |
|
|
66
|
-
| `store-shipping` | — | Countries, routes, profiles, assignments |
|
|
67
|
-
| `store-dropshipping` | — | Supplier catalogue, imports, product links, supplier orders |
|
|
63
|
+
73 tools in all; `listToolsets()` and `listTools()` describe them.
|
|
68
64
|
|
|
69
|
-
|
|
65
|
+
The store toolsets (`store`, `store-catalog`, `store-orders`, `store-shipping`,
|
|
66
|
+
`store-dropshipping`) left this package in 2.0.0: the Online Store Builder is
|
|
67
|
+
now Storvivo, and its tools are in [`@storvivo/mcp`](https://www.npmjs.com/package/@storvivo/mcp).
|
|
68
|
+
|
|
69
|
+
**Credit transfers** are read-only here: `account_get_credit_transfer_eligibility`
|
|
70
|
+
(can the account send — Business plan only — how many, and can it still receive
|
|
71
|
+
one on Free) and `account_list_credit_transfers` (sent and received, newest
|
|
72
|
+
first, counterparty masked). Sending is done by the user in the Posty5
|
|
73
|
+
dashboard; no tool sends credits.
|
|
70
74
|
|
|
71
75
|
## 🔐 Access levels and confirmation
|
|
72
76
|
|
|
73
77
|
- `read` — lists and gets only.
|
|
74
78
|
- `write` — also creates and updates.
|
|
75
|
-
- `full` — also deletes
|
|
79
|
+
- `full` — also deletes and removals from social platforms.
|
|
76
80
|
|
|
77
81
|
A tool above the connection's level is not listed and is refused if called.
|
|
78
82
|
Irreversible or paid tools take `confirm`: called without `confirm: true` they
|
|
@@ -88,6 +92,14 @@ runs a bulk job and answers a **signed link to a ZIP of the images** that
|
|
|
88
92
|
expires within minutes; `qr_code_get_bulk_job` reports a job still running and
|
|
89
93
|
hands out fresh links. Webhook endpoints are not exposed through MCP.
|
|
90
94
|
|
|
95
|
+
### Date filters on lists
|
|
96
|
+
|
|
97
|
+
`short_link_list`, `qr_code_list`, `html_page_list` and `social_post_list`
|
|
98
|
+
take `fromDate` / `toDate` (`YYYY-MM-DD`) to list what was created in a date
|
|
99
|
+
window — "the QR codes I created last week" is one call. The API applies the
|
|
100
|
+
window only when both are sent, in whole UTC days; a malformed date is refused
|
|
101
|
+
before any call. The account history takes the same pair.
|
|
102
|
+
|
|
91
103
|
### Visit analytics
|
|
92
104
|
|
|
93
105
|
`short_link_get_analytics` and `qr_code_get_analytics` (read) answer visits,
|
|
@@ -120,6 +132,20 @@ A link password is write-only: no result ever carries it (only
|
|
|
120
132
|
arguments. `pixelsConsentAcknowledged` is for the user to confirm, not the
|
|
121
133
|
assistant.
|
|
122
134
|
|
|
135
|
+
### QR downloads and scannability
|
|
136
|
+
|
|
137
|
+
| Tool | Access | Input | Answer |
|
|
138
|
+
| --- | --- | --- | --- |
|
|
139
|
+
| `qr_code_render` | read | `qrCodeId`, `format` (`png` / `svg` / `pdf`), `presetId?` (print size), `customMm?` (with `custom`), `dpi?` (150 / 300 / 600, PNG with a preset) | `{ url, expiresAt, expiresInMinutes, format, presetId?, sizeMm?, sizePx? }` — a signed link (about 1 hour), never the image itself |
|
|
140
|
+
| `qr_code_check_scannability` | read | exactly one of `qrCodeId` / `templateId`, `presetId?`, `customMm?` | `{ verdict, checks, symbol }` — `good` / `warning` / `poor`, each check with an English message |
|
|
141
|
+
|
|
142
|
+
A plain PNG works on every plan; SVG, PDF, a print size or a DPI may be
|
|
143
|
+
refused by the plan — the tool relays the API's message and adds that a plain
|
|
144
|
+
PNG is available. `dpi` without `presetId`, `dpi` on SVG/PDF and `custom`
|
|
145
|
+
without `customMm` are refused before any call. The preset list comes from
|
|
146
|
+
`@posty5/qr-design`. Designs themselves stay in the dashboard and the SDKs:
|
|
147
|
+
there is no template create/update tool (QD-D9). No credits.
|
|
148
|
+
|
|
123
149
|
### Dynamic QR codes
|
|
124
150
|
|
|
125
151
|
`qr_code_create` makes **dynamic** codes by default (`mode: "dynamic"`): the
|
|
@@ -183,9 +209,11 @@ import { createPosty5McpNodeHandler } from "@posty5/mcp";
|
|
|
183
209
|
|
|
184
210
|
const handler = createPosty5McpNodeHandler({
|
|
185
211
|
sessionSecret: process.env.SESSION_SECRET!,
|
|
212
|
+
allowedOrigins: [], // no browser origin may call; desktop and server clients send none
|
|
186
213
|
resolve: async (req) => (await isValid(req)) ? { options: { access: "read", connection: () => ({ apiKey: "…" }) } } : { refusal: { status: 401, message: "Create a new MCP link." } },
|
|
187
214
|
});
|
|
188
|
-
|
|
215
|
+
// Loopback only: on every interface, anyone on the network could call it.
|
|
216
|
+
http.createServer((req, res) => void handler(req, res)).listen(3021, "127.0.0.1");
|
|
189
217
|
```
|
|
190
218
|
|
|
191
219
|
One handler serves the 2026-07-28 protocol and, statelessly, the 2025 era.
|
|
@@ -195,6 +223,13 @@ handler hands that identity back as a signed `Mcp-Session-Id`, which the
|
|
|
195
223
|
client echoes, so its later tool calls are attributed to it on any process.
|
|
196
224
|
Express: pass `req.body` as the third argument.
|
|
197
225
|
|
|
226
|
+
Security: `resolve` is the only gate, so it must authenticate every request
|
|
227
|
+
(never hand out a fixed key unchecked). Listen on `127.0.0.1` unless the
|
|
228
|
+
server is meant to be public, and set `allowedOrigins` so a web page cannot
|
|
229
|
+
reach a local server through DNS rebinding. A host's own errors (from
|
|
230
|
+
`beforeToolCall` or `connection()`) reach `afterToolCall` as
|
|
231
|
+
`outcome.errorMessage`; the model only reads a fixed sentence.
|
|
232
|
+
|
|
198
233
|
Output: CommonJS and ES modules, with type definitions; the binary is CommonJS.
|
|
199
234
|
|
|
200
235
|
## 📖 Guide
|