brewpage-mcp 1.19.0 → 1.20.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 +94 -28
- package/dist/tools.d.ts +1 -1
- package/dist/tools.js +72 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ MCP server for [BrewPage](https://brewpage.app) -- publish and manage HTML, KV,
|
|
|
8
8
|
|
|
9
9
|
## What is BrewPage
|
|
10
10
|
|
|
11
|
-
[BrewPage](https://brewpage.app) is a free instant hosting platform designed for AI agents and developers. One `POST` request publishes HTML, Markdown, a multi-file site, a JSON document, or a binary file and returns its primary HTTPS link -- no account needed, no API keys, no infrastructure setup. Every resource carries an **owner token** returned at creation time: use it to update content in place, delete the resource, or authenticate list operations across sessions. `brewpage-mcp` exposes this API as thirty typed MCP tools so any compatible agent -- Claude, Codex, Gemini, Cursor, Cline -- can publish, update, fetch, and manage BrewPage HTML, JSON, KV, and file content without leaving the conversation.
|
|
11
|
+
[BrewPage](https://brewpage.app) is a free instant hosting platform designed for AI agents and developers. One `POST` request publishes HTML, Markdown, a multi-file site, a JSON document, or a binary file and returns its primary HTTPS link -- no account needed, no API keys, no infrastructure setup. Every resource carries an **owner token** returned at creation time: use it to update content in place, delete the resource, or authenticate list operations across sessions. `brewpage-mcp` exposes this API as thirty-two typed MCP tools so any compatible agent -- Claude, Codex, Gemini, Cursor, Cline -- can publish, update, fetch, and manage BrewPage HTML, JSON, KV, and file content without leaving the conversation.
|
|
12
12
|
|
|
13
13
|
Optional: sign in free (Google or any email) at https://account.brewpage.app to never lose your pages or tokens and to mint tokens that never expire. Not needed to publish.
|
|
14
14
|
|
|
@@ -16,17 +16,11 @@ Choosing a host? See how BrewPage compares with GitHub Pages, Netlify Drop, Tiin
|
|
|
16
16
|
|
|
17
17
|
## Quick Start
|
|
18
18
|
|
|
19
|
-
```bash
|
|
20
|
-
npx -y brewpage-mcp@1.19.0
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
Requires Node.js 20 or newer. This starts the stdio server for an MCP client.
|
|
24
|
-
|
|
25
19
|
### Remote (no install)
|
|
26
20
|
|
|
27
|
-
|
|
21
|
+
One remote MCP server for every client: `https://brewpage.app/mcp` (Streamable HTTP, no authentication, same 32 tools). Add it by URL in Claude (a custom connector), ChatGPT (a custom MCP server) or any Streamable HTTP client.
|
|
28
22
|
|
|
29
|
-
Claude Code: `claude mcp add --transport http brewpage https://brewpage.app/mcp
|
|
23
|
+
Claude Code: `claude mcp add --transport http brewpage --scope user https://brewpage.app/mcp` (leave out `--scope user` to add it to the current project only), or in `.mcp.json`:
|
|
30
24
|
|
|
31
25
|
```json
|
|
32
26
|
{
|
|
@@ -39,43 +33,84 @@ Claude Code: `claude mcp add --transport http brewpage https://brewpage.app/mcp`
|
|
|
39
33
|
}
|
|
40
34
|
```
|
|
41
35
|
|
|
36
|
+
### Local (npx)
|
|
37
|
+
|
|
38
|
+
For clients that only start local servers; the same tools as the server URL.
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
npx -y brewpage-mcp@1.20.0
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Requires Node.js 20 or newer. This starts the stdio server for an MCP client.
|
|
45
|
+
|
|
42
46
|
## Installation
|
|
43
47
|
|
|
44
|
-
### Claude Desktop
|
|
48
|
+
### Claude.ai and Claude Desktop
|
|
49
|
+
|
|
50
|
+
Claude calls a remote MCP server a custom connector. Add it once in Claude on the web; Claude Desktop picks it up too. Nothing to install.
|
|
51
|
+
|
|
52
|
+
1. Open **Customize** > **Connectors**.
|
|
53
|
+
2. Click **+ Add**, then **Add custom connector**.
|
|
54
|
+
3. Name it **BrewPage**, paste `https://brewpage.app/mcp` and click **Continue**.
|
|
55
|
+
4. Click **Continue** again, choose **No sign in** under Authentication and click **Add**.
|
|
45
56
|
|
|
46
|
-
|
|
57
|
+
The free plan includes one custom connector.
|
|
58
|
+
|
|
59
|
+
Local fallback (stdio, needs Node.js; the same tools): add to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows):
|
|
47
60
|
|
|
48
61
|
```json
|
|
49
62
|
{
|
|
50
63
|
"mcpServers": {
|
|
51
64
|
"brewpage": {
|
|
52
65
|
"command": "npx",
|
|
53
|
-
"args": ["-y", "brewpage-mcp@1.
|
|
66
|
+
"args": ["-y", "brewpage-mcp@1.20.0"]
|
|
54
67
|
}
|
|
55
68
|
}
|
|
56
69
|
}
|
|
57
70
|
```
|
|
58
71
|
|
|
72
|
+
### ChatGPT
|
|
73
|
+
|
|
74
|
+
Add BrewPage as a custom MCP server; ChatGPT then publishes for you. Nothing to install.
|
|
75
|
+
|
|
76
|
+
1. Open **Plugins** in ChatGPT.
|
|
77
|
+
2. Click **+**, then **Add custom MCP server**.
|
|
78
|
+
3. Name it **BrewPage** and paste `https://brewpage.app/mcp` as the server URL.
|
|
79
|
+
4. Choose no authentication, select **I understand and want to continue**, then **Create as a plugin**.
|
|
80
|
+
5. Install the new plugin, then ask ChatGPT to publish.
|
|
81
|
+
|
|
82
|
+
Custom servers follow your ChatGPT plan and workspace settings.
|
|
83
|
+
|
|
59
84
|
### Claude Code
|
|
60
85
|
|
|
61
|
-
|
|
86
|
+
The remote command above is the default. Local fallback: register a project-scoped stdio server:
|
|
62
87
|
|
|
63
88
|
```bash
|
|
64
|
-
claude mcp add --transport stdio --scope project brewpage -- npx -y brewpage-mcp@1.
|
|
89
|
+
claude mcp add --transport stdio --scope project brewpage -- npx -y brewpage-mcp@1.20.0
|
|
65
90
|
```
|
|
66
91
|
|
|
67
92
|
This writes `.mcp.json` in the project root. Use `--scope user` for user-scoped registration. See the [official Claude Code MCP guide](https://code.claude.com/docs/en/mcp).
|
|
68
93
|
|
|
69
94
|
### Cursor
|
|
70
95
|
|
|
71
|
-
|
|
96
|
+
One click: **Add to Cursor** on [brewpage.app/integrations](https://brewpage.app/integrations#cursor) opens the install dialog in Cursor with BrewPage filled in. Or add to `~/.cursor/mcp.json`:
|
|
97
|
+
|
|
98
|
+
```json
|
|
99
|
+
{
|
|
100
|
+
"mcpServers": {
|
|
101
|
+
"brewpage": { "url": "https://brewpage.app/mcp" }
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Local fallback (stdio, needs Node.js; the same tools): open **Settings > MCP** and add:
|
|
72
107
|
|
|
73
108
|
```json
|
|
74
109
|
{
|
|
75
110
|
"mcpServers": {
|
|
76
111
|
"brewpage": {
|
|
77
112
|
"command": "npx",
|
|
78
|
-
"args": ["-y", "brewpage-mcp@1.
|
|
113
|
+
"args": ["-y", "brewpage-mcp@1.20.0"]
|
|
79
114
|
}
|
|
80
115
|
}
|
|
81
116
|
}
|
|
@@ -89,21 +124,14 @@ Open the Cline MCP settings panel and add:
|
|
|
89
124
|
{
|
|
90
125
|
"brewpage": {
|
|
91
126
|
"command": "npx",
|
|
92
|
-
"args": ["-y", "brewpage-mcp@1.
|
|
127
|
+
"args": ["-y", "brewpage-mcp@1.20.0"]
|
|
93
128
|
}
|
|
94
129
|
}
|
|
95
130
|
```
|
|
96
131
|
|
|
97
|
-
### Global Install
|
|
98
|
-
|
|
99
|
-
```bash
|
|
100
|
-
npm install -g brewpage-mcp@1.19.0
|
|
101
|
-
brewpage-mcp
|
|
102
|
-
```
|
|
103
|
-
|
|
104
132
|
## Tools
|
|
105
133
|
|
|
106
|
-
Thirty tools are available. Creation returns an owner token; keep it to modify or delete the resource later. Owner tools take `ownerToken`, else `BREWPAGE_OWNER_TOKEN` (local server only). Supported password inputs use `X-Password`. Secrets allowed; likely ones are flagged in notices. For a secret: private namespace + password.
|
|
134
|
+
Thirty-two tools are available. Creation returns an owner token; keep it to modify or delete the resource later. Owner tools take `ownerToken`, else `BREWPAGE_OWNER_TOKEN` (local server only). Supported password inputs use `X-Password`. Secrets allowed; likely ones are flagged in notices. For a secret: private namespace + password.
|
|
107
135
|
|
|
108
136
|
| Tool | Purpose |
|
|
109
137
|
|------|---------|
|
|
@@ -121,7 +149,9 @@ Thirty tools are available. Creation returns an owner token; keep it to modify o
|
|
|
121
149
|
| `get_kv` | Read a KV value |
|
|
122
150
|
| `update_hosting` | Change eligible delivery mode with owner token and hosting version |
|
|
123
151
|
| `delete_resource` | Delete an HTML page, site, JSON document, KV store or file |
|
|
124
|
-
| `set_visibility` |
|
|
152
|
+
| `set_visibility` | List or unlist a public publication in the gallery and sitemap; link unchanged |
|
|
153
|
+
| `make_private` | Make a public publication private: new private link, the public link stops working; one-way |
|
|
154
|
+
| `set_badge` | Hide or show the BrewPage badge on a publication of your profile, up to 5 hidden |
|
|
125
155
|
| `set_title` | Rename an HTML page or site; the title stays on republish; link unchanged |
|
|
126
156
|
| `bind_token` | Add an owner token to your profile (admin token) |
|
|
127
157
|
| `mint_token` | Mint a profile token, shown once (admin token) |
|
|
@@ -408,9 +438,9 @@ delete_resource(type="html", namespace="public", id="aBcDeFgHiJ", ownerToken="to
|
|
|
408
438
|
|
|
409
439
|
### `set_visibility`
|
|
410
440
|
|
|
411
|
-
|
|
441
|
+
List or unlist a public publication in the gallery and sitemap; the link stays the same. Only public, password-free HTML, sites and files can be listed; others answer with a `visibility-not-listable` notice.
|
|
412
442
|
|
|
413
|
-
Parameters: `type` (`html` | `site` | `file` | `json` | `kv`), `namespace`, `id`, `listed` (boolean), `ownerToken` (optional).
|
|
443
|
+
Parameters: `type` (`html` | `site` | `file` | `json` | `kv`), `namespace`, `id`, `listed` (boolean: `true` = listed, `false` = unlisted), `ownerToken` (optional).
|
|
414
444
|
|
|
415
445
|
```
|
|
416
446
|
set_visibility(type="html", namespace="public", id="aBcDeFgHiJ", listed=false)
|
|
@@ -420,6 +450,34 @@ Output: `LISTED: false · link unchanged`.
|
|
|
420
450
|
|
|
421
451
|
---
|
|
422
452
|
|
|
453
|
+
### `make_private`
|
|
454
|
+
|
|
455
|
+
Make a public publication private (`POST /api/{type}/{ns}/{id}/private`): it gets a new private link in a private namespace under a new id, and the public link stops working. Views and stats stay; a custom domain on it is detached. One-way: to go public again, publish again. The owner token stays the same; later calls take the new namespace and id.
|
|
456
|
+
|
|
457
|
+
Parameters: `type` (`html` | `site` | `file` | `json` | `kv`), `namespace` (`public`), `id`, `ownerToken` (optional).
|
|
458
|
+
|
|
459
|
+
```
|
|
460
|
+
make_private(type="html", namespace="public", id="aBcDeFgHiJ")
|
|
461
|
+
```
|
|
462
|
+
|
|
463
|
+
Output: `MADE PRIVATE · the public link no longer works`, then the new link, namespace and id, and the new management link when the publication had one. Give the user the new link and the management link. A publication outside `public` answers 409 `NOT_PUBLIC`.
|
|
464
|
+
|
|
465
|
+
---
|
|
466
|
+
|
|
467
|
+
### `set_badge`
|
|
468
|
+
|
|
469
|
+
Hide or show the BrewPage badge on a publication (`POST /api/{type}/{ns}/{id}/badge`). HTML pages and sites show a small BrewPage badge; page code must not hide or alter it. Hiding works when the publication's owner token is in a BrewPage profile: sign in free at https://account.brewpage.app, then `bind_token`. A profile hides the badge on up to 5 publications; showing it again frees the slot.
|
|
470
|
+
|
|
471
|
+
Parameters: `type` (`html` | `site` | `file` | `json` | `kv`), `namespace`, `id`, `hidden` (optional boolean: `true` = hide, `false` = show; omitted reports the current state), `ownerToken` (optional).
|
|
472
|
+
|
|
473
|
+
```
|
|
474
|
+
set_badge(type="html", namespace="public", id="aBcDeFgHiJ", hidden=true)
|
|
475
|
+
```
|
|
476
|
+
|
|
477
|
+
Output: `BADGE: hidden · 2 of 5 hidden in the profile · link unchanged`. Without a profile the badge stays shown and the result carries the `badge-hide-needs-profile` notice; a sixth hide answers 409 `BADGE_HIDDEN_LIMIT`.
|
|
478
|
+
|
|
479
|
+
---
|
|
480
|
+
|
|
423
481
|
### `set_title`
|
|
424
482
|
|
|
425
483
|
Rename an HTML page or site: the title shown in the gallery, profile, search and link cards (`POST /api/{html|sites}/{ns}/{id}/title`). The new title stays when you republish; the link stays the same. Works when the publication's owner token is in a BrewPage profile: sign in at https://account.brewpage.app, then `bind_token`; otherwise 403 with a hint.
|
|
@@ -697,6 +755,14 @@ Every publish response includes an **owner token** -- the only credential that a
|
|
|
697
755
|
|
|
698
756
|
## Changelog
|
|
699
757
|
|
|
758
|
+
## 1.20.0 -- 2026-11-12
|
|
759
|
+
|
|
760
|
+
- Two new tools. `make_private` turns a public publication into a private one: new private link, the public link stops working, views and stats stay; one-way. `set_badge` hides or shows the BrewPage badge on a publication of your profile, up to 5 hidden. `set_visibility` reads as list or unlist; inputs unchanged. The server instructions and the tools that send page code say that page code must not hide or alter the badge. Thirty-two tools. Contract 2.27.0. `User-Agent: brewpage-mcp/1.20.0`.
|
|
761
|
+
|
|
762
|
+
## 1.19.1 -- 2026-11-12
|
|
763
|
+
|
|
764
|
+
- README only: the remote server `https://brewpage.app/mcp` comes first, with setup steps for Claude and ChatGPT; the local `npx` server is the fallback; the global install section is removed. No tool or input change. Contract 2.22.0. `User-Agent: brewpage-mcp/1.19.1`.
|
|
765
|
+
|
|
700
766
|
## 1.19.0 -- 2026-11-11
|
|
701
767
|
|
|
702
768
|
- Page data: a page can save what its visitors enter (form answers, guestbook, votes, scores, game progress). Five new tools: `get_guide` returns the short reference to read before writing such a page; `get_page_data` reads the settings or one list's entries; `set_page_data` writes author entries; `configure_page_data` changes who can read a list and its limits; `delete_page_data` removes entries. `publish_html` and `publish_site` take `state` on create, `update_html` and `republish_site` on update. The four page-data tools take the owner token, or the page's management link alone as `manageUrl`. The server sends short instructions when a client connects. Thirty tools. Contract 2.22.0. `User-Agent: brewpage-mcp/1.19.0`.
|
package/dist/tools.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { McpServer } from "@modelcontextprotocol/server";
|
|
2
2
|
export declare const DEFAULT_BASE_URL = "https://brewpage.app";
|
|
3
|
-
export declare const USER_AGENT = "brewpage-mcp/1.
|
|
3
|
+
export declare const USER_AGENT = "brewpage-mcp/1.20.0";
|
|
4
4
|
export declare const OWNER_TOKEN_ENV = "BREWPAGE_OWNER_TOKEN";
|
|
5
5
|
/** Server instructions of the handshake: one paragraph per line; the first stands alone within 512 chars. */
|
|
6
6
|
export declare const SERVER_INSTRUCTIONS: string;
|
package/dist/tools.js
CHANGED
|
@@ -2,13 +2,14 @@ import { McpServer } from "@modelcontextprotocol/server";
|
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { PAGE_DATA_CALLS, PAGE_DATA_GUIDE } from "./guides/page-data.js";
|
|
4
4
|
export const DEFAULT_BASE_URL = "https://brewpage.app";
|
|
5
|
-
export const USER_AGENT = "brewpage-mcp/1.
|
|
5
|
+
export const USER_AGENT = "brewpage-mcp/1.20.0";
|
|
6
6
|
export const OWNER_TOKEN_ENV = "BREWPAGE_OWNER_TOKEN";
|
|
7
7
|
/** Server instructions of the handshake: one paragraph per line; the first stands alone within 512 chars. */
|
|
8
8
|
export const SERVER_INSTRUCTIONS = [
|
|
9
9
|
"BrewPage publishes HTML, Markdown, sites, files, JSON and KV and returns a share link plus an owner token. Keep the owner token private and send it as ownerToken on every later call for that publication; it cannot be recovered. A page that must save what its visitors enter (form answers, guestbook, votes, scores, game progress) needs Page data: read get_guide topic page-data BEFORE writing the page, then publish with the state argument.",
|
|
10
10
|
"After publishing, give the user the page link and the management link from the result. Say that the management link is private: whoever has it can edit or delete the page, and its Data tab shows what visitors saved.",
|
|
11
11
|
"KV and JSON tools hold your own data. Page data holds what a page's visitors save: get_page_data reads it, set_page_data writes author entries, configure_page_data changes who can read a list, delete_page_data moderates. In a later chat these four take the management link as manageUrl.",
|
|
12
|
+
"HTML pages and sites show a small BrewPage badge; page code must not hide or alter it. A profile can turn it off on up to 5 pages (set_badge).",
|
|
12
13
|
].join("\n");
|
|
13
14
|
const READ_ONLY = { readOnlyHint: true };
|
|
14
15
|
const DESTRUCTIVE = { readOnlyHint: false, destructiveHint: true };
|
|
@@ -27,6 +28,10 @@ const NO_PUBLIC_CREDENTIALS = "BrewPage tokens and manage links must never be in
|
|
|
27
28
|
const SECRETS = "Secrets allowed; likely ones are flagged in notices. Private namespace + password suit secrets. " +
|
|
28
29
|
NO_PUBLIC_CREDENTIALS;
|
|
29
30
|
const MANAGE_URL_TEXT = "Returns manageUrl, a private management link (grants control; not for public sharing).";
|
|
31
|
+
/** Badge sentence of the four tools that publish or replace page code. */
|
|
32
|
+
const BADGE_TEXT = "Page code must not hide or alter the BrewPage badge; a profile can turn the badge off for a page.";
|
|
33
|
+
const BADGE_NEEDS_PROFILE_CODE = "badge-hide-needs-profile";
|
|
34
|
+
const BADGE_NEEDS_PROFILE_NEXT = "Next: sign in at https://account.brewpage.app, add this publication's owner token with bind_token, then retry.";
|
|
30
35
|
const OLD_READ_ONLY_CODE = "OLD_PUBLICATION_READ_ONLY";
|
|
31
36
|
const WRONG_TYPE_CODE = "WRONG_RESOURCE_TYPE";
|
|
32
37
|
/** 403 message of a rename on a publication no profile owns. */
|
|
@@ -466,7 +471,7 @@ function ownerLinkLines(data) {
|
|
|
466
471
|
lines.push(``, `MANAGE LINK (private): ${data.manageUrl}`, `Give it to the user with the link: anyone who has it can edit or delete this publication. Never post it publicly.`);
|
|
467
472
|
}
|
|
468
473
|
if (data.listed === true && !hasCredentialNotice(data))
|
|
469
|
-
lines.push(``, `VISIBILITY: public, listed.
|
|
474
|
+
lines.push(``, `VISIBILITY: public, listed. Unlist: set_visibility listed=false`);
|
|
470
475
|
return lines;
|
|
471
476
|
}
|
|
472
477
|
/** Optional delivery fields on HTML and hosting responses: why the mode was chosen, flagged or not applied. */
|
|
@@ -513,7 +518,7 @@ export function createServer(options = {}) {
|
|
|
513
518
|
const apiFetch = options.fetch ?? fetch;
|
|
514
519
|
const server = new McpServer({
|
|
515
520
|
name: "brewpage-mcp",
|
|
516
|
-
version: "1.
|
|
521
|
+
version: "1.20.0",
|
|
517
522
|
}, { instructions: SERVER_INSTRUCTIONS });
|
|
518
523
|
/** Caller argument first, then the configured default; `fromEnv` marks the configured one. */
|
|
519
524
|
function ownerTokenFor(argument) {
|
|
@@ -595,7 +600,7 @@ export function createServer(options = {}) {
|
|
|
595
600
|
"A `public` page without deliveryMode may get its own subdomain if it needs browser features a BrewPage link lacks; " +
|
|
596
601
|
"the result then has deliveryModeReason and a delivery notice. Markdown raw HTML is allowlisted: scripts, styles, event handlers, forms, embeds removed. " +
|
|
597
602
|
"Optional `domain` connects a domain the user owns to an HTML-format page. " +
|
|
598
|
-
MANAGE_URL_TEXT + " " + SECRETS + " " + PUBLISH_STATE_TEXT,
|
|
603
|
+
MANAGE_URL_TEXT + " " + SECRETS + " " + BADGE_TEXT + " " + PUBLISH_STATE_TEXT,
|
|
599
604
|
inputSchema: {
|
|
600
605
|
content: z.string().describe("HTML, Markdown, code or JSON to publish"),
|
|
601
606
|
deliveryMode: DELIVERY_MODE_SCHEMA,
|
|
@@ -858,7 +863,7 @@ export function createServer(options = {}) {
|
|
|
858
863
|
...toolMeta("Publish site", ADDITIVE),
|
|
859
864
|
description: "Publish an HTML site to BrewPage. " + PUBLIC_HINT + "Single-page: `entryContent`. Multi-page: `files` (`{path, content}` array). Optional `entry` overrides `index.html`. Returns its primary share link and owner token. " +
|
|
860
865
|
"Static only: HTML, CSS, JS (incl. built React/Vue bundles) run in the browser; server code (PHP etc.) never runs. " + SITE_LIMITS_TEXT +
|
|
861
|
-
" Optional `domain` connects a domain the user owns. " + MANAGE_URL_TEXT + " " + SECRETS + " " + PUBLISH_STATE_TEXT,
|
|
866
|
+
" Optional `domain` connects a domain the user owns. " + MANAGE_URL_TEXT + " " + SECRETS + " " + BADGE_TEXT + " " + PUBLISH_STATE_TEXT,
|
|
862
867
|
inputSchema: {
|
|
863
868
|
deliveryMode: DELIVERY_MODE_SCHEMA,
|
|
864
869
|
entryContent: z
|
|
@@ -977,7 +982,7 @@ export function createServer(options = {}) {
|
|
|
977
982
|
});
|
|
978
983
|
server.registerTool("republish_site", {
|
|
979
984
|
...toolMeta("Republish site", DESTRUCTIVE),
|
|
980
|
-
description: "Republish (full-replace) an existing multi-file BrewPage site in place at the SAME URL/ID. Requires owner token. The uploaded bundle becomes the complete new file set — files absent from it are removed, new files added, matching files overwritten. Single-page: `entryContent`. Multi-page: `files` (array of `{path, content}`). Optional `entry` overrides the default `index.html`. Republishing preserves existing expiry." + OLD_READ_ONLY_TEXT + " " + SITE_LIMITS_TEXT + " " + NO_PUBLIC_CREDENTIALS,
|
|
985
|
+
description: "Republish (full-replace) an existing multi-file BrewPage site in place at the SAME URL/ID. Requires owner token. The uploaded bundle becomes the complete new file set — files absent from it are removed, new files added, matching files overwritten. Single-page: `entryContent`. Multi-page: `files` (array of `{path, content}`). Optional `entry` overrides the default `index.html`. Republishing preserves existing expiry." + OLD_READ_ONLY_TEXT + " " + SITE_LIMITS_TEXT + " " + NO_PUBLIC_CREDENTIALS + " " + BADGE_TEXT,
|
|
981
986
|
inputSchema: {
|
|
982
987
|
namespace: z.string().describe("Site namespace"),
|
|
983
988
|
id: z.string().describe("Site ID"),
|
|
@@ -1076,7 +1081,7 @@ export function createServer(options = {}) {
|
|
|
1076
1081
|
...toolMeta("Update page", DESTRUCTIVE),
|
|
1077
1082
|
description: "Update an existing BrewPage HTML, Markdown, code or JSON page. Requires owner token. Returns the updated page metadata. " +
|
|
1078
1083
|
"Format omitted keeps the stored format, except a whole HTML document makes a Markdown page an HTML page. " +
|
|
1079
|
-
"The link and delivery mode never change on update; an advisory deliveryModeReason and delivery notice are included when the new content uses browser features that may not work fully on a BrewPage link." + OLD_READ_ONLY_TEXT + " " + NO_PUBLIC_CREDENTIALS,
|
|
1084
|
+
"The link and delivery mode never change on update; an advisory deliveryModeReason and delivery notice are included when the new content uses browser features that may not work fully on a BrewPage link." + OLD_READ_ONLY_TEXT + " " + NO_PUBLIC_CREDENTIALS + " " + BADGE_TEXT,
|
|
1080
1085
|
inputSchema: {
|
|
1081
1086
|
namespace: z.string().describe("Page namespace"),
|
|
1082
1087
|
id: z.string().describe("Page ID"),
|
|
@@ -1475,12 +1480,12 @@ export function createServer(options = {}) {
|
|
|
1475
1480
|
});
|
|
1476
1481
|
server.registerTool("set_visibility", {
|
|
1477
1482
|
...toolMeta("Set gallery visibility", ADDITIVE),
|
|
1478
|
-
description: "
|
|
1483
|
+
description: "List or unlist a public publication in the gallery and sitemap. Link unchanged.",
|
|
1479
1484
|
inputSchema: {
|
|
1480
1485
|
type: z.enum(["html", "site", "file", "json", "kv"]).describe("Publication type; only public html, site and file can be listed"),
|
|
1481
1486
|
namespace: z.string().describe("Publication namespace"),
|
|
1482
1487
|
id: z.string().describe("Publication ID"),
|
|
1483
|
-
listed: z.boolean().describe("
|
|
1488
|
+
listed: z.boolean().describe("true = listed, false = unlisted"),
|
|
1484
1489
|
ownerToken: z.string().optional().describe(OWNER_TOKEN_DESCRIPTION),
|
|
1485
1490
|
},
|
|
1486
1491
|
}, async ({ type, namespace, id, listed, ownerToken }) => {
|
|
@@ -1494,6 +1499,64 @@ export function createServer(options = {}) {
|
|
|
1494
1499
|
const result = data;
|
|
1495
1500
|
return textResult([...credentialAlertLines(result), `LISTED: ${result.listed} · link unchanged`, ...noticeLines(result)].join("\n"));
|
|
1496
1501
|
});
|
|
1502
|
+
server.registerTool("make_private", {
|
|
1503
|
+
...toolMeta("Make private", DESTRUCTIVE),
|
|
1504
|
+
description: "Make a public publication private: it gets a new private link and the public link stops working; a custom domain on it is detached. One-way. " +
|
|
1505
|
+
"Returns the new link, namespace and id, plus a new management link when the publication had one; the owner token stays the same.",
|
|
1506
|
+
inputSchema: {
|
|
1507
|
+
type: z.enum(["html", "site", "file", "json", "kv"]).describe("Publication type"),
|
|
1508
|
+
namespace: z.string().describe("Publication namespace; only `public` publications can be made private"),
|
|
1509
|
+
id: z.string().describe("Publication ID"),
|
|
1510
|
+
ownerToken: z.string().optional().describe(OWNER_TOKEN_DESCRIPTION),
|
|
1511
|
+
},
|
|
1512
|
+
}, async ({ type, namespace, id, ownerToken }) => {
|
|
1513
|
+
const auth = ownerTokenFor(ownerToken);
|
|
1514
|
+
if (!auth.token)
|
|
1515
|
+
return textResult(NO_OWNER_TOKEN, true);
|
|
1516
|
+
const path = apiPath(TYPE_SEGMENTS[type], namespace, id, "private");
|
|
1517
|
+
const { ok, status, data, headers: answerHeaders } = await apiRequest("POST", path, undefined, { "X-Owner-Token": auth.token });
|
|
1518
|
+
if (!ok)
|
|
1519
|
+
return ownerFailure("make private", status, data, auth.fromEnv, answerHeaders);
|
|
1520
|
+
const result = data;
|
|
1521
|
+
return textResult([
|
|
1522
|
+
...credentialAlertLines(result),
|
|
1523
|
+
`MADE PRIVATE · the public link no longer works`,
|
|
1524
|
+
``,
|
|
1525
|
+
`New link: ${result.link || "N/A"}`,
|
|
1526
|
+
`Namespace: ${result.namespace || "N/A"}`,
|
|
1527
|
+
`ID: ${result.id || "N/A"}`,
|
|
1528
|
+
`Give the user the new link. Later calls take this namespace and ID with the same owner token.`,
|
|
1529
|
+
...noticeLines(result),
|
|
1530
|
+
...ownerLinkLines(result),
|
|
1531
|
+
].join("\n"));
|
|
1532
|
+
});
|
|
1533
|
+
server.registerTool("set_badge", {
|
|
1534
|
+
...toolMeta("Hide or show badge", ADDITIVE),
|
|
1535
|
+
description: "Hide or show the BrewPage badge on a publication. Needs an owner token that is in a BrewPage profile (free sign-in at https://account.brewpage.app); up to 5 hidden per profile.",
|
|
1536
|
+
inputSchema: {
|
|
1537
|
+
type: z.enum(["html", "site", "file", "json", "kv"]).describe("Publication type"),
|
|
1538
|
+
namespace: z.string().describe("Publication namespace"),
|
|
1539
|
+
id: z.string().describe("Publication ID"),
|
|
1540
|
+
hidden: z.boolean().optional().describe("true = hide the badge, false = show it. Omit: report the current state."),
|
|
1541
|
+
ownerToken: z.string().optional().describe(OWNER_TOKEN_DESCRIPTION),
|
|
1542
|
+
},
|
|
1543
|
+
}, async ({ type, namespace, id, hidden, ownerToken }) => {
|
|
1544
|
+
const auth = ownerTokenFor(ownerToken);
|
|
1545
|
+
if (!auth.token)
|
|
1546
|
+
return textResult(NO_OWNER_TOKEN, true);
|
|
1547
|
+
const path = apiPath(TYPE_SEGMENTS[type], namespace, id, "badge");
|
|
1548
|
+
const { ok, status, data, headers: answerHeaders } = await apiRequest("POST", path, hidden === undefined ? {} : { hidden }, { "X-Owner-Token": auth.token });
|
|
1549
|
+
if (!ok)
|
|
1550
|
+
return ownerFailure("set badge", status, data, auth.fromEnv, answerHeaders);
|
|
1551
|
+
const result = data;
|
|
1552
|
+
const used = typeof result.used === "number" && result.used > 0 ? ` · ${result.used} of ${result.limit} hidden in the profile` : "";
|
|
1553
|
+
return textResult([
|
|
1554
|
+
...credentialAlertLines(result),
|
|
1555
|
+
`BADGE: ${result.hidden === true ? "hidden" : "shown"}${used} · link unchanged`,
|
|
1556
|
+
...noticeLines(result),
|
|
1557
|
+
...(notices(result).some((n) => n.code === BADGE_NEEDS_PROFILE_CODE) ? [BADGE_NEEDS_PROFILE_NEXT] : []),
|
|
1558
|
+
].join("\n"));
|
|
1559
|
+
});
|
|
1497
1560
|
server.registerTool("set_title", {
|
|
1498
1561
|
...toolMeta("Rename page or site", ADDITIVE),
|
|
1499
1562
|
description: "Rename an HTML page or site: the title shown in the gallery, profile, search and link cards. " +
|
package/package.json
CHANGED