brewpage-mcp 1.1.0 → 1.1.1
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/dist/index.js +9 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { z } from "zod";
|
|
|
5
5
|
const BASE_URL = process.env.BREWPAGE_URL || "https://brewpage.app";
|
|
6
6
|
const server = new McpServer({
|
|
7
7
|
name: "brewpage-mcp",
|
|
8
|
-
version: "1.
|
|
8
|
+
version: "1.1.1",
|
|
9
9
|
});
|
|
10
10
|
async function apiRequest(method, path, body, headers) {
|
|
11
11
|
const url = `${BASE_URL}${path}`;
|
|
@@ -229,7 +229,7 @@ server.tool("get_stats", "Get BrewPage platform-wide usage statistics including
|
|
|
229
229
|
],
|
|
230
230
|
};
|
|
231
231
|
});
|
|
232
|
-
server.tool("publish_site", "Publish a
|
|
232
|
+
server.tool("publish_site", "Publish a single-page HTML site to BrewPage. Accepts HTML content as the entry file (index.html). For multi-file sites with CSS/JS/images, use the REST API directly. Returns a public URL and owner token.", {
|
|
233
233
|
entryContent: z.string().describe("HTML content for the site entry file (index.html)"),
|
|
234
234
|
namespace: z
|
|
235
235
|
.string()
|
|
@@ -245,7 +245,11 @@ server.tool("publish_site", "Publish a multi-file HTML site to BrewPage. Provide
|
|
|
245
245
|
.max(30)
|
|
246
246
|
.optional()
|
|
247
247
|
.describe("Time to live in days (1-30, default: 5)"),
|
|
248
|
-
|
|
248
|
+
ownerToken: z
|
|
249
|
+
.string()
|
|
250
|
+
.optional()
|
|
251
|
+
.describe("Existing owner token to group this site under the same owner as previous content"),
|
|
252
|
+
}, async ({ entryContent, namespace, password, ttlDays, ownerToken }) => {
|
|
249
253
|
const formData = new FormData();
|
|
250
254
|
const entryBlob = new Blob([entryContent], { type: "text/html" });
|
|
251
255
|
formData.append("files", entryBlob, "index.html");
|
|
@@ -257,6 +261,8 @@ server.tool("publish_site", "Publish a multi-file HTML site to BrewPage. Provide
|
|
|
257
261
|
const headers = {};
|
|
258
262
|
if (password)
|
|
259
263
|
headers["X-Password"] = password;
|
|
264
|
+
if (ownerToken)
|
|
265
|
+
headers["X-Owner-Token"] = ownerToken;
|
|
260
266
|
const url = `${BASE_URL}/api/sites`;
|
|
261
267
|
const res = await fetch(url, { method: "POST", headers, body: formData });
|
|
262
268
|
const data = await res.json().catch(() => null);
|