@crypto512/jicon-mcp 0.6.1 → 0.7.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.
Files changed (74) hide show
  1. package/CLAUDE.md +252 -27
  2. package/README.md +237 -34
  3. package/TOOL_LIST.md +201 -5
  4. package/dist/config/types.d.ts +6 -6
  5. package/dist/config/types.d.ts.map +1 -1
  6. package/dist/config/types.js +3 -2
  7. package/dist/config/types.js.map +1 -1
  8. package/dist/confluence/client.d.ts +8 -16
  9. package/dist/confluence/client.d.ts.map +1 -1
  10. package/dist/confluence/client.js +75 -43
  11. package/dist/confluence/client.js.map +1 -1
  12. package/dist/confluence/formatters.d.ts +4 -0
  13. package/dist/confluence/formatters.d.ts.map +1 -1
  14. package/dist/confluence/formatters.js +19 -0
  15. package/dist/confluence/formatters.js.map +1 -1
  16. package/dist/confluence/tools.d.ts +9 -36
  17. package/dist/confluence/tools.d.ts.map +1 -1
  18. package/dist/confluence/tools.js +90 -158
  19. package/dist/confluence/tools.js.map +1 -1
  20. package/dist/index.js +9 -1
  21. package/dist/index.js.map +1 -1
  22. package/dist/jira/client.d.ts +9 -9
  23. package/dist/jira/client.d.ts.map +1 -1
  24. package/dist/jira/client.js +252 -30
  25. package/dist/jira/client.js.map +1 -1
  26. package/dist/jira/formatters.d.ts +4 -0
  27. package/dist/jira/formatters.d.ts.map +1 -1
  28. package/dist/jira/formatters.js +24 -0
  29. package/dist/jira/formatters.js.map +1 -1
  30. package/dist/jira/tools.d.ts +36 -36
  31. package/dist/jira/tools.d.ts.map +1 -1
  32. package/dist/jira/tools.js +161 -139
  33. package/dist/jira/tools.js.map +1 -1
  34. package/dist/jira/types.d.ts +50 -0
  35. package/dist/jira/types.d.ts.map +1 -1
  36. package/dist/permissions/filter.d.ts.map +1 -1
  37. package/dist/permissions/filter.js +42 -13
  38. package/dist/permissions/filter.js.map +1 -1
  39. package/dist/permissions/tool-registry.d.ts +33 -14
  40. package/dist/permissions/tool-registry.d.ts.map +1 -1
  41. package/dist/permissions/tool-registry.js +80 -5
  42. package/dist/permissions/tool-registry.js.map +1 -1
  43. package/dist/tempo/client.d.ts +1 -0
  44. package/dist/tempo/client.d.ts.map +1 -1
  45. package/dist/tempo/client.js +43 -0
  46. package/dist/tempo/client.js.map +1 -1
  47. package/dist/tempo/formatters.d.ts +4 -0
  48. package/dist/tempo/formatters.d.ts.map +1 -1
  49. package/dist/tempo/formatters.js +24 -0
  50. package/dist/tempo/formatters.js.map +1 -1
  51. package/dist/tempo/tools.d.ts +21 -0
  52. package/dist/tempo/tools.d.ts.map +1 -1
  53. package/dist/tempo/tools.js +74 -134
  54. package/dist/tempo/tools.js.map +1 -1
  55. package/dist/types.d.ts +1 -0
  56. package/dist/types.d.ts.map +1 -1
  57. package/dist/types.js.map +1 -1
  58. package/dist/utils/buffer-tools.d.ts +128 -0
  59. package/dist/utils/buffer-tools.d.ts.map +1 -0
  60. package/dist/utils/buffer-tools.js +312 -0
  61. package/dist/utils/buffer-tools.js.map +1 -0
  62. package/dist/utils/content-buffer.d.ts +132 -0
  63. package/dist/utils/content-buffer.d.ts.map +1 -0
  64. package/dist/utils/content-buffer.js +313 -0
  65. package/dist/utils/content-buffer.js.map +1 -0
  66. package/dist/utils/response-formatter.d.ts +5 -1
  67. package/dist/utils/response-formatter.d.ts.map +1 -1
  68. package/dist/utils/response-formatter.js +52 -2
  69. package/dist/utils/response-formatter.js.map +1 -1
  70. package/dist/utils/workload-tools.d.ts +68 -0
  71. package/dist/utils/workload-tools.d.ts.map +1 -0
  72. package/dist/utils/workload-tools.js +134 -0
  73. package/dist/utils/workload-tools.js.map +1 -0
  74. package/package.json +1 -1
package/CLAUDE.md CHANGED
@@ -13,6 +13,7 @@ A Model Context Protocol (MCP) server that provides seamless integration with At
13
13
  - **Comments & Collaboration**: Add and retrieve comments on issues
14
14
  - **Issue Linking**: Create and manage relationships between issues
15
15
  - **Advanced Search**: Execute JQL queries for complex issue searches
16
+ - **Recursive Worklogs**: Sum worklogs for an issue and all its children (sub-tasks, Epic children)
16
17
 
17
18
  ### Confluence Integration
18
19
  - **Content Management**: Create, read, update Confluence pages
@@ -26,6 +27,7 @@ A Model Context Protocol (MCP) server that provides seamless integration with At
26
27
  - **Time Tracking**: Log, view, and manage work time
27
28
  - **Worklog Management**: Create, update, and delete worklogs
28
29
  - **Team Tracking**: Access team worklogs and time tracking data
30
+ - **Epic Worklogs**: Get all worklogs for an Epic and its children in one call
29
31
  - **Account Management**: View and manage Tempo accounts
30
32
  - **User Info**: Retrieve user time tracking information
31
33
  - **v4 API**: Uses Tempo v4 API with automatic key-to-ID conversion
@@ -140,19 +142,26 @@ Tempo uses the same authentication as Jira (same URL and credentials). This serv
140
142
 
141
143
  ### Jira Tools
142
144
 
145
+ #### `jira_jql_help`
146
+ Get JQL (Jira Query Language) syntax guide and examples on-demand.
147
+
148
+ Returns a comprehensive JQL reference including operators, common examples, and tips. Use this when you need help constructing JQL queries.
149
+
150
+ **Parameters:** None
151
+
143
152
  #### `jira_search_issues`
144
153
  Search for Jira issues using JQL (Jira Query Language).
145
154
 
155
+ Automatically fetches ALL matching results (up to 5000) with buffering. Large responses are automatically buffered - use buffer_get_chunk or buffer_grep to access.
156
+
146
157
  **Parameters:**
147
158
  - `jql` (string, required): JQL query string
148
- - `maxResults` (number, optional): Maximum number of results (default: 50)
149
159
  - `fields` (string[], optional): Specific fields to return
150
160
 
151
161
  **Example:**
152
162
  ```typescript
153
163
  {
154
164
  "jql": "project = PROJ AND status = 'In Progress'",
155
- "maxResults": 10,
156
165
  "fields": ["summary", "status", "assignee"]
157
166
  }
158
167
  ```
@@ -253,13 +262,74 @@ Add a comment to a Jira issue.
253
262
  ```
254
263
 
255
264
  #### `jira_get_issue_comments`
256
- Retrieve comments from a Jira issue.
265
+ Retrieve all comments from a Jira issue.
266
+
267
+ Returns all comments for the issue. If the response is large, it will be automatically buffered.
257
268
 
258
269
  **Parameters:**
259
270
  - `issueKey` (string, required): Issue key
260
- - `maxResults` (number, optional): Maximum number of comments
261
271
  - `orderBy` (string, optional): Sort order ("created" or "-created")
262
272
 
273
+ #### `jira_get_issue_worklogs`
274
+ Retrieve all worklogs from a Jira issue.
275
+
276
+ Use this tool to analyze time logged against a specific issue. Returns worklog entries with author, date, time spent, and a total time summary.
277
+
278
+ Example: Get worklogs for PROJ-123 to see how much time was logged.
279
+
280
+ Large responses are automatically buffered - use buffer_get_chunk or buffer_grep to access.
281
+
282
+ **Parameters:**
283
+ - `issueKey` (string, required): Issue key (e.g., "PROJ-123")
284
+
285
+ **Example:**
286
+ ```typescript
287
+ {
288
+ "issueKey": "PROJ-123"
289
+ }
290
+ ```
291
+
292
+ #### `jira_get_total_worklogs`
293
+ Get total worklogs for an issue and all its children recursively.
294
+
295
+ Calculates the sum of all time logged on:
296
+ - The specified issue
297
+ - All sub-tasks
298
+ - All issues in the Epic (if the issue is an Epic)
299
+
300
+ Returns a breakdown by issue and a grand total. Automatically detects the Epic Link field in your Jira instance.
301
+
302
+ **Parameters:**
303
+ - `issueKey` (string, required): Issue key (e.g., "PROJ-123")
304
+
305
+ **Example:**
306
+ ```typescript
307
+ {
308
+ "issueKey": "PROJ-100"
309
+ }
310
+ ```
311
+
312
+ **Response:**
313
+ ```json
314
+ {
315
+ "rootIssue": "PROJ-100",
316
+ "totalTimeSpentSeconds": 86400,
317
+ "totalTimeSpent": "24h",
318
+ "totalWorklogCount": 15,
319
+ "issueCount": 5,
320
+ "breakdown": [
321
+ {
322
+ "issueKey": "PROJ-100",
323
+ "summary": "Epic: Implement feature X",
324
+ "issueType": "Epic",
325
+ "timeSpentSeconds": 3600,
326
+ "timeSpent": "1h",
327
+ "worklogCount": 2
328
+ }
329
+ ]
330
+ }
331
+ ```
332
+
263
333
  #### `jira_list_projects`
264
334
  List all accessible Jira projects.
265
335
 
@@ -305,34 +375,47 @@ Get information about an Agile board.
305
375
  - `boardId` (number, required): Board ID
306
376
 
307
377
  #### `jira_get_sprints`
308
- List sprints for a board.
378
+ List all sprints for a board.
379
+
380
+ Returns all sprints for the board. If the response is large, it will be automatically buffered.
309
381
 
310
382
  **Parameters:**
311
383
  - `boardId` (number, required): Board ID
312
384
  - `state` (string, optional): Sprint state filter ("active", "future", "closed")
313
385
 
314
386
  #### `jira_get_sprint_issues`
315
- Get issues in a specific sprint.
387
+ Get all issues in a specific sprint.
388
+
389
+ Returns all issues for the sprint. If the response is large, it will be automatically buffered.
316
390
 
317
391
  **Parameters:**
318
392
  - `sprintId` (number, required): Sprint ID
319
- - `maxResults` (number, optional): Maximum number of results
320
393
 
321
394
  ### Confluence Tools
322
395
 
396
+ #### `confluence_cql_help`
397
+ Get CQL (Confluence Query Language) syntax guide and examples on-demand.
398
+
399
+ Returns a comprehensive CQL reference including operators, common examples, critical warnings about invalid syntax (like not using `content~` or `body~`), and tips. Use this when you need help constructing CQL queries.
400
+
401
+ **Parameters:** None
402
+
323
403
  #### `confluence_search_content`
324
404
  Search Confluence content using CQL (Confluence Query Language).
325
405
 
326
406
  **Parameters:**
327
407
  - `cql` (string, required): CQL query string
328
- - `limit` (number, optional): Maximum number of results (default: 25)
408
+ - `limit` (number, optional): Maximum results per page (default: 25). When fetchAll=true, max total results (default: 5000)
329
409
  - `expand` (string[], optional): Additional data to expand
410
+ - `start` (number, optional): Index of first result (0-based). Ignored when fetchAll=true
411
+ - `fetchAll` (boolean, optional): Automatically fetch all results across pages (default: false, max: 5000)
330
412
 
331
413
  **Example:**
332
414
  ```typescript
333
415
  {
334
416
  "cql": "type=page AND space=DOCS AND title~'API'",
335
- "limit": 10
417
+ "fetchAll": true,
418
+ "limit": 100
336
419
  }
337
420
  ```
338
421
 
@@ -415,8 +498,9 @@ Delete a Confluence page.
415
498
  #### `confluence_list_spaces`
416
499
  List all accessible Confluence spaces.
417
500
 
501
+ Returns all spaces accessible to the current user. If the response is large, it will be automatically buffered.
502
+
418
503
  **Parameters:**
419
- - `limit` (number, optional): Maximum number of results
420
504
  - `type` (string, optional): Space type filter ("global" or "personal")
421
505
 
422
506
  #### `confluence_get_space`
@@ -427,12 +511,13 @@ Get detailed information about a space.
427
511
  - `expand` (string[], optional): Additional data to expand
428
512
 
429
513
  #### `confluence_get_page_children`
430
- Get child pages of a page.
514
+ Get all child pages of a page.
515
+
516
+ Returns all child pages for the given parent page. If the response is large, it will be automatically buffered.
431
517
 
432
518
  **Parameters:**
433
519
  - `pageId` (string, required): Parent page ID
434
520
  - `expand` (string[], optional): Additional data to expand
435
- - `limit` (number, optional): Maximum number of results
436
521
 
437
522
  #### `confluence_add_comment`
438
523
  Add a comment to a Confluence page.
@@ -442,11 +527,12 @@ Add a comment to a Confluence page.
442
527
  - `comment` (string, required): Comment text (HTML format)
443
528
 
444
529
  #### `confluence_get_comments`
445
- Get comments on a Confluence page.
530
+ Get all comments on a Confluence page.
531
+
532
+ Returns all comments for the given page. If the response is large, it will be automatically buffered.
446
533
 
447
534
  **Parameters:**
448
535
  - `pageId` (string, required): Page ID
449
- - `limit` (number, optional): Maximum number of results
450
536
 
451
537
  #### `confluence_upload_attachment`
452
538
  Upload an attachment to a Confluence page.
@@ -457,11 +543,73 @@ Upload an attachment to a Confluence page.
457
543
  - `comment` (string, optional): Attachment comment
458
544
 
459
545
  #### `confluence_list_attachments`
460
- List attachments on a Confluence page.
546
+ List all attachments on a Confluence page.
547
+
548
+ Returns all attachments for the given page. If the response is large, it will be automatically buffered.
461
549
 
462
550
  **Parameters:**
463
551
  - `pageId` (string, required): Page ID
464
- - `limit` (number, optional): Maximum number of results
552
+
553
+ ### Utility Tools
554
+
555
+ #### `workload_convert`
556
+ Convert workload time between different units (seconds, hours, days).
557
+
558
+ Pure computation tool that helps with time tracking calculations. Automatically included as a dependency when using any Jira, Confluence, or Tempo tool.
559
+
560
+ **Parameters:**
561
+ - `value` (number, required): The time value to convert
562
+ - `unit` (string, required): The unit of the input value ("seconds", "hours", or "days")
563
+ - `hoursPerDay` (number, optional): Hours per work day (default: 8)
564
+
565
+ **Example:**
566
+ ```typescript
567
+ {
568
+ "value": 28800,
569
+ "unit": "seconds"
570
+ }
571
+ ```
572
+
573
+ **Response:**
574
+ ```json
575
+ {
576
+ "seconds": 28800,
577
+ "hours": 8,
578
+ "days": 1,
579
+ "formatted": "1d"
580
+ }
581
+ ```
582
+
583
+ #### `workload_sum`
584
+ Sum multiple workload values with mixed units.
585
+
586
+ Pure computation tool for aggregating time from multiple sources. Automatically included as a dependency when using any Jira, Confluence, or Tempo tool.
587
+
588
+ **Parameters:**
589
+ - `values` (array, required): Array of objects with `value` and `unit` properties
590
+ - `hoursPerDay` (number, optional): Hours per work day (default: 8)
591
+
592
+ **Example:**
593
+ ```typescript
594
+ {
595
+ "values": [
596
+ { "value": 3600, "unit": "seconds" },
597
+ { "value": 2, "unit": "hours" },
598
+ { "value": 0.5, "unit": "days" }
599
+ ]
600
+ }
601
+ ```
602
+
603
+ **Response:**
604
+ ```json
605
+ {
606
+ "itemCount": 3,
607
+ "seconds": 25200,
608
+ "hours": 7,
609
+ "days": 0.875,
610
+ "formatted": "7.0h"
611
+ }
612
+ ```
465
613
 
466
614
  ## Authentication
467
615
 
@@ -526,13 +674,41 @@ Common error scenarios:
526
674
  - **Monitor write operations** - Enable audit logging in your Atlassian instances
527
675
  - **Review permission configurations** - Regularly audit your .jicon.json whitelist/blacklist settings
528
676
 
677
+ ### Automatic Response Buffering
678
+
679
+ All tools return complete data automatically. When a response exceeds the size limit (default: 16000 characters), it is automatically buffered:
680
+
681
+ - **Automatic buffering** - Large responses are stored in a buffer and return a `bufferId`
682
+ - **Use `buffer_get_chunk`** - Retrieve content in chunks using the provided `bufferId`
683
+ - **Use `buffer_grep`** - Search within buffered content using regex patterns (large results are also buffered)
684
+ - **Configure limit** - Set `JICON_MAX_OUTPUT` environment variable to adjust the size limit
685
+ - **Use a sub-agent for analysis** - For complex analysis of large buffered data, spawn a sub-agent (Task tool) to process the buffer efficiently without consuming main conversation context
686
+
687
+ **Example buffered response:**
688
+ ```json
689
+ {
690
+ "_pagination": true,
691
+ "status": "SUCCESS - Data retrieved and buffered",
692
+ "bufferId": "buf_abc123",
693
+ "totalSize": 45000,
694
+ "hasMore": true,
695
+ "next_action": {
696
+ "tool": "buffer_get_chunk",
697
+ "args": { "bufferId": "buf_abc123", "offset": 0, "limit": 5000 }
698
+ }
699
+ }
700
+ ```
701
+
702
+ **Recommended approach for large data:**
703
+ 1. Use `buffer_grep` to search for specific patterns
704
+ 2. For complex analysis, spawn a sub-agent with the `bufferId` to process data without bloating main context
705
+
529
706
  ### Performance Considerations
530
- - **Use pagination for large datasets** - Set appropriate `maxResults` to avoid memory issues
531
- - **Enable `fetchAll` judiciously** - Auto-pagination can return up to 5000 results, which may be slow
532
707
  - **Filter queries narrowly** - Specific JQL/CQL queries are faster than broad searches
533
708
  - **Request only needed fields** - Use the `fields` parameter to reduce response size
534
709
  - **Respect API rate limits** - Atlassian Cloud has rate limits; space out bulk operations
535
710
  - **Use narrow date ranges for Tempo** - Tempo Server/DC doesn't support pagination, so use focused date filters
711
+ - **Use `buffer_grep` for large responses** - Search within buffered content instead of retrieving everything
536
712
 
537
713
  ## Development
538
714
 
@@ -554,29 +730,32 @@ jicon/
554
730
  │ │
555
731
  │ ├── utils/ # Shared utilities
556
732
  │ │ ├── http-client.ts # HTTP/Auth wrapper
557
- │ │ └── response-formatter.ts # MCP response formatting
733
+ │ │ ├── response-formatter.ts # MCP response formatting
734
+ │ │ ├── content-buffer.ts # Content buffering for large responses
735
+ │ │ ├── buffer-tools.ts # Buffer management tools
736
+ │ │ └── workload-tools.ts # Time calculation utilities
558
737
  │ │
559
- │ ├── jira/ # Jira integration (15 tools)
738
+ │ ├── jira/ # Jira integration (19 tools)
560
739
  │ │ ├── client.ts # Jira API client
561
740
  │ │ ├── tools.ts # Tool definitions
562
741
  │ │ ├── formatters.ts # Response formatting
563
742
  │ │ ├── types.ts # TypeScript types
564
743
  │ │ └── defaults.ts # Default field configs
565
744
  │ │
566
- │ ├── confluence/ # Confluence integration (13 tools)
745
+ │ ├── confluence/ # Confluence integration (14 tools)
567
746
  │ │ ├── client.ts # Confluence API client
568
747
  │ │ ├── tools.ts # Tool definitions
569
748
  │ │ ├── formatters.ts # Response formatting
570
749
  │ │ ├── types.ts # TypeScript types
571
750
  │ │ └── defaults.ts # Default field configs
572
751
  │ │
573
- │ └── tempo/ # Tempo integration (11 tools)
752
+ │ └── tempo/ # Tempo integration (12 tools)
574
753
  │ ├── client.ts # Tempo API client
575
754
  │ ├── tools.ts # Tool definitions
576
755
  │ ├── formatters.ts # Response formatting
577
756
  │ └── types.ts # TypeScript types
578
757
 
579
- ├── tests/ # Test suite (86 tests)
758
+ ├── tests/ # Test suite (146 tests)
580
759
  │ ├── permissions/ # Permission system tests
581
760
  │ ├── jira/ # Jira client tests
582
761
  │ ├── confluence/ # Confluence client tests
@@ -597,11 +776,23 @@ npm run build
597
776
  ```
598
777
 
599
778
  ### Testing
779
+
780
+ Tests are written in TypeScript and use Node.js built-in test runner with tsx:
781
+
600
782
  ```bash
783
+ # Run all tests with tsx
784
+ npx tsx --test tests/**/*.test.ts
785
+
786
+ # Run specific test file
787
+ npx tsx --test tests/utils/content-buffer.test.ts
788
+
789
+ # Legacy command (requires compiled dist/)
601
790
  npm test
602
791
  npm run test:integration
603
792
  ```
604
793
 
794
+ **Note:** Tests import from `dist/`, so run `npm run build` first if testing against compiled output.
795
+
605
796
  ## Roadmap
606
797
 
607
798
  ### v1.0 (Current)
@@ -641,9 +832,42 @@ MIT License - see LICENSE file for details
641
832
  - **Rotate tokens regularly**: Set 90-day expiration and rotate before expiry
642
833
 
643
834
  #### 2. Permission Configuration
644
- - **Start with read-only mode**: Default to `"mode": "readonly"` for safety
645
- - **Use custom permissions for specific workflows**: Whitelist only required tools
646
- - **Example read-only configuration**:
835
+
836
+ **Permission Modes:**
837
+ - `readonly`: All read tools (Jira read + Confluence read + Tempo read)
838
+ - `full`: All tools including write operations
839
+ - `custom`: Whitelist/blacklist specific virtual actions
840
+
841
+ **Default Configuration:** `custom` mode with `jira_read` + `confluence_read` (Tempo disabled by default)
842
+
843
+ **Auto-included Dependencies:** (not configurable separately)
844
+ - Buffer read tools (buffer_get_chunk, buffer_grep, etc.) → included with read actions
845
+ - Buffer write tools (buffer_edit) → included with write actions
846
+ - Workload tools (workload_convert, workload_sum) → included with any Jira/Confluence/Tempo tool
847
+
848
+ **Virtual Actions (9 total):**
849
+ | Action | Description |
850
+ |--------|-------------|
851
+ | `jira_read` | 14 Jira read tools (includes jira_jql_help) |
852
+ | `jira_write` | 5 Jira write tools |
853
+ | `jira_all` | All 19 Jira tools |
854
+ | `confluence_read` | 9 Confluence read tools (includes confluence_cql_help) |
855
+ | `confluence_write` | 5 Confluence write tools |
856
+ | `confluence_all` | All 14 Confluence tools |
857
+ | `tempo_read` | 9 Tempo read tools |
858
+ | `tempo_write` | 3 Tempo write tools |
859
+ | `tempo_all` | All 12 Tempo tools |
860
+
861
+ - **Example default configuration** (Jira + Confluence read only):
862
+ ```json
863
+ {
864
+ "permissions": {
865
+ "mode": "custom",
866
+ "whitelist": ["jira_read", "confluence_read"]
867
+ }
868
+ }
869
+ ```
870
+ - **Example read-only configuration** (all read tools including Tempo):
647
871
  ```json
648
872
  {
649
873
  "permissions": {
@@ -651,7 +875,7 @@ MIT License - see LICENSE file for details
651
875
  }
652
876
  }
653
877
  ```
654
- - **Example custom configuration**:
878
+ - **Example custom configuration with Tempo**:
655
879
  ```json
656
880
  {
657
881
  "permissions": {
@@ -720,3 +944,4 @@ If credentials are compromised:
720
944
  ## Acknowledgments
721
945
 
722
946
  Built on the [Model Context Protocol](https://modelcontextprotocol.io) by Anthropic.
947
+ - Use buffer management if tool response is too large.