@satiyap/confluence-reader-mcp 0.2.1 → 0.2.2

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 (3) hide show
  1. package/README.md +2 -1
  2. package/dist/index.js +13 -18
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -76,12 +76,13 @@ Lists the direct child pages of a Confluence page without fetching their content
76
76
 
77
77
  ### `confluence.fetch_image`
78
78
 
79
- Downloads an image attachment from a Confluence page by filename. Returns the image as base64-encoded data.
79
+ Downloads an image attachment from a Confluence page by filename and saves it to a local directory.
80
80
 
81
81
  | Parameter | Type | Description |
82
82
  |-----------|------|-------------|
83
83
  | `url` | string | Confluence page URL |
84
84
  | `filename` | string | Attachment filename (e.g. `architecture.png`) |
85
+ | `destination` | string | Local directory path to save the image to |
85
86
 
86
87
  ### `confluence.compare`
87
88
 
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ import { storageToMarkdown } from "./confluence/transform.js";
8
8
  import { generateUnifiedDiff, generateDiffStats } from "./compare/diff.js";
9
9
  const server = new McpServer({
10
10
  name: "confluence-reader-mcp",
11
- version: "0.2.1"
11
+ version: "0.2.2"
12
12
  });
13
13
  function getEnv(name) {
14
14
  const v = process.env[name];
@@ -79,10 +79,11 @@ server.tool("confluence.list_children", "List the direct child pages of a Conflu
79
79
  : "No child pages found.";
80
80
  return { content: [{ type: "text", text }] };
81
81
  });
82
- server.tool("confluence.fetch_image", "Download an image attachment from a Confluence page by filename. Returns the image as base64-encoded data.", {
82
+ server.tool("confluence.fetch_image", "Download an image attachment from a Confluence page by filename and save it to a local directory. Returns the saved file path.", {
83
83
  url: z.string().describe("Confluence page URL"),
84
- filename: z.string().describe("Attachment filename (e.g. 'architecture.png')")
85
- }, async ({ url, filename }) => {
84
+ filename: z.string().describe("Attachment filename (e.g. 'architecture.png')"),
85
+ destination: z.string().describe("Local directory path to save the image to")
86
+ }, async ({ url, filename, destination }) => {
86
87
  const cfg = getCfg();
87
88
  const pageId = extractConfluencePageId(url);
88
89
  const attachments = await fetchAttachments(cfg, pageId);
@@ -96,23 +97,17 @@ server.tool("confluence.fetch_image", "Download an image attachment from a Confl
96
97
  }]
97
98
  };
98
99
  }
99
- const { buffer, contentType } = await downloadAttachment(cfg, pageId, match.id);
100
- const base64 = buffer.toString("base64");
101
- // Return as base64 image content
102
- if (contentType.startsWith("image/")) {
103
- return {
104
- content: [{
105
- type: "image",
106
- data: base64,
107
- mimeType: contentType,
108
- }]
109
- };
110
- }
111
- // Non-image attachment — return as base64 text
100
+ const { buffer } = await downloadAttachment(cfg, pageId, match.id);
101
+ // Ensure destination directory exists
102
+ const fs = await import("node:fs/promises");
103
+ const path = await import("node:path");
104
+ await fs.mkdir(destination, { recursive: true });
105
+ const filePath = path.join(destination, match.title);
106
+ await fs.writeFile(filePath, buffer);
112
107
  return {
113
108
  content: [{
114
109
  type: "text",
115
- text: `Downloaded "${filename}" (${contentType}, ${buffer.length} bytes).\nBase64: ${base64.slice(0, 200)}...`
110
+ text: `Saved "${match.title}" (${buffer.length} bytes) to ${filePath}`
116
111
  }]
117
112
  };
118
113
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@satiyap/confluence-reader-mcp",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "MCP server for fetching and comparing Confluence documentation with local files",
5
5
  "author": "satiyap",
6
6
  "license": "MIT",