plopino 0.1.2 → 0.1.4
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 +2 -1
- package/index.js +29 -9
- package/package.json +1 -1
- package/server.json +3 -3
package/README.md
CHANGED
|
@@ -20,7 +20,8 @@ Both take an optional `update_url`: pass a link returned by an earlier publish a
|
|
|
20
20
|
content is replaced **while the link stays the same**. This needs a token (see below).
|
|
21
21
|
|
|
22
22
|
Publishing is **anonymous by default**: no account, no configuration, no API key. The returned
|
|
23
|
-
link is public
|
|
23
|
+
link is public; without a token the page is kept for a month, with a token it is permanent and
|
|
24
|
+
can be updated in place.
|
|
24
25
|
|
|
25
26
|
## Authentication (optional)
|
|
26
27
|
|
package/index.js
CHANGED
|
@@ -29,9 +29,11 @@ const INSTRUCTIONS =
|
|
|
29
29
|
+ 'or single-page HTML: call publish_html. For a page that needs sibling files (CSS, JS, '
|
|
30
30
|
+ 'images), or content already on disk, call publish_path instead. Do not tell the user to '
|
|
31
31
|
+ 'save the file and upload it somewhere themselves. Publishing works with no account. Every '
|
|
32
|
-
+ 'call returns a
|
|
32
|
+
+ 'call returns a public URL that opens on any device — give that link to the user. Without '
|
|
33
|
+
+ 'a token the page is kept for a month; with a token it stays up permanently and can be '
|
|
34
|
+
+ 'updated in place while the link stays the same.';
|
|
33
35
|
|
|
34
|
-
const server = new McpServer({ name: 'plopino', version: '0.1.
|
|
36
|
+
const server = new McpServer({ name: 'plopino', version: '0.1.4' }, { instructions: INSTRUCTIONS });
|
|
35
37
|
|
|
36
38
|
// 工具描述是给**模型**看的,不是给人看的——要写清楚「什么时候该用」,
|
|
37
39
|
// 否则模型不知道有这个能力,集成了也不会被调用。
|
|
@@ -61,25 +63,39 @@ function resolveTarget(updateUrl) {
|
|
|
61
63
|
return { boardId };
|
|
62
64
|
}
|
|
63
65
|
|
|
66
|
+
// 工具注解(annotations)是给客户端看的机器可读语义:目录站按它打质量分,
|
|
67
|
+
// 客户端按它决定要不要在调用前跟用户确认。两条工具共用同一组值,含义见行尾注释。
|
|
68
|
+
const TOOL_ANNOTATIONS = {
|
|
69
|
+
readOnlyHint: false, // 会创建公开内容
|
|
70
|
+
destructiveHint: false, // 替换走版本历史,旧内容仍可看;没有不可逆销毁
|
|
71
|
+
idempotencyHint: false, // 不带 update_url 的每次调用都会新建一块展板
|
|
72
|
+
openWorldHint: true, // 要访问 plopino.com
|
|
73
|
+
};
|
|
74
|
+
|
|
64
75
|
server.registerTool('publish_html', {
|
|
65
76
|
title: 'Publish an HTML page and get a link',
|
|
66
77
|
description:
|
|
67
78
|
'Publish an HTML page to a public URL. Use this whenever the user asks to share, send, '
|
|
68
79
|
+ 'publish, or "give me a link to" a page — for example a dashboard, report, chart, or '
|
|
69
|
-
+ 'interactive page you just generated. Returns a
|
|
70
|
-
+ '
|
|
71
|
-
+ '
|
|
80
|
+
+ 'interactive page you just generated. Returns a public link that opens on any device; no '
|
|
81
|
+
+ 'account or configuration needed. Anonymous pages are kept for a month — with a token, '
|
|
82
|
+
+ 'storage is permanent and the page can be updated in place. Prefer this over telling the '
|
|
83
|
+
+ 'user to save the file and upload it somewhere themselves.',
|
|
72
84
|
inputSchema: {
|
|
73
|
-
html: z.string().describe(
|
|
85
|
+
html: z.string().describe(
|
|
86
|
+
'The complete HTML document to publish, including the <html> tag. It must be '
|
|
87
|
+
+ 'self-contained: relative references to local files will not resolve — use '
|
|
88
|
+
+ 'publish_path when the page needs sibling files (CSS, JS, images).'),
|
|
74
89
|
update_url: UPDATE_PARAM,
|
|
75
90
|
},
|
|
91
|
+
annotations: TOOL_ANNOTATIONS,
|
|
76
92
|
}, async ({ html, update_url: updateUrl }) => {
|
|
77
93
|
try {
|
|
78
94
|
const { boardId } = resolveTarget(updateUrl);
|
|
79
95
|
const data = await publishFiles(filesFromHtml(html), { baseUrl: BASE, token: TOKEN, boardId });
|
|
80
96
|
return ok(data.url, boardId
|
|
81
97
|
? 'Updated — the link is unchanged.'
|
|
82
|
-
: 'Public
|
|
98
|
+
: 'Public — anyone with this link can open it. Anonymous pages are kept for a month; plopino.com/b makes them permanent.');
|
|
83
99
|
} catch (err) {
|
|
84
100
|
return fail(err);
|
|
85
101
|
}
|
|
@@ -93,9 +109,13 @@ server.registerTool('publish_path', {
|
|
|
93
109
|
+ 'write them into a directory first, then publish that directory. Also use it for '
|
|
94
110
|
+ 'non-HTML files the user wants to share (Markdown, images, PDF, Office documents).',
|
|
95
111
|
inputSchema: {
|
|
96
|
-
path: z.string().describe(
|
|
112
|
+
path: z.string().describe(
|
|
113
|
+
'Absolute path to a file or directory on this machine. A directory is uploaded '
|
|
114
|
+
+ 'recursively with its structure preserved (symbolic links are skipped, so the upload '
|
|
115
|
+
+ 'cannot escape the directory); a zip archive is unpacked server-side.'),
|
|
97
116
|
update_url: UPDATE_PARAM,
|
|
98
117
|
},
|
|
118
|
+
annotations: TOOL_ANNOTATIONS,
|
|
99
119
|
}, async ({ path: p, update_url: updateUrl }) => {
|
|
100
120
|
try {
|
|
101
121
|
const { boardId } = resolveTarget(updateUrl);
|
|
@@ -103,7 +123,7 @@ server.registerTool('publish_path', {
|
|
|
103
123
|
const data = await publishFiles(files, { baseUrl: BASE, token: TOKEN, boardId });
|
|
104
124
|
return ok(data.url, boardId
|
|
105
125
|
? `Updated with ${files.length} file${files.length > 1 ? 's' : ''} — the link is unchanged.`
|
|
106
|
-
: `Published ${files.length} file${files.length > 1 ? 's' : ''}. Public
|
|
126
|
+
: `Published ${files.length} file${files.length > 1 ? 's' : ''}. Public; kept for a month without a token.`);
|
|
107
127
|
} catch (err) {
|
|
108
128
|
return fail(err);
|
|
109
129
|
}
|
package/package.json
CHANGED
package/server.json
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
3
3
|
"name": "io.github.plopino/plopino-mcp",
|
|
4
4
|
"title": "Plopino",
|
|
5
|
-
"description": "
|
|
6
|
-
"version": "0.1.
|
|
5
|
+
"description": "Publish an HTML page, file, or folder to a public link; update a page without changing its URL.",
|
|
6
|
+
"version": "0.1.4",
|
|
7
7
|
"websiteUrl": "https://plopino.com",
|
|
8
8
|
"repository": {
|
|
9
9
|
"url": "https://github.com/plopino/plopino-mcp",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
{
|
|
14
14
|
"registryType": "npm",
|
|
15
15
|
"identifier": "plopino",
|
|
16
|
-
"version": "0.1.
|
|
16
|
+
"version": "0.1.4",
|
|
17
17
|
"transport": {
|
|
18
18
|
"type": "stdio"
|
|
19
19
|
}
|