mcp-confluence-data-center 0.0.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 (106) hide show
  1. package/README.md +127 -0
  2. package/dist/config.d.ts +6 -0
  3. package/dist/config.d.ts.map +1 -0
  4. package/dist/config.js +15 -0
  5. package/dist/config.js.map +1 -0
  6. package/dist/index.d.ts +3 -0
  7. package/dist/index.d.ts.map +1 -0
  8. package/dist/index.js +21 -0
  9. package/dist/index.js.map +1 -0
  10. package/dist/services/confluence.d.ts +3 -0
  11. package/dist/services/confluence.d.ts.map +1 -0
  12. package/dist/services/confluence.js +7 -0
  13. package/dist/services/confluence.js.map +1 -0
  14. package/dist/tools/attachments/delete_attachment.d.ts +3 -0
  15. package/dist/tools/attachments/delete_attachment.d.ts.map +1 -0
  16. package/dist/tools/attachments/delete_attachment.js +19 -0
  17. package/dist/tools/attachments/delete_attachment.js.map +1 -0
  18. package/dist/tools/attachments/download_all_attachments.d.ts +3 -0
  19. package/dist/tools/attachments/download_all_attachments.d.ts.map +1 -0
  20. package/dist/tools/attachments/download_all_attachments.js +61 -0
  21. package/dist/tools/attachments/download_all_attachments.js.map +1 -0
  22. package/dist/tools/attachments/download_attachment.d.ts +3 -0
  23. package/dist/tools/attachments/download_attachment.d.ts.map +1 -0
  24. package/dist/tools/attachments/download_attachment.js +22 -0
  25. package/dist/tools/attachments/download_attachment.js.map +1 -0
  26. package/dist/tools/attachments/get_attachments.d.ts +3 -0
  27. package/dist/tools/attachments/get_attachments.d.ts.map +1 -0
  28. package/dist/tools/attachments/get_attachments.js +22 -0
  29. package/dist/tools/attachments/get_attachments.js.map +1 -0
  30. package/dist/tools/attachments/index.d.ts +6 -0
  31. package/dist/tools/attachments/index.d.ts.map +1 -0
  32. package/dist/tools/attachments/index.js +6 -0
  33. package/dist/tools/attachments/index.js.map +1 -0
  34. package/dist/tools/attachments/upload_attachment.d.ts +3 -0
  35. package/dist/tools/attachments/upload_attachment.d.ts.map +1 -0
  36. package/dist/tools/attachments/upload_attachment.js +52 -0
  37. package/dist/tools/attachments/upload_attachment.js.map +1 -0
  38. package/dist/tools/comments/add_comment.d.ts +3 -0
  39. package/dist/tools/comments/add_comment.d.ts.map +1 -0
  40. package/dist/tools/comments/add_comment.js +20 -0
  41. package/dist/tools/comments/add_comment.js.map +1 -0
  42. package/dist/tools/comments/get_comments.d.ts +3 -0
  43. package/dist/tools/comments/get_comments.d.ts.map +1 -0
  44. package/dist/tools/comments/get_comments.js +22 -0
  45. package/dist/tools/comments/get_comments.js.map +1 -0
  46. package/dist/tools/comments/index.d.ts +3 -0
  47. package/dist/tools/comments/index.d.ts.map +1 -0
  48. package/dist/tools/comments/index.js +3 -0
  49. package/dist/tools/comments/index.js.map +1 -0
  50. package/dist/tools/index.d.ts +3 -0
  51. package/dist/tools/index.d.ts.map +1 -0
  52. package/dist/tools/index.js +30 -0
  53. package/dist/tools/index.js.map +1 -0
  54. package/dist/tools/labels/add_label.d.ts +3 -0
  55. package/dist/tools/labels/add_label.d.ts.map +1 -0
  56. package/dist/tools/labels/add_label.js +20 -0
  57. package/dist/tools/labels/add_label.js.map +1 -0
  58. package/dist/tools/labels/get_labels.d.ts +3 -0
  59. package/dist/tools/labels/get_labels.d.ts.map +1 -0
  60. package/dist/tools/labels/get_labels.js +21 -0
  61. package/dist/tools/labels/get_labels.js.map +1 -0
  62. package/dist/tools/labels/index.d.ts +3 -0
  63. package/dist/tools/labels/index.d.ts.map +1 -0
  64. package/dist/tools/labels/index.js +3 -0
  65. package/dist/tools/labels/index.js.map +1 -0
  66. package/dist/tools/pages/create_page.d.ts +3 -0
  67. package/dist/tools/pages/create_page.d.ts.map +1 -0
  68. package/dist/tools/pages/create_page.js +32 -0
  69. package/dist/tools/pages/create_page.js.map +1 -0
  70. package/dist/tools/pages/delete_page.d.ts +3 -0
  71. package/dist/tools/pages/delete_page.d.ts.map +1 -0
  72. package/dist/tools/pages/delete_page.js +19 -0
  73. package/dist/tools/pages/delete_page.js.map +1 -0
  74. package/dist/tools/pages/get_page.d.ts +3 -0
  75. package/dist/tools/pages/get_page.d.ts.map +1 -0
  76. package/dist/tools/pages/get_page.js +45 -0
  77. package/dist/tools/pages/get_page.js.map +1 -0
  78. package/dist/tools/pages/get_page_children.d.ts +3 -0
  79. package/dist/tools/pages/get_page_children.d.ts.map +1 -0
  80. package/dist/tools/pages/get_page_children.js +22 -0
  81. package/dist/tools/pages/get_page_children.js.map +1 -0
  82. package/dist/tools/pages/get_page_history.d.ts +3 -0
  83. package/dist/tools/pages/get_page_history.d.ts.map +1 -0
  84. package/dist/tools/pages/get_page_history.js +21 -0
  85. package/dist/tools/pages/get_page_history.js.map +1 -0
  86. package/dist/tools/pages/index.d.ts +7 -0
  87. package/dist/tools/pages/index.d.ts.map +1 -0
  88. package/dist/tools/pages/index.js +7 -0
  89. package/dist/tools/pages/index.js.map +1 -0
  90. package/dist/tools/pages/update_page.d.ts +3 -0
  91. package/dist/tools/pages/update_page.d.ts.map +1 -0
  92. package/dist/tools/pages/update_page.js +44 -0
  93. package/dist/tools/pages/update_page.js.map +1 -0
  94. package/dist/tools/search/index.d.ts +2 -0
  95. package/dist/tools/search/index.d.ts.map +1 -0
  96. package/dist/tools/search/index.js +2 -0
  97. package/dist/tools/search/index.js.map +1 -0
  98. package/dist/tools/search/search.d.ts +3 -0
  99. package/dist/tools/search/search.d.ts.map +1 -0
  100. package/dist/tools/search/search.js +22 -0
  101. package/dist/tools/search/search.js.map +1 -0
  102. package/dist/utils/strip-response.d.ts +6 -0
  103. package/dist/utils/strip-response.d.ts.map +1 -0
  104. package/dist/utils/strip-response.js +29 -0
  105. package/dist/utils/strip-response.js.map +1 -0
  106. package/package.json +54 -0
package/README.md ADDED
@@ -0,0 +1,127 @@
1
+ # Confluence Server MCP
2
+
3
+ A **Model Context Protocol (MCP)** server that connects AI assistants to Confluence Server/Data Center. Search pages, manage content, handle attachments, and interact with your Confluence instance through natural language in Claude and other AI assistants.
4
+
5
+ ## Quick Start
6
+
7
+ ### Get Your Confluence Server Credentials
8
+
9
+ 1. Log into your Confluence Server instance
10
+ 2. Go to **Profile** > **Settings** > **Personal Access Tokens**
11
+ 3. Click **Create token**
12
+ 4. Give it a name and copy the generated token
13
+ 5. Note your Confluence Server URL (e.g., `https://confluence.yourcompany.com`)
14
+
15
+ ### Configuration
16
+
17
+ #### Claude Code
18
+
19
+ Add the server using the Claude Code CLI:
20
+
21
+ ```bash
22
+ claude mcp add -s user \
23
+ confluence-server \
24
+ npx mcp-confluence-data-center@latest \
25
+ -e "CONFLUENCE_URL=https://confluence.yourcompany.com" \
26
+ -e "CONFLUENCE_TOKEN=your_personal_access_token"
27
+ ```
28
+
29
+ #### Manual Configuration (Any MCP Client)
30
+
31
+ Add this configuration to your MCP client's configuration file:
32
+
33
+ ```json
34
+ {
35
+ "mcpServers": {
36
+ "confluence-server": {
37
+ "command": "npx",
38
+ "args": ["mcp-confluence-data-center@latest"],
39
+ "type": "stdio",
40
+ "env": {
41
+ "CONFLUENCE_URL": "https://confluence.yourcompany.com",
42
+ "CONFLUENCE_TOKEN": "your_personal_access_token"
43
+ }
44
+ }
45
+ }
46
+ }
47
+ ```
48
+
49
+ ## Available Tools
50
+
51
+ The server provides **16 MCP tools** for Confluence Server operations. All tools are prefixed with `confluence_` to avoid name collisions.
52
+
53
+ ### Search (1 tool)
54
+ - `confluence_search` - Search content with CQL (Confluence Query Language)
55
+
56
+ ### Pages (6 tools)
57
+ - `confluence_get_page` - Get page content (by ID, or by title + space key; supports historical versions)
58
+ - `confluence_get_page_children` - Get child pages of a page
59
+ - `confluence_get_page_history` - Get version history of a page
60
+ - `confluence_create_page` - Create a new page
61
+ - `confluence_update_page` - Update page content (auto-fetches version if not provided)
62
+ - `confluence_delete_page` - Delete a page
63
+
64
+ ### Comments (2 tools)
65
+ - `confluence_get_comments` - Get comments on a page
66
+ - `confluence_add_comment` - Add a comment to a page
67
+
68
+ ### Labels (2 tools)
69
+ - `confluence_get_labels` - Get labels on a page
70
+ - `confluence_add_label` - Add labels to a page
71
+
72
+ ### Attachments (5 tools)
73
+ - `confluence_get_attachments` - List attachments on a page
74
+ - `confluence_download_attachment` - Download a single attachment
75
+ - `confluence_download_all_attachments` - Download all attachments from a page
76
+ - `confluence_upload_attachment` - Upload files to a page (supports multiple files)
77
+ - `confluence_delete_attachment` - Delete an attachment
78
+
79
+ ## Example Queries
80
+
81
+ - *"Search for pages about deployment in the DOCS space"*
82
+ - *"Get the contents of the Architecture Overview page in DOCS"*
83
+ - *"Create a new page under the team space with meeting notes"*
84
+ - *"Update the runbook page with the new procedure"*
85
+ - *"Download all attachments from page 12345"*
86
+ - *"Add the 'reviewed' label to the design document"*
87
+ - *"Show me the version history of the API spec page"*
88
+
89
+ ## Development
90
+
91
+ ### From Source
92
+
93
+ ```bash
94
+ git clone https://github.com/evrimalacan/mcp-confluence-data-center.git
95
+ cd mcp-confluence-data-center
96
+ npm install
97
+ npm run build
98
+ npm run dev
99
+ ```
100
+
101
+ See `CLAUDE.md` for detailed development guidelines.
102
+
103
+ ## Troubleshooting
104
+
105
+ ### Common Issues
106
+
107
+ **"Authentication failed"**
108
+ - Verify your Personal Access Token is correct
109
+ - Ensure the token has not expired
110
+
111
+ **"Access forbidden"**
112
+ - Check your Confluence user has permission for the space or page
113
+ - Verify space-level permissions
114
+
115
+ **"Resource not found"**
116
+ - Confirm the page ID, space key, or attachment ID is correct
117
+ - Check you have access to the specified resource
118
+
119
+ ## Documentation
120
+
121
+ - **[Development Guide](CLAUDE.md)** - Detailed development and contribution guide
122
+ - **[Confluence Server REST API](https://developer.atlassian.com/server/confluence/confluence-server-rest-api/)** - Official API reference
123
+ - **[Model Context Protocol](https://modelcontextprotocol.io)** - MCP specification
124
+
125
+ ## License
126
+
127
+ MIT License - see [LICENSE](LICENSE) file for details.
@@ -0,0 +1,6 @@
1
+ export interface ConfluenceConfig {
2
+ baseUrl: string;
3
+ token: string;
4
+ }
5
+ export declare const confluenceConfig: ConfluenceConfig;
6
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf;AAiBD,eAAO,MAAM,gBAAgB,kBAAmB,CAAC"}
package/dist/config.js ADDED
@@ -0,0 +1,15 @@
1
+ import { config } from 'dotenv';
2
+ config();
3
+ function validateConfig() {
4
+ const baseUrl = process.env.CONFLUENCE_URL;
5
+ const token = process.env.CONFLUENCE_TOKEN;
6
+ if (!baseUrl) {
7
+ throw new Error('CONFLUENCE_URL environment variable is required');
8
+ }
9
+ if (!token) {
10
+ throw new Error('CONFLUENCE_TOKEN environment variable is required');
11
+ }
12
+ return { baseUrl, token };
13
+ }
14
+ export const confluenceConfig = validateConfig();
15
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,MAAM,EAAE,CAAC;AAOT,SAAS,cAAc;IACrB,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC;IAC3C,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC;IAE3C,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;IACrE,CAAC;IAED,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IACvE,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AAC5B,CAAC;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,cAAc,EAAE,CAAC"}
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export * from 'confluence-data-center-client';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAMA,cAAc,+BAA+B,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env node
2
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
3
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
4
+ import { registerTools } from './tools/index.js';
5
+ export * from 'confluence-data-center-client';
6
+ async function main() {
7
+ const server = new McpServer({
8
+ name: 'mcp-confluence-server',
9
+ version: '1.0.0',
10
+ });
11
+ registerTools(server);
12
+ const transport = new StdioServerTransport();
13
+ await server.connect(transport);
14
+ console.error('Confluence MCP Server started');
15
+ }
16
+ main().catch((error) => {
17
+ const message = error instanceof Error ? error.message : 'Unknown error';
18
+ console.error('Error:', message);
19
+ process.exit(1);
20
+ });
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,cAAc,+BAA+B,CAAC;AAE9C,KAAK,UAAU,IAAI;IACjB,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC;QAC3B,IAAI,EAAE,uBAAuB;QAC7B,OAAO,EAAE,OAAO;KACjB,CAAC,CAAC;IAEH,aAAa,CAAC,MAAM,CAAC,CAAC;IAEtB,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;AACjD,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;IAC9B,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC;IACzE,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACjC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { ConfluenceClient } from 'confluence-data-center-client';
2
+ export declare const confluenceService: ConfluenceClient;
3
+ //# sourceMappingURL=confluence.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"confluence.d.ts","sourceRoot":"","sources":["../../src/services/confluence.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGjE,eAAO,MAAM,iBAAiB,kBAG5B,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { ConfluenceClient } from 'confluence-data-center-client';
2
+ import { confluenceConfig } from '../config.js';
3
+ export const confluenceService = new ConfluenceClient({
4
+ baseUrl: confluenceConfig.baseUrl,
5
+ token: confluenceConfig.token,
6
+ });
7
+ //# sourceMappingURL=confluence.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"confluence.js","sourceRoot":"","sources":["../../src/services/confluence.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,gBAAgB,CAAC;IACpD,OAAO,EAAE,gBAAgB,CAAC,OAAO;IACjC,KAAK,EAAE,gBAAgB,CAAC,KAAK;CAC9B,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ export declare const deleteAttachmentTool: (server: McpServer) => void;
3
+ //# sourceMappingURL=delete_attachment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete_attachment.d.ts","sourceRoot":"","sources":["../../../src/tools/attachments/delete_attachment.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAMzE,eAAO,MAAM,oBAAoB,GAAI,QAAQ,SAAS,SAerD,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { z } from 'zod';
2
+ import { confluenceService } from '../../services/confluence.js';
3
+ import { stripResponse } from '../../utils/strip-response.js';
4
+ const schema = z.object({
5
+ attachmentId: z.string().describe('Attachment ID to delete'),
6
+ });
7
+ export const deleteAttachmentTool = (server) => {
8
+ server.registerTool('confluence_delete_attachment', {
9
+ title: 'Delete Attachment',
10
+ description: 'Delete a Confluence attachment by ID',
11
+ inputSchema: schema.shape,
12
+ }, async ({ attachmentId }) => {
13
+ await confluenceService.attachments.delete({ attachmentId });
14
+ return {
15
+ content: [{ type: 'text', text: JSON.stringify(stripResponse({ deleted: true, attachmentId }), null, 2) }],
16
+ };
17
+ });
18
+ };
19
+ //# sourceMappingURL=delete_attachment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete_attachment.js","sourceRoot":"","sources":["../../../src/tools/attachments/delete_attachment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAG9D,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;IACtB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,yBAAyB,CAAC;CAC7D,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,MAAiB,EAAE,EAAE;IACxD,MAAM,CAAC,YAAY,CACjB,8BAA8B,EAC9B;QACE,KAAK,EAAE,mBAAmB;QAC1B,WAAW,EAAE,sCAAsC;QACnD,WAAW,EAAE,MAAM,CAAC,KAAK;KAC1B,EACD,KAAK,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE;QACzB,MAAM,iBAAiB,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC;QAC7D,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;SAC3G,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ export declare const downloadAllAttachmentsTool: (server: McpServer) => void;
3
+ //# sourceMappingURL=download_all_attachments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"download_all_attachments.d.ts","sourceRoot":"","sources":["../../../src/tools/attachments/download_all_attachments.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAOzE,eAAO,MAAM,0BAA0B,GAAI,QAAQ,SAAS,SAkE3D,CAAC"}
@@ -0,0 +1,61 @@
1
+ import { z } from 'zod';
2
+ import { confluenceService } from '../../services/confluence.js';
3
+ const schema = z.object({
4
+ pageId: z.string().describe('Page ID to download attachments from'),
5
+ destinationDir: z.string().describe('Local directory to save attachments into'),
6
+ });
7
+ export const downloadAllAttachmentsTool = (server) => {
8
+ server.registerTool('confluence_download_all_attachments', {
9
+ title: 'Download All Attachments',
10
+ description: 'Download all attachments from a Confluence page to a local directory.',
11
+ inputSchema: schema.shape,
12
+ }, async ({ pageId, destinationDir }) => {
13
+ const { mkdirSync } = await import('fs');
14
+ const { join } = await import('path');
15
+ mkdirSync(destinationDir, { recursive: true });
16
+ const response = await confluenceService.attachments.get({ pageId });
17
+ const attachments = response.results ?? [];
18
+ if (attachments.length === 0) {
19
+ return {
20
+ content: [
21
+ {
22
+ type: 'text',
23
+ text: JSON.stringify({ pageId, downloaded: 0, files: [] }, null, 2),
24
+ },
25
+ ],
26
+ };
27
+ }
28
+ const results = [];
29
+ const failed = [];
30
+ for (const att of attachments) {
31
+ const downloadUrl = att._links?.download;
32
+ if (!downloadUrl) {
33
+ failed.push({ filename: att.title, error: 'No download URL' });
34
+ continue;
35
+ }
36
+ const destPath = join(destinationDir, att.title);
37
+ try {
38
+ await confluenceService.attachments.download({ downloadUrl, destinationPath: destPath });
39
+ results.push({ filename: att.title, size: att.fileSize ?? 0, path: destPath });
40
+ }
41
+ catch (err) {
42
+ failed.push({ filename: att.title, error: String(err) });
43
+ }
44
+ }
45
+ return {
46
+ content: [
47
+ {
48
+ type: 'text',
49
+ text: JSON.stringify({
50
+ pageId,
51
+ downloaded: results.length,
52
+ total: attachments.length,
53
+ files: results,
54
+ ...(failed.length > 0 && { failed }),
55
+ }, null, 2),
56
+ },
57
+ ],
58
+ };
59
+ });
60
+ };
61
+ //# sourceMappingURL=download_all_attachments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"download_all_attachments.js","sourceRoot":"","sources":["../../../src/tools/attachments/download_all_attachments.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,3 @@
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ export declare const downloadAttachmentTool: (server: McpServer) => void;
3
+ //# sourceMappingURL=download_attachment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"download_attachment.d.ts","sourceRoot":"","sources":["../../../src/tools/attachments/download_attachment.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAOzE,eAAO,MAAM,sBAAsB,GAAI,QAAQ,SAAS,SAiBvD,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { z } from 'zod';
2
+ import { confluenceService } from '../../services/confluence.js';
3
+ import { stripResponse } from '../../utils/strip-response.js';
4
+ const schema = z.object({
5
+ downloadUrl: z.string().describe("Download URL from attachment's _links.download"),
6
+ destinationPath: z.string().describe('Local filesystem path to save the file'),
7
+ });
8
+ export const downloadAttachmentTool = (server) => {
9
+ server.registerTool('confluence_download_attachment', {
10
+ title: 'Download Attachment',
11
+ description: 'Download a Confluence attachment to a local file',
12
+ inputSchema: schema.shape,
13
+ }, async ({ downloadUrl, destinationPath }) => {
14
+ await confluenceService.attachments.download({ downloadUrl, destinationPath });
15
+ return {
16
+ content: [
17
+ { type: 'text', text: JSON.stringify(stripResponse({ downloaded: true, path: destinationPath }), null, 2) },
18
+ ],
19
+ };
20
+ });
21
+ };
22
+ //# sourceMappingURL=download_attachment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"download_attachment.js","sourceRoot":"","sources":["../../../src/tools/attachments/download_attachment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAG9D,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;IACtB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gDAAgD,CAAC;IAClF,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,wCAAwC,CAAC;CAC/E,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,MAAiB,EAAE,EAAE;IAC1D,MAAM,CAAC,YAAY,CACjB,gCAAgC,EAChC;QACE,KAAK,EAAE,qBAAqB;QAC5B,WAAW,EAAE,kDAAkD;QAC/D,WAAW,EAAE,MAAM,CAAC,KAAK;KAC1B,EACD,KAAK,EAAE,EAAE,WAAW,EAAE,eAAe,EAAE,EAAE,EAAE;QACzC,MAAM,iBAAiB,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC,CAAC;QAC/E,OAAO;YACL,OAAO,EAAE;gBACP,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE;aAC5G;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ export declare const getAttachmentsTool: (server: McpServer) => void;
3
+ //# sourceMappingURL=get_attachments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get_attachments.d.ts","sourceRoot":"","sources":["../../../src/tools/attachments/get_attachments.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AASzE,eAAO,MAAM,kBAAkB,GAAI,QAAQ,SAAS,SAenD,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { z } from 'zod';
2
+ import { confluenceService } from '../../services/confluence.js';
3
+ import { stripResponse } from '../../utils/strip-response.js';
4
+ const schema = z.object({
5
+ pageId: z.string().describe('Page ID'),
6
+ start: z.number().optional().describe('Starting index'),
7
+ limit: z.number().optional().describe('Maximum results'),
8
+ filename: z.string().optional().describe('Filter by filename'),
9
+ });
10
+ export const getAttachmentsTool = (server) => {
11
+ server.registerTool('confluence_get_attachments', {
12
+ title: 'Get Attachments',
13
+ description: 'Get attachments on a Confluence page',
14
+ inputSchema: schema.shape,
15
+ }, async ({ pageId, start, limit, filename }) => {
16
+ const result = await confluenceService.attachments.get({ pageId, start, limit, filename });
17
+ return {
18
+ content: [{ type: 'text', text: JSON.stringify(stripResponse(result), null, 2) }],
19
+ };
20
+ });
21
+ };
22
+ //# sourceMappingURL=get_attachments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get_attachments.js","sourceRoot":"","sources":["../../../src/tools/attachments/get_attachments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAG9D,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;IACtB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC;IACtC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;IACvD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,iBAAiB,CAAC;IACxD,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,oBAAoB,CAAC;CAC/D,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,MAAiB,EAAE,EAAE;IACtD,MAAM,CAAC,YAAY,CACjB,4BAA4B,EAC5B;QACE,KAAK,EAAE,iBAAiB;QACxB,WAAW,EAAE,sCAAsC;QACnD,WAAW,EAAE,MAAM,CAAC,KAAK;KAC1B,EACD,KAAK,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC3C,MAAM,MAAM,GAAG,MAAM,iBAAiB,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC3F,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;SAClF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ export * from './get_attachments.js';
2
+ export * from './download_attachment.js';
3
+ export * from './download_all_attachments.js';
4
+ export * from './upload_attachment.js';
5
+ export * from './delete_attachment.js';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/attachments/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC"}
@@ -0,0 +1,6 @@
1
+ export * from './get_attachments.js';
2
+ export * from './download_attachment.js';
3
+ export * from './download_all_attachments.js';
4
+ export * from './upload_attachment.js';
5
+ export * from './delete_attachment.js';
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/attachments/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ export declare const uploadAttachmentTool: (server: McpServer) => void;
3
+ //# sourceMappingURL=upload_attachment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upload_attachment.d.ts","sourceRoot":"","sources":["../../../src/tools/attachments/upload_attachment.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAWzE,eAAO,MAAM,oBAAoB,GAAI,QAAQ,SAAS,SAkDrD,CAAC"}
@@ -0,0 +1,52 @@
1
+ import { z } from 'zod';
2
+ import { confluenceService } from '../../services/confluence.js';
3
+ const schema = z.object({
4
+ pageId: z.string().describe('Page ID'),
5
+ filePaths: z
6
+ .string()
7
+ .describe('Comma-separated local file paths to upload (e.g., "/path/file1.txt,/path/file2.pdf")'),
8
+ comment: z.string().optional().describe('Attachment comment'),
9
+ minorEdit: z.boolean().optional().describe('Whether this is a minor edit (default: true)'),
10
+ });
11
+ export const uploadAttachmentTool = (server) => {
12
+ server.registerTool('confluence_upload_attachment', {
13
+ title: 'Upload Attachment(s)',
14
+ description: 'Upload one or more file attachments to a Confluence page.',
15
+ inputSchema: schema.shape,
16
+ }, async ({ pageId, filePaths, comment, minorEdit }) => {
17
+ const paths = filePaths
18
+ .split(',')
19
+ .map((p) => p.trim())
20
+ .filter(Boolean);
21
+ const results = [];
22
+ const failed = [];
23
+ for (const filePath of paths) {
24
+ try {
25
+ const result = await confluenceService.attachments.upload({
26
+ pageId,
27
+ filePath,
28
+ comment,
29
+ minorEdit,
30
+ });
31
+ results.push({ filename: result.title, id: result.id });
32
+ }
33
+ catch (err) {
34
+ failed.push({ filePath, error: String(err) });
35
+ }
36
+ }
37
+ return {
38
+ content: [
39
+ {
40
+ type: 'text',
41
+ text: JSON.stringify({
42
+ pageId,
43
+ uploaded: results.length,
44
+ files: results,
45
+ ...(failed.length > 0 && { failed }),
46
+ }, null, 2),
47
+ },
48
+ ],
49
+ };
50
+ });
51
+ };
52
+ //# sourceMappingURL=upload_attachment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upload_attachment.js","sourceRoot":"","sources":["../../../src/tools/attachments/upload_attachment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAGjE,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;IACtB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC;IACtC,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,QAAQ,CAAC,sFAAsF,CAAC;IACnG,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,oBAAoB,CAAC;IAC7D,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,8CAA8C,CAAC;CAC3F,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,MAAiB,EAAE,EAAE;IACxD,MAAM,CAAC,YAAY,CACjB,8BAA8B,EAC9B;QACE,KAAK,EAAE,sBAAsB;QAC7B,WAAW,EAAE,2DAA2D;QACxE,WAAW,EAAE,MAAM,CAAC,KAAK;KAC1B,EACD,KAAK,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE;QAClD,MAAM,KAAK,GAAG,SAAS;aACpB,KAAK,CAAC,GAAG,CAAC;aACV,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;aACpB,MAAM,CAAC,OAAO,CAAC,CAAC;QAEnB,MAAM,OAAO,GAAuC,EAAE,CAAC;QACvD,MAAM,MAAM,GAA0C,EAAE,CAAC;QAEzD,KAAK,MAAM,QAAQ,IAAI,KAAK,EAAE,CAAC;YAC7B,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,MAAM,iBAAiB,CAAC,WAAW,CAAC,MAAM,CAAC;oBACxD,MAAM;oBACN,QAAQ;oBACR,OAAO;oBACP,SAAS;iBACV,CAAC,CAAC;gBACH,OAAO,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,KAAK,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;YAC1D,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,MAAM,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAChD,CAAC;QACH,CAAC;QAED,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAClB;wBACE,MAAM;wBACN,QAAQ,EAAE,OAAO,CAAC,MAAM;wBACxB,KAAK,EAAE,OAAO;wBACd,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC;qBACrC,EACD,IAAI,EACJ,CAAC,CACF;iBACF;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ export declare const addCommentTool: (server: McpServer) => void;
3
+ //# sourceMappingURL=add_comment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add_comment.d.ts","sourceRoot":"","sources":["../../../src/tools/comments/add_comment.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAOzE,eAAO,MAAM,cAAc,GAAI,QAAQ,SAAS,SAe/C,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { z } from 'zod';
2
+ import { confluenceService } from '../../services/confluence.js';
3
+ import { stripResponse } from '../../utils/strip-response.js';
4
+ const schema = z.object({
5
+ pageId: z.string().describe('Page ID to comment on'),
6
+ body: z.string().describe('Comment body in wiki markup'),
7
+ });
8
+ export const addCommentTool = (server) => {
9
+ server.registerTool('confluence_add_comment', {
10
+ title: 'Add Comment',
11
+ description: 'Add a comment to a Confluence page in wiki markup',
12
+ inputSchema: schema.shape,
13
+ }, async ({ pageId, body }) => {
14
+ const result = await confluenceService.comments.add({ pageId, body });
15
+ return {
16
+ content: [{ type: 'text', text: JSON.stringify(stripResponse(result), null, 2) }],
17
+ };
18
+ });
19
+ };
20
+ //# sourceMappingURL=add_comment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add_comment.js","sourceRoot":"","sources":["../../../src/tools/comments/add_comment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAG9D,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;IACtB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uBAAuB,CAAC;IACpD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,6BAA6B,CAAC;CACzD,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,MAAiB,EAAE,EAAE;IAClD,MAAM,CAAC,YAAY,CACjB,wBAAwB,EACxB;QACE,KAAK,EAAE,aAAa;QACpB,WAAW,EAAE,mDAAmD;QAChE,WAAW,EAAE,MAAM,CAAC,KAAK;KAC1B,EACD,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE;QACzB,MAAM,MAAM,GAAG,MAAM,iBAAiB,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;QACtE,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;SAClF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ export declare const getCommentsTool: (server: McpServer) => void;
3
+ //# sourceMappingURL=get_comments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get_comments.d.ts","sourceRoot":"","sources":["../../../src/tools/comments/get_comments.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AASzE,eAAO,MAAM,eAAe,GAAI,QAAQ,SAAS,SAehD,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { z } from 'zod';
2
+ import { confluenceService } from '../../services/confluence.js';
3
+ import { stripResponse } from '../../utils/strip-response.js';
4
+ const schema = z.object({
5
+ pageId: z.string().describe('Page ID'),
6
+ start: z.number().optional().describe('Starting index'),
7
+ limit: z.number().optional().describe('Maximum results'),
8
+ depth: z.string().optional().describe('Comment depth (e.g., "all" for all threads)'),
9
+ });
10
+ export const getCommentsTool = (server) => {
11
+ server.registerTool('confluence_get_comments', {
12
+ title: 'Get Page Comments',
13
+ description: 'Get comments on a Confluence page',
14
+ inputSchema: schema.shape,
15
+ }, async ({ pageId, start, limit, depth }) => {
16
+ const result = await confluenceService.comments.get({ pageId, start, limit, depth });
17
+ return {
18
+ content: [{ type: 'text', text: JSON.stringify(stripResponse(result), null, 2) }],
19
+ };
20
+ });
21
+ };
22
+ //# sourceMappingURL=get_comments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get_comments.js","sourceRoot":"","sources":["../../../src/tools/comments/get_comments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAG9D,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;IACtB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC;IACtC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;IACvD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,iBAAiB,CAAC;IACxD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,6CAA6C,CAAC;CACrF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,MAAiB,EAAE,EAAE;IACnD,MAAM,CAAC,YAAY,CACjB,yBAAyB,EACzB;QACE,KAAK,EAAE,mBAAmB;QAC1B,WAAW,EAAE,mCAAmC;QAChD,WAAW,EAAE,MAAM,CAAC,KAAK;KAC1B,EACD,KAAK,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE;QACxC,MAAM,MAAM,GAAG,MAAM,iBAAiB,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;QACrF,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;SAClF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './get_comments.js';
2
+ export * from './add_comment.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/comments/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './get_comments.js';
2
+ export * from './add_comment.js';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/comments/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ export declare function registerTools(server: McpServer): void;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEzE,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,QA4B9C"}
@@ -0,0 +1,30 @@
1
+ import { getAttachmentsTool, downloadAttachmentTool, downloadAllAttachmentsTool, uploadAttachmentTool, deleteAttachmentTool, } from './attachments/index.js';
2
+ import { getCommentsTool, addCommentTool } from './comments/index.js';
3
+ import { getLabelsTool, addLabelTool } from './labels/index.js';
4
+ import { getPageTool, getPageChildrenTool, getPageHistoryTool, createPageTool, updatePageTool, deletePageTool, } from './pages/index.js';
5
+ import { searchTool } from './search/index.js';
6
+ export function registerTools(server) {
7
+ // Search tools
8
+ searchTool(server);
9
+ // Page read tools
10
+ getPageTool(server);
11
+ getPageChildrenTool(server);
12
+ getPageHistoryTool(server);
13
+ // Page write tools
14
+ createPageTool(server);
15
+ updatePageTool(server);
16
+ deletePageTool(server);
17
+ // Comment tools
18
+ getCommentsTool(server);
19
+ addCommentTool(server);
20
+ // Label tools
21
+ getLabelsTool(server);
22
+ addLabelTool(server);
23
+ // Attachment tools
24
+ getAttachmentsTool(server);
25
+ downloadAttachmentTool(server);
26
+ downloadAllAttachmentsTool(server);
27
+ uploadAttachmentTool(server);
28
+ deleteAttachmentTool(server);
29
+ }
30
+ //# sourceMappingURL=index.js.map