#
tokens: 4767/50000 5/5 files
lines: on (toggle) GitHub
raw markdown copy reset
# Directory Structure

```
├── .gitignore
├── package-lock.json
├── package.json
├── README.md
├── smithery.yaml
├── src
│   └── index.ts
└── tsconfig.json
```

# Files

--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------

```
 1 | # Build and Release Folders
 2 | bin-debug/
 3 | bin-release/
 4 | [Oo]bj/
 5 | [Bb]in/
 6 | 
 7 | # Other files and folders
 8 | .settings/
 9 | 
10 | # Executables
11 | *.swf
12 | *.air
13 | *.ipa
14 | *.apk
15 | 
16 | # Project files, i.e. `.project`, `.actionScriptProperties` and `.flexProperties`
17 | # should NOT be excluded as they contain compiler settings and other important
18 | # information for Eclipse / Flash Builder.
19 | 
20 | .vscode/
21 | .env
22 | node_modules/
23 | build
```

--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------

```markdown
  1 | # Better Confluence Communication Server
  2 | 
  3 | ## Overview
  4 | 
  5 | This server implements the Model Context Protocol (MCP) for Confluence integration.
  6 | **This version addresses and fixes bugs found in the existing Confluence server, providing a more stable and reliable experience.**
  7 | It provides functionalities to execute CQL queries and retrieve page content from Confluence.
  8 | 
  9 | This server follows the MCP client-server architecture:
 10 | 
 11 | - Acts as an MCP server providing Confluence functionalities
 12 | - Connects to Confluence as a data source
 13 | - Communicates with MCP clients through a standardized protocol
 14 | 
 15 | # How to use
 16 | 
 17 | [![smithery badge](https://smithery.ai/badge/@zereight/confluence-mcp)](https://smithery.ai/server/@zereight/confluence-mcp)
 18 | 
 19 | <a href="https://glama.ai/mcp/servers/p7fnmpaukj"><img width="380" height="200" src="https://glama.ai/mcp/servers/p7fnmpaukj/badge" alt="confluence-mcp MCP server" /></a>
 20 | 
 21 | ## Using with Claude App, Cline, Roo Code
 22 | 
 23 | When using with the Claude App, you need to set up your API key and URLs directly.
 24 | 
 25 | ```json
 26 | {
 27 |   "mcpServers": {
 28 |     "Confluence communication server": {
 29 |       "command": "npx",
 30 |       "args": ["-y", "@zereight/mcp-confluence"],
 31 |       "env": {
 32 |         "CONFLUENCE_URL": "https://XXXXXXXX.atlassian.net",
 33 |         "JIRA_URL": "https://XXXXXXXX.atlassian.net",
 34 |         "CONFLUENCE_API_MAIL": "Your email",
 35 |         "CONFLUENCE_API_KEY": "KEY_FROM: https://id.atlassian.com/manage-profile/security/api-tokens",
 36 |         "CONFLUENCE_IS_CLOUD": "true" // Set to "false" for Server/Data Center
 37 |       }
 38 |     }
 39 |   }
 40 | }
 41 | ```
 42 | 
 43 | ## Using with Cursor
 44 | 
 45 | ### Installing via Smithery
 46 | 
 47 | To install Confluence communication server for Claude Desktop automatically via [Smithery](https://smithery.ai/server/@zereight/confluence-mcp):
 48 | 
 49 | ```bash
 50 | npx -y @smithery/cli install @zereight/confluence-mcp --client claude
 51 | ```
 52 | 
 53 | When using with Cursor, you can set up environment variables and run the server as follows:
 54 | 
 55 | ```bash
 56 | env [email protected] CONFLUENCE_API_KEY=your-key CONFLUENCE_URL=your-confluence-url JIRA_URL=your-jira-url npx -y @zereight/mcp-confluence
 57 | ```
 58 | 
 59 | - `CONFLUENCE_API_MAIL`: Your email address for the Confluence API.
 60 | - `CONFLUENCE_API_KEY`: Your Confluence API key.
 61 | - `CONFLUENCE_URL`: Your Confluence URL.
 62 | - `JIRA_URL`: Your JIRA URL.
 63 | - `CONFLUENCE_IS_CLOUD`: Determines Confluence version (Cloud or Server)
 64 |   - Default: true (Cloud version)
 65 |   - Set to 'false' explicitly for Server/Data Center version
 66 |   - Affects API endpoint paths:
 67 |     - Cloud: `/wiki/rest/api`
 68 |     - Server: `/rest/api`
 69 | 
 70 | ### Confluence Tools
 71 | 
 72 | - **execute_cql_search**: Executes a CQL query on Confluence to search pages.
 73 | 
 74 |   - Description: Executes a CQL query on the Confluence instance to search for pages.
 75 |   - Input Schema:
 76 |     ```json
 77 |     {
 78 |       "type": "object",
 79 |       "properties": {
 80 |         "cql": {
 81 |           "type": "string",
 82 |           "description": "CQL query string"
 83 |         },
 84 |         "limit": {
 85 |           "type": "integer",
 86 |           "description": "Number of results to return",
 87 |           "default": 10
 88 |         }
 89 |       },
 90 |       "required": ["cql"]
 91 |     }
 92 |     ```
 93 | 
 94 | - **get_page_content**: Retrieves the content of a specific Confluence page.
 95 | 
 96 |   - Description: Gets the content of a Confluence page using the page ID.
 97 |   - Input Schema:
 98 |     ```json
 99 |     {
100 |       "type": "object",
101 |       "properties": {
102 |         "pageId": {
103 |           "type": "string",
104 |           "description": "Confluence Page ID"
105 |         }
106 |       },
107 |       "required": ["pageId"]
108 |     }
109 |     ```
110 | 
111 | - **create_page**: Creates a new Confluence page.
112 | 
113 |   - Description: Creates a new page in the specified Confluence space.
114 |   - Input Schema:
115 |     ```json
116 |     {
117 |       "type": "object",
118 |       "properties": {
119 |         "spaceKey": {
120 |           "type": "string",
121 |           "description": "Space key where the page will be created"
122 |         },
123 |         "title": {
124 |           "type": "string",
125 |           "description": "Page title"
126 |         },
127 |         "content": {
128 |           "type": "string",
129 |           "description": "Page content in storage format"
130 |         },
131 |         "parentId": {
132 |           "type": "string",
133 |           "description": "Parent page ID (optional)"
134 |         }
135 |       },
136 |       "required": ["spaceKey", "title", "content"]
137 |     }
138 |     ```
139 | 
140 | - **update_page**: Updates an existing Confluence page.
141 |   - Description: Updates the content of an existing Confluence page.
142 |   - Input Schema:
143 |     ```json
144 |     {
145 |       "type": "object",
146 |       "properties": {
147 |         "pageId": {
148 |           "type": "string",
149 |           "description": "ID of the page to update"
150 |         },
151 |         "content": {
152 |           "type": "string",
153 |           "description": "New page content in storage format"
154 |         },
155 |         "title": {
156 |           "type": "string",
157 |           "description": "New page title (optional)"
158 |         }
159 |       },
160 |       "required": ["pageId", "content"]
161 |     }
162 |     ```
163 | 
164 | ### Jira Tools
165 | 
166 | - **execute_jql_search**: Executes a JQL query on Jira to search issues.
167 | 
168 |   - Description: Executes a JQL query on the Jira instance to search for issues.
169 |   - Input Schema:
170 |     ```json
171 |     {
172 |       "type": "object",
173 |       "properties": {
174 |         "jql": {
175 |           "type": "string",
176 |           "description": "JQL query string"
177 |         },
178 |         "limit": {
179 |           "type": "integer",
180 |           "description": "Number of results to return",
181 |           "default": 10
182 |         }
183 |       },
184 |       "required": ["jql"]
185 |     }
186 |     ```
187 | 
188 | - **create_jira_issue**: Creates a new Jira issue.
189 | 
190 |   - Description: Creates a new issue in the specified Jira project.
191 |   - Input Schema:
192 |     ```json
193 |     {
194 |       "type": "object",
195 |       "properties": {
196 |         "project": {
197 |           "type": "string",
198 |           "description": "Project key"
199 |         },
200 |         "summary": {
201 |           "type": "string",
202 |           "description": "Issue summary"
203 |         },
204 |         "description": {
205 |           "type": "string",
206 |           "description": "Issue description"
207 |         },
208 |         "issuetype": {
209 |           "type": "string",
210 |           "description": "Issue type name"
211 |         },
212 |         "assignee": {
213 |           "type": "string",
214 |           "description": "Assignee account ID"
215 |         },
216 |         "priority": {
217 |           "type": "string",
218 |           "description": "Priority ID"
219 |         }
220 |       },
221 |       "required": ["project", "summary", "issuetype"]
222 |     }
223 |     ```
224 | 
225 | - **update_jira_issue**: Updates an existing Jira issue.
226 | 
227 |   - Description: Updates fields of an existing Jira issue.
228 |   - Input Schema:
229 |     ```json
230 |     {
231 |       "type": "object",
232 |       "properties": {
233 |         "issueKey": {
234 |           "type": "string",
235 |           "description": "Issue key (e.g., PROJ-123)"
236 |         },
237 |         "summary": {
238 |           "type": "string",
239 |           "description": "New issue summary"
240 |         },
241 |         "description": {
242 |           "type": "string",
243 |           "description": "New issue description"
244 |         },
245 |         "assignee": {
246 |           "type": "string",
247 |           "description": "New assignee account ID"
248 |         },
249 |         "priority": {
250 |           "type": "string",
251 |           "description": "New priority ID"
252 |         }
253 |       },
254 |       "required": ["issueKey"]
255 |     }
256 |     ```
257 | 
258 | - **transition_jira_issue**: Changes the status of a Jira issue.
259 | 
260 |   - Description: Changes the status of a Jira issue using transition ID.
261 |   - Input Schema:
262 |     ```json
263 |     {
264 |       "type": "object",
265 |       "properties": {
266 |         "issueKey": {
267 |           "type": "string",
268 |           "description": "Issue key (e.g. PROJ-123)"
269 |         },
270 |         "transitionId": {
271 |           "type": "string",
272 |           "description": "Transition ID to change the issue status"
273 |         }
274 |       },
275 |       "required": ["issueKey", "transitionId"]
276 |     }
277 |     ```
278 | 
279 | - **get_board_sprints**: Get all sprints from a Jira board.
280 | 
281 |   - Description: Retrieves all sprints from a specified Jira board.
282 |   - Input Schema:
283 |     ```json
284 |     {
285 |       "type": "object",
286 |       "properties": {
287 |         "boardId": {
288 |           "type": "string",
289 |           "description": "Jira board ID"
290 |         },
291 |         "state": {
292 |           "type": "string",
293 |           "description": "Filter sprints by state (active, future, closed)",
294 |           "enum": ["active", "future", "closed"]
295 |         }
296 |       },
297 |       "required": ["boardId"]
298 |     }
299 |     ```
300 | 
301 | - **get_sprint_issues**: Get all issues from a sprint.
302 | 
303 |   - Description: Retrieves all issues from a specified sprint.
304 |   - Input Schema:
305 |     ```json
306 |     {
307 |       "type": "object",
308 |       "properties": {
309 |         "sprintId": {
310 |           "type": "string",
311 |           "description": "Sprint ID"
312 |         },
313 |         "fields": {
314 |           "type": "array",
315 |           "items": {
316 |             "type": "string"
317 |           },
318 |           "description": "List of fields to return for each issue"
319 |         }
320 |       },
321 |       "required": ["sprintId"]
322 |     }
323 |     ```
324 | 
325 | - **get_current_sprint**: Get current active sprint from a board with its issues.
326 | 
327 |   - Description: Retrieves the current active sprint and its issues from a specified board.
328 |   - Input Schema:
329 |     ```json
330 |     {
331 |       "type": "object",
332 |       "properties": {
333 |         "boardId": {
334 |           "type": "string",
335 |           "description": "Jira board ID"
336 |         },
337 |         "includeIssues": {
338 |           "type": "boolean",
339 |           "description": "Whether to include sprint issues in the response",
340 |           "default": true
341 |         }
342 |       },
343 |       "required": ["boardId"]
344 |     }
345 |     ```
346 | 
347 | - **get_epic_issues**: Get all issues belonging to an epic.
348 | 
349 |   - Description: Retrieves all issues that belong to a specified epic.
350 |   - Input Schema:
351 |     ```json
352 |     {
353 |       "type": "object",
354 |       "properties": {
355 |         "epicKey": {
356 |           "type": "string",
357 |           "description": "Epic issue key (e.g. CONNECT-1234)"
358 |         },
359 |         "fields": {
360 |           "type": "array",
361 |           "items": {
362 |             "type": "string"
363 |           },
364 |           "description": "List of fields to return for each issue"
365 |         }
366 |       },
367 |       "required": ["epicKey"]
368 |     }
369 |     ```
370 | 
371 | - **get_user_issues**: Get all issues assigned to or reported by a specific user in a board.
372 | 
373 |   - Description: Retrieves all issues associated with a specific user in a board.
374 |   - Input Schema:
375 |     ```json
376 |     {
377 |       "type": "object",
378 |       "properties": {
379 |         "boardId": {
380 |           "type": "string",
381 |           "description": "Jira board ID"
382 |         },
383 |         "username": {
384 |           "type": "string",
385 |           "description": "Username to search issues for"
386 |         },
387 |         "type": {
388 |           "type": "string",
389 |           "description": "Type of user association with issues",
390 |           "enum": ["assignee", "reporter"],
391 |           "default": "assignee"
392 |         },
393 |         "status": {
394 |           "type": "string",
395 |           "description": "Filter by issue status",
396 |           "enum": ["open", "in_progress", "done", "all"],
397 |           "default": "all"
398 |         }
399 |       },
400 |       "required": ["boardId", "username"]
401 |     }
402 |     ```
403 | 
```

--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------

```json
 1 | {
 2 |   "compilerOptions": {
 3 |     "target": "ES2022",
 4 |     "module": "Node16",
 5 |     "moduleResolution": "Node16",
 6 |     "outDir": "./build",
 7 |     "rootDir": "./src",
 8 |     "strict": true,
 9 |     "esModuleInterop": true,
10 |     "skipLibCheck": true,
11 |     "forceConsistentCasingInFileNames": true
12 |   },
13 |   "include": ["src/**/*"],
14 |   "exclude": ["node_modules"]
15 | }
16 | 
```

--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------

```json
 1 | {
 2 |   "name": "@zereight/mcp-confluence",
 3 |   "version": "1.0.8",
 4 |   "description": "MCP server for using the Confluence API",
 5 |   "license": "MIT",
 6 |   "author": "zereight",
 7 |   "type": "module",
 8 |   "private": false,
 9 |   "bin": {
10 |     "mcp-confluence": "build/index.js"
11 |   },
12 |   "files": [
13 |     "build"
14 |   ],
15 |   "publishConfig": {
16 |     "access": "public"
17 |   },
18 |   "engines": {
19 |     "node": ">=14"
20 |   },
21 |   "scripts": {
22 |     "build": "tsc && node -e \"require('fs').chmodSync('build/index.js', '755')\"",
23 |     "prepare": "npm run build",
24 |     "watch": "tsc --watch",
25 |     "inspector": "npx @modelcontextprotocol/inspector build/index.js",
26 |     "start": "node build/index.js"
27 |   },
28 |   "dependencies": {
29 |     "@modelcontextprotocol/sdk": "0.6.0",
30 |     "axios": "^1.7.9",
31 |     "mcp-framework": "^0.1.12",
32 |     "okhttp": "^1.1.0"
33 |   },
34 |   "devDependencies": {
35 |     "@types/node": "^20.11.24",
36 |     "typescript": "^5.7.2"
37 |   }
38 | }
39 | 
```

--------------------------------------------------------------------------------
/smithery.yaml:
--------------------------------------------------------------------------------

```yaml
 1 | # Smithery configuration file: https://smithery.ai/docs/config#smitheryyaml
 2 | 
 3 | startCommand:
 4 |   type: stdio
 5 |   configSchema:
 6 |     # JSON Schema defining the configuration options for the MCP.
 7 |     type: object
 8 |     required:
 9 |       - confluenceApiMail
10 |       - confluenceApiKey
11 |       - confluenceUrl
12 |       - jiraUrl
13 |     properties:
14 |       confluenceApiMail:
15 |         type: string
16 |         description: Your email address for the Confluence API.
17 |       confluenceApiKey:
18 |         type: string
19 |         description: Your Confluence API key, obtained from Atlassian API Tokens.
20 |       confluenceUrl:
21 |         type: string
22 |         description: Your Confluence URL, e.g., 'https://yourcompany.atlassian.net'.
23 |       jiraUrl:
24 |         type: string
25 |         description: Your JIRA URL, e.g., 'https://yourcompany.atlassian.net'.
26 |   commandFunction:
27 |     # A function that produces the CLI command to start the MCP on stdio.
28 |     |-
29 |     config => ({command:'node', args:['build/index.js'], env:{CONFLUENCE_API_MAIL:config.confluenceApiMail, CONFLUENCE_API_KEY:config.confluenceApiKey, CONFLUENCE_URL:config.confluenceUrl, JIRA_URL:config.jiraUrl}})
30 | 
```