bookstack-mcp 5.5.0 → 5.6.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 CHANGED
@@ -78,6 +78,20 @@ use these tools to order pages and chapters within a book.
78
78
  (1–180 characters), saved as the revision summary in the page's history. It
79
79
  needs BookStack v26.09 or newer; older versions silently ignore it.
80
80
 
81
+ `get_page` accepts `format: "raw"` to return the page's stored editor HTML
82
+ (BookStack's `raw_html`). The `html` format is the rendered view readers see:
83
+ page includes are resolved and the content filter has run, so attributes such as
84
+ `rel`, `data-*` or legacy `width`/`align` may be gone.
85
+
86
+ When you edit a page, match the format to the page's `editor` field:
87
+
88
+ - **HTML (WYSIWYG) pages:** read `format: "raw"` and send the result back as
89
+ `update_page.html`. Starting from `html` saves the rendered output and drops
90
+ whatever rendering removed.
91
+ - **Markdown pages:** read `format: "markdown"` and send the result back as
92
+ `update_page.markdown`. For these pages `raw_html` is HTML generated from the
93
+ Markdown, and saving any `html` clears the stored Markdown source.
94
+
81
95
  > **Security warning:** `BOOKSTACK_INSECURE_SKIP_TLS_VERIFY=true` disables TLS certificate verification for outgoing requests to BookStack. Use only for self-signed certs on a trusted LAN — connections become vulnerable to MITM attacks. The server logs a `WARNING` line at startup whenever this is enabled.
82
96
 
83
97
  ## Client Configuration
@@ -209,9 +209,15 @@ export class BookStackClient {
209
209
  }
210
210
  async enhancePageResponse(page, options) {
211
211
  const url = await this.generatePageUrl(page);
212
- // Pick a single content format to return to avoid 3x duplication (html + markdown + text)
212
+ // Pick a single content format to return to avoid 3x duplication (html + markdown + text).
213
+ // 'raw' is the stored editor HTML; unlike 'html' it has not been through BookStack's
214
+ // render step, so it is the safe base for HTML written back with update_page.
215
+ // Markdown-authored pages should be edited through 'markdown' instead.
213
216
  const format = options?.format ?? 'markdown';
214
- const fullContent = (format === 'html' ? page.html : format === 'text' ? page.text : page.markdown) || '';
217
+ const fullContent = (format === 'html' ? page.html
218
+ : format === 'raw' ? page.raw_html
219
+ : format === 'text' ? page.text
220
+ : page.markdown) || '';
215
221
  // Character-range slicing so very large pages can be paginated
216
222
  const DEFAULT_LIMIT = 50000;
217
223
  const offset = Math.max(0, options?.offset ?? 0);
package/dist/index.js CHANGED
@@ -250,7 +250,7 @@ function registerTools(server, client, config) {
250
250
  description: "Get a page. Returns one format (default markdown); use offset/limit + content_next_offset to paginate large pages.",
251
251
  inputSchema: {
252
252
  id: z.coerce.number().min(1),
253
- format: z.enum(["markdown", "html", "text"]).optional().describe("Which content format to return. Defaults to markdown."),
253
+ format: z.enum(["markdown", "html", "text", "raw"]).optional().describe("Which content format to return. Defaults to markdown. 'html' is the rendered page as readers see it (includes resolved, content filtering applied); 'raw' is the stored editor HTML. To edit a page, check its 'editor' field: for HTML (WYSIWYG) pages read 'raw' and send it back as update_page.html; for Markdown pages read 'markdown' and send it back as update_page.markdown, because saving html clears the stored Markdown source."),
254
254
  offset: z.coerce.number().min(0).optional().describe("Character offset into the content to start from (default 0)"),
255
255
  limit: z.coerce.number().min(1).max(200000).optional().describe("Max characters of content to return (default 50000)")
256
256
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bookstack-mcp",
3
- "version": "5.5.0",
3
+ "version": "5.6.0",
4
4
  "description": "MCP server for BookStack wiki — search, read, create, and manage documentation via AI assistants",
5
5
  "type": "module",
6
6
  "bin": {