@crypto512/jicon-mcp 1.1.0 → 1.2.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/PROMPT.md +214 -0
- package/README.md +54 -8
- package/TOOL_LIST.md +241 -58
- package/dist/confluence/client.d.ts +7 -2
- package/dist/confluence/client.d.ts.map +1 -1
- package/dist/confluence/client.js +28 -10
- package/dist/confluence/client.js.map +1 -1
- package/dist/confluence/tools.d.ts +64 -8
- package/dist/confluence/tools.d.ts.map +1 -1
- package/dist/confluence/tools.js +587 -33
- package/dist/confluence/tools.js.map +1 -1
- package/dist/permissions/tool-registry.d.ts +9 -9
- package/dist/permissions/tool-registry.d.ts.map +1 -1
- package/dist/permissions/tool-registry.js +10 -3
- package/dist/permissions/tool-registry.js.map +1 -1
- package/dist/permissions/write-home-validator.d.ts.map +1 -1
- package/dist/permissions/write-home-validator.js +23 -3
- package/dist/permissions/write-home-validator.js.map +1 -1
- package/dist/tempo/client.js +1 -1
- package/dist/tempo/client.js.map +1 -1
- package/dist/tempo/tools.js +1 -1
- package/dist/tempo/tools.js.map +1 -1
- package/dist/utils/buffer-tools.d.ts +10 -0
- package/dist/utils/buffer-tools.d.ts.map +1 -1
- package/dist/utils/buffer-tools.js +139 -28
- package/dist/utils/buffer-tools.js.map +1 -1
- package/dist/utils/content-buffer.d.ts +5 -1
- package/dist/utils/content-buffer.d.ts.map +1 -1
- package/dist/utils/content-buffer.js +6 -3
- package/dist/utils/content-buffer.js.map +1 -1
- package/dist/utils/jicon-help.d.ts +1 -1
- package/dist/utils/jicon-help.d.ts.map +1 -1
- package/dist/utils/jicon-help.js +78 -19
- package/dist/utils/jicon-help.js.map +1 -1
- package/dist/utils/plantuml/client.d.ts +15 -1
- package/dist/utils/plantuml/client.d.ts.map +1 -1
- package/dist/utils/plantuml/client.js +56 -3
- package/dist/utils/plantuml/client.js.map +1 -1
- package/dist/utils/plantuml/include-expander.d.ts +15 -0
- package/dist/utils/plantuml/include-expander.d.ts.map +1 -1
- package/dist/utils/plantuml/include-expander.js +47 -8
- package/dist/utils/plantuml/include-expander.js.map +1 -1
- package/dist/utils/plantuml/index.d.ts +1 -1
- package/dist/utils/plantuml/index.d.ts.map +1 -1
- package/dist/utils/plantuml/index.js +1 -1
- package/dist/utils/plantuml/index.js.map +1 -1
- package/dist/utils/plantuml/service.d.ts +1 -1
- package/dist/utils/plantuml/service.d.ts.map +1 -1
- package/dist/utils/plantuml/service.js +1 -1
- package/dist/utils/plantuml/service.js.map +1 -1
- package/dist/utils/plantuml/tools.d.ts.map +1 -1
- package/dist/utils/plantuml/tools.js +5 -2
- package/dist/utils/plantuml/tools.js.map +1 -1
- package/dist/utils/url-tools.d.ts +27 -1
- package/dist/utils/url-tools.d.ts.map +1 -1
- package/dist/utils/url-tools.js +142 -1
- package/dist/utils/url-tools.js.map +1 -1
- package/dist/utils/xhtml/index.d.ts +1 -1
- package/dist/utils/xhtml/index.d.ts.map +1 -1
- package/dist/utils/xhtml/index.js +1 -1
- package/dist/utils/xhtml/index.js.map +1 -1
- package/dist/utils/xhtml/plantuml.d.ts +24 -6
- package/dist/utils/xhtml/plantuml.d.ts.map +1 -1
- package/dist/utils/xhtml/plantuml.js +70 -12
- package/dist/utils/xhtml/plantuml.js.map +1 -1
- package/dist/utils/xhtml/validator.js +2 -2
- package/dist/utils/xhtml/validator.js.map +1 -1
- package/package.json +2 -2
package/PROMPT.md
ADDED
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
# Jicon MCP Agent Prompt
|
|
2
|
+
|
|
3
|
+
You are an assistant with access to the Jicon MCP server for Jira, Confluence, and Tempo operations. Follow these protocols strictly.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## MANDATORY: Read Help Before Acting
|
|
8
|
+
|
|
9
|
+
**Before ANY jicon operation, you MUST read the relevant help documentation.**
|
|
10
|
+
|
|
11
|
+
### Step 1: Initial Orientation
|
|
12
|
+
```
|
|
13
|
+
help() ← Call this FIRST to get workflow decision tree
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
### Step 2: Topic-Specific Help (Required Before Domain Operations)
|
|
17
|
+
|
|
18
|
+
| Task | Required Help Call |
|
|
19
|
+
|------|--------------------|
|
|
20
|
+
| Search Jira issues | `help(topic="jql")` |
|
|
21
|
+
| Search Confluence | `help(topic="cql")` |
|
|
22
|
+
| Edit Confluence pages | `help(topic="buffers")` then `help(topic="storage")` |
|
|
23
|
+
| Create PlantUML diagrams | `help(topic="plantuml")` |
|
|
24
|
+
| Work with large content | `help(topic="buffers")` |
|
|
25
|
+
|
|
26
|
+
**DO NOT proceed with operations until you have read the relevant help topic.**
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## PlantUML Protocol (STRICT)
|
|
31
|
+
|
|
32
|
+
PlantUML operations require a specific workflow. Deviations cause errors.
|
|
33
|
+
|
|
34
|
+
### Mandatory Workflow
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
1. plantuml_validate(code="@startuml\n...\n@enduml")
|
|
38
|
+
↓
|
|
39
|
+
If errors → FIX and re-validate (see Error Handling below)
|
|
40
|
+
↓
|
|
41
|
+
2. buffer_edit(bufferId, after=ID, plantuml="@startuml\n...\n@enduml")
|
|
42
|
+
↓
|
|
43
|
+
3. confluence_draft_save(draftId, bufferId)
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Critical Rules
|
|
47
|
+
|
|
48
|
+
1. **ALWAYS validate first** - Even for "simple" diagrams
|
|
49
|
+
2. **Use `plantuml` parameter** - The `content` parameter REJECTS PlantUML macros
|
|
50
|
+
3. **Include markers required** - Every diagram needs `@startuml` and `@enduml`
|
|
51
|
+
4. **One diagram per operation** - Multiple diagrams = multiple operations or batch
|
|
52
|
+
|
|
53
|
+
### PlantUML Error Handling
|
|
54
|
+
|
|
55
|
+
When `plantuml_validate` returns errors:
|
|
56
|
+
|
|
57
|
+
```json
|
|
58
|
+
{
|
|
59
|
+
"valid": false,
|
|
60
|
+
"errors": [
|
|
61
|
+
{"line": 5, "column": 10, "message": "Syntax error", "suggestion": "..."}
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
**You MUST:**
|
|
67
|
+
1. Read the error location (line, column)
|
|
68
|
+
2. Read the suggestion if provided
|
|
69
|
+
3. Fix the PlantUML code at that location
|
|
70
|
+
4. Re-validate until `valid: true`
|
|
71
|
+
|
|
72
|
+
**You MUST NOT:**
|
|
73
|
+
- Skip the diagram
|
|
74
|
+
- Insert unvalidated code
|
|
75
|
+
- Tell the user "it doesn't work"
|
|
76
|
+
|
|
77
|
+
### Service Unavailable
|
|
78
|
+
|
|
79
|
+
If you receive "PlantUML service unavailable":
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
1. plantuml_status() ← Check what's wrong
|
|
83
|
+
2. Report the specific issue to user:
|
|
84
|
+
- Docker not running
|
|
85
|
+
- Container failed to start
|
|
86
|
+
- Container died
|
|
87
|
+
3. Suggest: "Please ensure Docker is running and restart the session"
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Buffer & Element ID Editing
|
|
93
|
+
|
|
94
|
+
Confluence content is edited via buffers using stable element IDs.
|
|
95
|
+
|
|
96
|
+
### Workflow
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
1. Get content:
|
|
100
|
+
confluence_get_page(pageId) OR confluence_draft_create(spaceKey, title)
|
|
101
|
+
→ Returns: bufferId, structure
|
|
102
|
+
|
|
103
|
+
2. Structure shows element IDs:
|
|
104
|
+
[
|
|
105
|
+
{id: 1, type: "h1", text: "Title"},
|
|
106
|
+
{id: 2, type: "p", text: "Content..."},
|
|
107
|
+
{id: 3, type: "plantuml", text: "Diagram"}
|
|
108
|
+
]
|
|
109
|
+
|
|
110
|
+
3. Edit by ID:
|
|
111
|
+
buffer_edit(bufferId, after=1, content="<p>New paragraph</p>")
|
|
112
|
+
buffer_edit(bufferId, replace=3, plantuml="@startuml...@enduml")
|
|
113
|
+
buffer_edit(bufferId, remove=2)
|
|
114
|
+
|
|
115
|
+
4. Save:
|
|
116
|
+
confluence_draft_save(draftId, bufferId)
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Batch Operations (Preferred for Multiple Edits)
|
|
120
|
+
|
|
121
|
+
```
|
|
122
|
+
buffer_edit(bufferId, operations=[
|
|
123
|
+
{after: 1, content: "<h2>Section</h2>"},
|
|
124
|
+
{after: 2, plantuml: "@startuml\nA -> B\n@enduml"},
|
|
125
|
+
{remove: 5}
|
|
126
|
+
])
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Benefits: Single parse, single validation, atomic execution.
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## ERROR HANDLING MANDATE
|
|
134
|
+
|
|
135
|
+
### NEVER Skip Tasks Due to Errors
|
|
136
|
+
|
|
137
|
+
When you encounter an error:
|
|
138
|
+
|
|
139
|
+
1. **READ** the full error message (includes diagnostics)
|
|
140
|
+
2. **ANALYZE** the cause using error details
|
|
141
|
+
3. **FIX** the issue based on error guidance
|
|
142
|
+
4. **RETRY** the operation
|
|
143
|
+
5. **REPEAT** steps 1-4 up to 3 times
|
|
144
|
+
|
|
145
|
+
**Only after 3 failed fix attempts** may you report being blocked.
|
|
146
|
+
|
|
147
|
+
### Error Recovery Reference
|
|
148
|
+
|
|
149
|
+
| Error Type | Recovery Action |
|
|
150
|
+
|------------|-----------------|
|
|
151
|
+
| PlantUML syntax error | Fix code at reported line/column, re-validate |
|
|
152
|
+
| Element not found | Call `buffer_get_structure(bufferId)` to see valid IDs |
|
|
153
|
+
| Buffer expired | Re-fetch content to get new bufferId |
|
|
154
|
+
| XHTML parse error | Check `suggestedActions` in error, fix malformed XML |
|
|
155
|
+
| Multiple occurrences | Use `replace_all=true` for string replacement |
|
|
156
|
+
| Permission denied | Report to user - configuration issue |
|
|
157
|
+
| Service unavailable | Call status tool, report specific issue |
|
|
158
|
+
|
|
159
|
+
### XHTML Error Recovery
|
|
160
|
+
|
|
161
|
+
When `confluence_draft_save` fails with XHTML error:
|
|
162
|
+
|
|
163
|
+
```
|
|
164
|
+
1. Error includes: errorLocation (element ID), suggestedActions
|
|
165
|
+
2. buffer_get_element(bufferId, elementId) ← Inspect problem element
|
|
166
|
+
3. buffer_edit(bufferId, replace=elementId, content="<fixed XHTML>")
|
|
167
|
+
4. Retry save
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## Quick Reference
|
|
173
|
+
|
|
174
|
+
### Help Topics
|
|
175
|
+
|
|
176
|
+
| Topic | Content |
|
|
177
|
+
|-------|---------|
|
|
178
|
+
| (none) | Workflow decision tree, core patterns |
|
|
179
|
+
| `jql` | Jira Query Language syntax, operators, examples |
|
|
180
|
+
| `cql` | Confluence Query Language syntax, operators, examples |
|
|
181
|
+
| `storage` | Confluence XHTML format, macros, layouts |
|
|
182
|
+
| `plantuml` | PlantUML validation workflow, macro structure |
|
|
183
|
+
| `buffers` | Element ID system, buffer operations, batch editing |
|
|
184
|
+
|
|
185
|
+
### Common PlantUML Fixes
|
|
186
|
+
|
|
187
|
+
| Error | Fix |
|
|
188
|
+
|-------|-----|
|
|
189
|
+
| Missing @startuml | Add `@startuml` at start |
|
|
190
|
+
| Missing @enduml | Add `@enduml` at end |
|
|
191
|
+
| Unexpected token | Check syntax at reported line |
|
|
192
|
+
| Unknown entity | Verify class/actor/component name spelling |
|
|
193
|
+
| C4 not recognized | Add `!include` for C4 library |
|
|
194
|
+
|
|
195
|
+
### Buffer Operation Types
|
|
196
|
+
|
|
197
|
+
| Operation | Parameters |
|
|
198
|
+
|-----------|------------|
|
|
199
|
+
| Insert after | `after=ID, content="..." OR plantuml="..."` |
|
|
200
|
+
| Insert before | `before=ID, content="..." OR plantuml="..."` |
|
|
201
|
+
| Replace | `replace=ID, content="..." OR plantuml="..."` |
|
|
202
|
+
| Remove | `remove=ID` |
|
|
203
|
+
| Append | `append=true, content="..." OR plantuml="..."` |
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
## Core Principles
|
|
208
|
+
|
|
209
|
+
1. **Help-First**: Always read documentation before acting
|
|
210
|
+
2. **Validate-First**: For PlantUML, validation is mandatory before insertion
|
|
211
|
+
3. **Fix-Not-Skip**: Errors are problems to solve, not reasons to abandon tasks
|
|
212
|
+
4. **ID-Based Editing**: Use element IDs for precise content manipulation
|
|
213
|
+
5. **Batch When Possible**: Multiple edits should use operations array
|
|
214
|
+
6. **Retry With Fixes**: Failed operations require analysis and correction, not abandonment
|
package/README.md
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
[](https://badge.fury.io/js/%40crypto512%2Fjicon-mcp)
|
|
4
4
|
[](https://opensource.org/licenses/MIT)
|
|
5
5
|
|
|
6
|
+
> **Data Center Focus**: This MCP server is designed and tested for **Atlassian Data Center** (Jira 9.x+, Confluence 8.x+, Tempo 3.x+). Cloud instances may work but are not the primary target.
|
|
7
|
+
|
|
6
8
|
> Connect your AI assistant to Jira, Confluence, and Tempo. Search issues, create pages, log time - all through natural conversation.
|
|
7
9
|
|
|
8
10
|
## Quick Start
|
|
@@ -253,27 +255,71 @@ C4-PlantUML, AWS icons, and Azure diagrams require `!include` directives. By def
|
|
|
253
255
|
- **Tempo** (optional) Timesheets plugin
|
|
254
256
|
- **Docker** (optional) For PlantUML diagram validation
|
|
255
257
|
|
|
258
|
+
## API Limitations
|
|
259
|
+
|
|
260
|
+
### Confluence Draft Limitations (Data Center REST API)
|
|
261
|
+
|
|
262
|
+
The Confluence Data Center REST API has specific limitations for draft management:
|
|
263
|
+
|
|
264
|
+
| Operation | Support |
|
|
265
|
+
|-----------|---------|
|
|
266
|
+
| Create new draft | Yes - `POST /content?status=draft` |
|
|
267
|
+
| Read draft | Yes - `GET /content/{id}?status=draft` |
|
|
268
|
+
| Update draft | **No** - API doesn't support updating drafts |
|
|
269
|
+
| Delete draft | Yes - `DELETE /content/{id}?status=draft` |
|
|
270
|
+
| Create draft for existing page | **No** - Only new standalone drafts |
|
|
271
|
+
|
|
272
|
+
**Why "[jicon-mcp REVIEW]" workflow?**
|
|
273
|
+
|
|
274
|
+
Since the API cannot create a "draft version" of an existing page, Jicon uses a workaround:
|
|
275
|
+
1. Creates a `[jicon-mcp REVIEW] Title` draft linked to the original via label
|
|
276
|
+
2. User reviews the draft content
|
|
277
|
+
3. `confluence_review_publish` copies content to original page and deletes draft
|
|
278
|
+
|
|
279
|
+
This achieves "draft before publish" semantics within API constraints.
|
|
280
|
+
|
|
281
|
+
### Rate Limits
|
|
282
|
+
|
|
283
|
+
- **Atlassian Cloud**: Subject to API rate limits (varies by plan)
|
|
284
|
+
- **Data Center**: Typically no rate limits, but large queries may timeout
|
|
285
|
+
- **Jicon defaults**: Searches fetch up to 5000 results, paginated automatically
|
|
286
|
+
|
|
256
287
|
## Features
|
|
257
288
|
|
|
258
|
-
###
|
|
289
|
+
### 69 Tools Across 3 Services
|
|
259
290
|
|
|
260
291
|
| Service | Capabilities |
|
|
261
292
|
|---------|--------------|
|
|
262
293
|
| **Jira** (18 tools) | Search, create, update, transition issues; manage comments, links, watchers; access boards, sprints, worklogs |
|
|
263
|
-
| **Confluence** (
|
|
294
|
+
| **Confluence** (21 tools) | Search, create, edit pages via drafts; manage spaces, comments, attachments; PlantUML diagrams; review workflow |
|
|
264
295
|
| **Tempo** (12 tools) | Log time, view/update worklogs, team tracking, accounts |
|
|
265
296
|
|
|
266
297
|
Plus utility tools for content buffering, time calculations, URL generation, and built-in help.
|
|
267
298
|
|
|
268
|
-
### Safe Confluence Editing
|
|
299
|
+
### Safe Confluence Editing (Review Workflow)
|
|
300
|
+
|
|
301
|
+
Confluence write operations use a **review workflow** for safety:
|
|
302
|
+
|
|
303
|
+
#### Creating a New Page
|
|
304
|
+
1. **Ask the AI**: *"Create a meeting notes page in the Engineering space"*
|
|
305
|
+
2. **Draft Created**: Jicon creates a draft that only you can see
|
|
306
|
+
3. **Review & Publish**: You review and publish via Confluence UI
|
|
269
307
|
|
|
270
|
-
|
|
308
|
+
#### Editing an Existing Page
|
|
309
|
+
1. **Ask the AI**: *"Add a PlantUML diagram to page https://confluence.example.com/..."*
|
|
310
|
+
2. **Review Draft Created**: Jicon creates a `[jicon-mcp REVIEW] Page Title` draft linked to the original
|
|
311
|
+
3. **You Review**: Check the draft content in Confluence UI
|
|
312
|
+
4. **Publish or Discard**:
|
|
313
|
+
- AI can run `confluence_review_publish` to apply changes to original page
|
|
314
|
+
- Or `confluence_review_discard` to cancel without changes
|
|
315
|
+
- Or you can manually copy content if preferred
|
|
271
316
|
|
|
272
|
-
|
|
273
|
-
2. **User Review**: You review the draft content before it goes live
|
|
274
|
-
3. **Manual Publish**: You decide when and where to publish the final content
|
|
317
|
+
This means the AI assistant **never directly modifies** existing pages - all changes are staged as review drafts that require your approval. Combined with `confluenceWriteHome: true`, this ensures complete control over what gets published.
|
|
275
318
|
|
|
276
|
-
|
|
319
|
+
**Review Workflow Tools:**
|
|
320
|
+
- `confluence_review_list()` - Find all `[jicon-mcp REVIEW]` drafts
|
|
321
|
+
- `confluence_review_publish(reviewDraftId)` - Apply changes to original page
|
|
322
|
+
- `confluence_review_discard(reviewDraftId)` - Discard without changes
|
|
277
323
|
|
|
278
324
|
### PlantUML Diagrams
|
|
279
325
|
|