@satiyap/confluence-reader-mcp 0.2.0 → 0.2.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/README.md +4 -2
- package/dist/confluence/client.js +4 -4
- package/dist/index.js +3 -12
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -36,8 +36,10 @@ Reload your shell or open a new terminal.
|
|
|
36
36
|
|----------|----------|-------------|
|
|
37
37
|
| `CONFLUENCE_TOKEN` | Yes | Scoped API token |
|
|
38
38
|
| `CONFLUENCE_EMAIL` | Yes | Email tied to your Atlassian account |
|
|
39
|
-
| `CONFLUENCE_CLOUD_ID` |
|
|
40
|
-
| `CONFLUENCE_BASE_URL` |
|
|
39
|
+
| `CONFLUENCE_CLOUD_ID` | Yes* | Cloud ID — routes via `api.atlassian.com` |
|
|
40
|
+
| `CONFLUENCE_BASE_URL` | Yes* | Direct tenant URL, e.g. `https://your-org.atlassian.net` |
|
|
41
|
+
|
|
42
|
+
*One of `CONFLUENCE_CLOUD_ID` or `CONFLUENCE_BASE_URL` is required. `CONFLUENCE_CLOUD_ID` is recommended.
|
|
41
43
|
|
|
42
44
|
### 3. Add to MCP Config
|
|
43
45
|
|
|
@@ -123,12 +123,12 @@ export async function fetchAttachments(cfg, pageId) {
|
|
|
123
123
|
return all;
|
|
124
124
|
}
|
|
125
125
|
/**
|
|
126
|
-
* Download an attachment binary
|
|
127
|
-
*
|
|
126
|
+
* Download an attachment binary from a Confluence page.
|
|
127
|
+
* Uses the v1 REST API download endpoint which works with scoped tokens.
|
|
128
128
|
*/
|
|
129
|
-
export async function downloadAttachment(cfg,
|
|
129
|
+
export async function downloadAttachment(cfg, pageId, attachmentId) {
|
|
130
130
|
const base = buildBase(cfg);
|
|
131
|
-
const url = `${base}/wiki
|
|
131
|
+
const url = `${base}/wiki/rest/api/content/${pageId}/child/attachment/${attachmentId}/download`;
|
|
132
132
|
const res = await fetch(url, {
|
|
133
133
|
method: "GET",
|
|
134
134
|
headers: buildAuthHeaders(cfg),
|
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.
|
|
11
|
+
version: "0.2.1"
|
|
12
12
|
});
|
|
13
13
|
function getEnv(name) {
|
|
14
14
|
const v = process.env[name];
|
|
@@ -34,7 +34,7 @@ function validateEnvironment() {
|
|
|
34
34
|
errors.forEach(err => console.error(` • ${err}`));
|
|
35
35
|
console.error("\nSet the required environment variables in your shell profile (~/.zshrc, ~/.bashrc, etc.):\n");
|
|
36
36
|
console.error(" export CONFLUENCE_TOKEN=\"your_scoped_token\"");
|
|
37
|
-
console.error(" export CONFLUENCE_EMAIL=\"
|
|
37
|
+
console.error(" export CONFLUENCE_EMAIL=\"your_email@example.com\"");
|
|
38
38
|
console.error(" export CONFLUENCE_CLOUD_ID=\"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\"\n");
|
|
39
39
|
process.exit(1);
|
|
40
40
|
}
|
|
@@ -96,16 +96,7 @@ server.tool("confluence.fetch_image", "Download an image attachment from a Confl
|
|
|
96
96
|
}]
|
|
97
97
|
};
|
|
98
98
|
}
|
|
99
|
-
const
|
|
100
|
-
if (!downloadLink) {
|
|
101
|
-
return {
|
|
102
|
-
content: [{
|
|
103
|
-
type: "text",
|
|
104
|
-
text: `No download link available for "${filename}".`
|
|
105
|
-
}]
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
const { buffer, contentType } = await downloadAttachment(cfg, downloadLink);
|
|
99
|
+
const { buffer, contentType } = await downloadAttachment(cfg, pageId, match.id);
|
|
109
100
|
const base64 = buffer.toString("base64");
|
|
110
101
|
// Return as base64 image content
|
|
111
102
|
if (contentType.startsWith("image/")) {
|