@posty5/mcp 1.2.0 → 2.1.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 +25 -10
- package/dist/bin/stdio.js +143 -1905
- package/dist/bin/stdio.js.map +1 -1
- package/dist/bin/stdio.mjs +144 -1906
- 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 +203 -1958
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +204 -1959
- package/dist/index.mjs.map +1 -1
- package/package.json +12 -14
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
|
|
|
@@ -60,13 +60,11 @@ The server writes the protocol to stdout and everything else to stderr.
|
|
|
60
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).
|
|
70
68
|
|
|
71
69
|
**Credit transfers** are read-only here: `account_get_credit_transfer_eligibility`
|
|
72
70
|
(can the account send — Business plan only — how many, and can it still receive
|
|
@@ -78,7 +76,7 @@ dashboard; no tool sends credits.
|
|
|
78
76
|
|
|
79
77
|
- `read` — lists and gets only.
|
|
80
78
|
- `write` — also creates and updates.
|
|
81
|
-
- `full` — also deletes
|
|
79
|
+
- `full` — also deletes and removals from social platforms.
|
|
82
80
|
|
|
83
81
|
A tool above the connection's level is not listed and is refused if called.
|
|
84
82
|
Irreversible or paid tools take `confirm`: called without `confirm: true` they
|
|
@@ -94,6 +92,14 @@ runs a bulk job and answers a **signed link to a ZIP of the images** that
|
|
|
94
92
|
expires within minutes; `qr_code_get_bulk_job` reports a job still running and
|
|
95
93
|
hands out fresh links. Webhook endpoints are not exposed through MCP.
|
|
96
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
|
+
|
|
97
103
|
### Visit analytics
|
|
98
104
|
|
|
99
105
|
`short_link_get_analytics` and `qr_code_get_analytics` (read) answer visits,
|
|
@@ -203,9 +209,11 @@ import { createPosty5McpNodeHandler } from "@posty5/mcp";
|
|
|
203
209
|
|
|
204
210
|
const handler = createPosty5McpNodeHandler({
|
|
205
211
|
sessionSecret: process.env.SESSION_SECRET!,
|
|
212
|
+
allowedOrigins: [], // no browser origin may call; desktop and server clients send none
|
|
206
213
|
resolve: async (req) => (await isValid(req)) ? { options: { access: "read", connection: () => ({ apiKey: "…" }) } } : { refusal: { status: 401, message: "Create a new MCP link." } },
|
|
207
214
|
});
|
|
208
|
-
|
|
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");
|
|
209
217
|
```
|
|
210
218
|
|
|
211
219
|
One handler serves the 2026-07-28 protocol and, statelessly, the 2025 era.
|
|
@@ -215,6 +223,13 @@ handler hands that identity back as a signed `Mcp-Session-Id`, which the
|
|
|
215
223
|
client echoes, so its later tool calls are attributed to it on any process.
|
|
216
224
|
Express: pass `req.body` as the third argument.
|
|
217
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
|
+
|
|
218
233
|
Output: CommonJS and ES modules, with type definitions; the binary is CommonJS.
|
|
219
234
|
|
|
220
235
|
## 📖 Guide
|