brewpage-mcp 1.2.0 → 1.3.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.
Files changed (2) hide show
  1. package/dist/index.js +21 -7
  2. 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.1.1",
8
+ version: "1.3.1",
9
9
  });
10
10
  async function apiRequest(method, path, body, headers) {
11
11
  const url = `${BASE_URL}${path}`;
@@ -34,7 +34,7 @@ function formatPublishResponse(data) {
34
34
  lines.push(``, `===================================`, `OWNER TOKEN: ${data.ownerToken}`, `===================================`, ``, `IMPORTANT: Save your owner token! You need it to update or delete this resource later. It cannot be recovered if lost.`);
35
35
  return lines.join("\n");
36
36
  }
37
- server.tool("publish_html", "Publish HTML or Markdown content to BrewPage. Returns a public URL and owner token. Supports password protection and custom TTL.", {
37
+ server.tool("publish_html", "Publish HTML or Markdown content to BrewPage. Returns a public URL and owner token. Supports password protection, custom TTL, optional filename, and an opt-in top toolbar (showTopBar).", {
38
38
  content: z.string().describe("HTML or Markdown content to publish"),
39
39
  format: z
40
40
  .enum(["HTML", "MARKDOWN"])
@@ -50,11 +50,21 @@ server.tool("publish_html", "Publish HTML or Markdown content to BrewPage. Retur
50
50
  .describe("Optional password to protect the page"),
51
51
  ttlDays: z
52
52
  .number()
53
- .min(30)
54
- .max(365)
53
+ .int()
54
+ .min(1)
55
+ .max(30)
56
+ .optional()
57
+ .describe("Time to live in days (1-30, default: 15)"),
58
+ filename: z
59
+ .string()
60
+ .max(200)
61
+ .optional()
62
+ .describe("Optional original filename (≤200 chars). Used as title fallback when no <title>/<h1>; immutable on update."),
63
+ showTopBar: z
64
+ .boolean()
55
65
  .optional()
56
- .describe("Time to live in days (30-365, default: 365)"),
57
- }, async ({ content, format, namespace, password, ttlDays }) => {
66
+ .describe("Add a thin top toolbar (filename + Download button + theme toggle) on the served page. Default: hidden."),
67
+ }, async ({ content, format, namespace, password, ttlDays, filename, showTopBar }) => {
58
68
  const body = { content, format };
59
69
  if (namespace)
60
70
  body.namespace = namespace;
@@ -62,6 +72,10 @@ server.tool("publish_html", "Publish HTML or Markdown content to BrewPage. Retur
62
72
  body.password = password;
63
73
  if (ttlDays)
64
74
  body.ttlDays = ttlDays;
75
+ if (filename)
76
+ body.filename = filename;
77
+ if (showTopBar !== undefined)
78
+ body.showTopBar = showTopBar;
65
79
  const { ok, data } = await apiRequest("POST", "/api/html", body);
66
80
  if (!ok) {
67
81
  return {
@@ -108,7 +122,7 @@ server.tool("publish_file", "Upload a file to BrewPage via URL. Returns a public
108
122
  formData.append("file", blob, filename || fileUrl.split("/").pop() || "file");
109
123
  if (namespace)
110
124
  formData.append("namespace", namespace);
111
- const res = await fetch(`${BASE_URL}/api/files/uploads`, {
125
+ const res = await fetch(`${BASE_URL}/api/files`, {
112
126
  method: "POST",
113
127
  body: formData,
114
128
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "brewpage-mcp",
3
- "version": "1.2.0",
3
+ "version": "1.3.1",
4
4
  "description": "MCP server for BrewPage — publish and manage HTML, KV, JSON, and file content from AI assistants",
5
5
  "type": "module",
6
6
  "bin": {