backlog-mcp-server 0.17.0 → 0.18.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 (154) hide show
  1. package/README.ja.md +15 -32
  2. package/README.md +20 -32
  3. package/build/auth/oauthRoutes.js +53 -1
  4. package/build/createBacklogMcpServer.d.ts +4 -6
  5. package/build/createBacklogMcpServer.js +4 -12
  6. package/build/handlers/builders/composeToolHandler.d.ts +1 -1
  7. package/build/handlers/builders/composeToolHandler.js +15 -9
  8. package/build/handlers/transformers/wrapWithFieldPicking.d.ts +14 -1
  9. package/build/handlers/transformers/wrapWithFieldPicking.js +30 -36
  10. package/build/index.js +20 -15
  11. package/build/lib.d.ts +1 -1
  12. package/build/reportUnknownOverrideKeys.js +0 -1
  13. package/build/tools/addDocument.d.ts +2 -2
  14. package/build/tools/addDocument.js +17 -2
  15. package/build/tools/addIssue.d.ts +2 -2
  16. package/build/tools/addIssue.js +32 -2
  17. package/build/tools/addIssueComment.d.ts +2 -2
  18. package/build/tools/addIssueComment.js +14 -2
  19. package/build/tools/addProject.d.ts +2 -2
  20. package/build/tools/addProject.js +22 -2
  21. package/build/tools/addPullRequest.d.ts +2 -2
  22. package/build/tools/addPullRequest.js +26 -2
  23. package/build/tools/addPullRequestComment.d.ts +2 -2
  24. package/build/tools/addPullRequestComment.js +12 -2
  25. package/build/tools/addRelatedIssue.d.ts +2 -2
  26. package/build/tools/addRelatedIssue.js +33 -2
  27. package/build/tools/addVersionMilestone.d.ts +2 -2
  28. package/build/tools/addVersionMilestone.js +12 -2
  29. package/build/tools/addWatching.d.ts +2 -2
  30. package/build/tools/addWatching.js +12 -2
  31. package/build/tools/addWiki.d.ts +2 -2
  32. package/build/tools/addWiki.js +16 -2
  33. package/build/tools/countIssues.d.ts +2 -2
  34. package/build/tools/countIssues.js +3 -2
  35. package/build/tools/deleteIssue.d.ts +2 -2
  36. package/build/tools/deleteIssue.js +32 -2
  37. package/build/tools/deleteProject.d.ts +2 -2
  38. package/build/tools/deleteProject.js +22 -2
  39. package/build/tools/deleteVersion.d.ts +2 -2
  40. package/build/tools/deleteVersion.js +12 -2
  41. package/build/tools/deleteWatching.d.ts +2 -2
  42. package/build/tools/deleteWatching.js +12 -2
  43. package/build/tools/getCategories.d.ts +2 -2
  44. package/build/tools/getCategories.js +8 -2
  45. package/build/tools/getCustomFields.d.ts +2 -2
  46. package/build/tools/getCustomFields.js +22 -2
  47. package/build/tools/getDocument.d.ts +2 -2
  48. package/build/tools/getDocument.js +17 -2
  49. package/build/tools/getDocumentTree.d.ts +2 -2
  50. package/build/tools/getDocumentTree.js +7 -2
  51. package/build/tools/getDocuments.d.ts +2 -2
  52. package/build/tools/getDocuments.js +17 -2
  53. package/build/tools/getGitRepositories.d.ts +2 -2
  54. package/build/tools/getGitRepositories.js +17 -2
  55. package/build/tools/getGitRepository.d.ts +2 -2
  56. package/build/tools/getGitRepository.js +17 -2
  57. package/build/tools/getIssue.d.ts +2 -2
  58. package/build/tools/getIssue.js +32 -2
  59. package/build/tools/getIssueComments.d.ts +2 -2
  60. package/build/tools/getIssueComments.js +14 -2
  61. package/build/tools/getIssueTypes.d.ts +2 -2
  62. package/build/tools/getIssueTypes.js +11 -2
  63. package/build/tools/getIssues.d.ts +10 -10
  64. package/build/tools/getIssues.js +32 -2
  65. package/build/tools/getMyself.d.ts +2 -2
  66. package/build/tools/getMyself.js +11 -2
  67. package/build/tools/getNotifications.d.ts +2 -2
  68. package/build/tools/getNotifications.js +15 -2
  69. package/build/tools/getNotificationsCount.d.ts +2 -2
  70. package/build/tools/getNotificationsCount.js +5 -2
  71. package/build/tools/getPriorities.d.ts +2 -2
  72. package/build/tools/getPriorities.js +3 -2
  73. package/build/tools/getProject.d.ts +2 -2
  74. package/build/tools/getProject.js +22 -2
  75. package/build/tools/getProjectList.d.ts +2 -2
  76. package/build/tools/getProjectList.js +22 -2
  77. package/build/tools/getProjectUsers.d.ts +2 -2
  78. package/build/tools/getProjectUsers.js +11 -2
  79. package/build/tools/getPullRequest.d.ts +2 -2
  80. package/build/tools/getPullRequest.js +26 -2
  81. package/build/tools/getPullRequestComments.d.ts +2 -2
  82. package/build/tools/getPullRequestComments.js +12 -2
  83. package/build/tools/getPullRequests.d.ts +2 -2
  84. package/build/tools/getPullRequests.js +26 -2
  85. package/build/tools/getPullRequestsCount.d.ts +2 -2
  86. package/build/tools/getPullRequestsCount.js +5 -2
  87. package/build/tools/getRelatedIssues.d.ts +2 -2
  88. package/build/tools/getRelatedIssues.js +33 -2
  89. package/build/tools/getResolutions.d.ts +2 -2
  90. package/build/tools/getResolutions.js +3 -2
  91. package/build/tools/getSpace.d.ts +2 -2
  92. package/build/tools/getSpace.js +13 -2
  93. package/build/tools/getSpaceActivities.d.ts +2 -2
  94. package/build/tools/getSpaceActivities.js +12 -2
  95. package/build/tools/getUserRecentUpdates.d.ts +2 -2
  96. package/build/tools/getUserRecentUpdates.js +12 -2
  97. package/build/tools/getUserStarsCount.d.ts +2 -2
  98. package/build/tools/getUserStarsCount.js +3 -2
  99. package/build/tools/getUsers.d.ts +2 -2
  100. package/build/tools/getUsers.js +11 -2
  101. package/build/tools/getVersionMilestoneList.d.ts +2 -2
  102. package/build/tools/getVersionMilestoneList.js +12 -2
  103. package/build/tools/getWatchingListCount.d.ts +2 -2
  104. package/build/tools/getWatchingListCount.js +5 -2
  105. package/build/tools/getWatchingListItems.d.ts +2 -2
  106. package/build/tools/getWatchingListItems.js +12 -2
  107. package/build/tools/getWiki.d.ts +2 -2
  108. package/build/tools/getWiki.js +16 -2
  109. package/build/tools/getWikiPages.d.ts +2 -2
  110. package/build/tools/getWikiPages.js +12 -2
  111. package/build/tools/getWikisCount.d.ts +2 -2
  112. package/build/tools/getWikisCount.js +3 -2
  113. package/build/tools/markNotificationAsRead.d.ts +6 -1
  114. package/build/tools/markNotificationAsRead.js +6 -1
  115. package/build/tools/markWatchingAsRead.d.ts +6 -1
  116. package/build/tools/markWatchingAsRead.js +6 -1
  117. package/build/tools/removeRelatedIssue.d.ts +2 -2
  118. package/build/tools/removeRelatedIssue.js +33 -2
  119. package/build/tools/resetUnreadNotificationCount.d.ts +2 -2
  120. package/build/tools/resetUnreadNotificationCount.js +5 -2
  121. package/build/tools/updateIssue.d.ts +2 -2
  122. package/build/tools/updateIssue.js +32 -2
  123. package/build/tools/updateIssueComment.d.ts +2 -2
  124. package/build/tools/updateIssueComment.js +14 -2
  125. package/build/tools/updateProject.d.ts +2 -2
  126. package/build/tools/updateProject.js +22 -2
  127. package/build/tools/updatePullRequest.d.ts +2 -2
  128. package/build/tools/updatePullRequest.js +26 -2
  129. package/build/tools/updatePullRequestComment.d.ts +2 -2
  130. package/build/tools/updatePullRequestComment.js +12 -2
  131. package/build/tools/updateVersionMilestone.d.ts +2 -2
  132. package/build/tools/updateVersionMilestone.js +12 -2
  133. package/build/tools/updateWatching.d.ts +2 -2
  134. package/build/tools/updateWatching.js +12 -2
  135. package/build/tools/updateWiki.d.ts +2 -2
  136. package/build/tools/updateWiki.js +16 -2
  137. package/build/types/outputFields.d.ts +26 -0
  138. package/build/types/outputFields.js +3 -0
  139. package/build/types/tool.d.ts +21 -8
  140. package/build/types/zod/activityType.d.ts +38 -0
  141. package/build/types/zod/activityType.js +38 -0
  142. package/build/utils/fieldSelection.d.ts +22 -0
  143. package/build/utils/fieldSelection.js +40 -0
  144. package/build/utils/toolsetUtils.d.ts +1 -3
  145. package/build/utils/toolsetUtils.js +0 -12
  146. package/package.json +1 -2
  147. package/build/tools/dynamicTools/toolsets.d.ts +0 -15
  148. package/build/tools/dynamicTools/toolsets.js +0 -103
  149. package/build/types/zod/backlogOutputDefinition.d.ts +0 -3334
  150. package/build/types/zod/backlogOutputDefinition.js +0 -483
  151. package/build/utils/generateFieldsDescription.d.ts +0 -5
  152. package/build/utils/generateFieldsDescription.js +0 -50
  153. package/build/utils/toolRegistrar.d.ts +0 -5
  154. package/build/utils/toolRegistrar.js +0 -12
@@ -1,16 +1,4 @@
1
1
  import { allTools } from '../tools/tools.js';
2
- export function getToolset(group, name) {
3
- return group.toolsets.find((t) => t.name === name);
4
- }
5
- export function enableToolset(group, name) {
6
- const ts = getToolset(group, name);
7
- if (!ts)
8
- return `Toolset ${name} not found`;
9
- if (ts.enabled)
10
- return `Toolset ${name} is already enabled`;
11
- ts.enabled = true;
12
- return `Toolset ${name} enabled`;
13
- }
14
2
  export const buildToolsetGroup = (backlog, helper, enabledToolsets) => {
15
3
  const toolsetGroup = allTools(backlog, helper);
16
4
  const knownNames = toolsetGroup.toolsets.map((ts) => ts.name);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "backlog-mcp-server",
3
- "version": "0.17.0",
3
+ "version": "0.18.0",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "backlog-mcp-server": "./build/index.js"
@@ -38,7 +38,6 @@
38
38
  "@modelcontextprotocol/server": "^2.0.0",
39
39
  "backlog-js": "^0.19.1",
40
40
  "env-var": "^7.5.0",
41
- "graphql": "^17.0.2",
42
41
  "hono": "^4.12.34",
43
42
  "js-yaml": "^5.2.3",
44
43
  "pino": "^10.3.1",
@@ -1,15 +0,0 @@
1
- import { z } from 'zod';
2
- import { DynamicToolDefinition, ToolRegistrar } from '../../types/tool.js';
3
- import { DynamicToolsetGroup, ToolsetGroup } from '../../types/toolsets.js';
4
- import { DescriptionHelper } from '../../createDescriptionHelper.js';
5
- export declare const dynamicTools: (toolRegistrar: ToolRegistrar, helper: DescriptionHelper, toolsetGroup: ToolsetGroup) => DynamicToolsetGroup;
6
- declare const enableToolsetSchema: (t: DescriptionHelper["t"]) => {
7
- toolset: z.ZodString;
8
- };
9
- export declare const enableToolsetTool: (toolRegistrar: ToolRegistrar, { t }: DescriptionHelper) => DynamicToolDefinition<ReturnType<typeof enableToolsetSchema>>;
10
- export declare const listAvailableToolsets: ({ t }: DescriptionHelper, toolsetGroup: ToolsetGroup) => DynamicToolDefinition<Record<string, never>>;
11
- declare const getToolsetToolsSchema: (t: DescriptionHelper["t"]) => {
12
- toolset: z.ZodString;
13
- };
14
- export declare const getToolsetTools: ({ t }: DescriptionHelper, toolsetGroup: ToolsetGroup) => DynamicToolDefinition<ReturnType<typeof getToolsetToolsSchema>>;
15
- export {};
@@ -1,103 +0,0 @@
1
- import { z } from 'zod';
2
- import { buildToolSchema, } from '../../types/tool.js';
3
- export const dynamicTools = function (toolRegistrar, helper, toolsetGroup) {
4
- return {
5
- toolsets: [
6
- {
7
- name: 'dynamic_tools',
8
- description: 'Tools for managing Backlog space settings and general information.',
9
- enabled: true,
10
- tools: [
11
- enableToolsetTool(toolRegistrar, helper),
12
- listAvailableToolsets(helper, toolsetGroup),
13
- getToolsetTools(helper, toolsetGroup),
14
- ],
15
- },
16
- ],
17
- };
18
- };
19
- const enableToolsetSchema = buildToolSchema((t) => ({
20
- toolset: z
21
- .string()
22
- .describe(t('TOOL_ENABLE_TOOLSET_TOOLSET', 'Enable a toolset')),
23
- }));
24
- export const enableToolsetTool = (toolRegistrar, { t }) => {
25
- return {
26
- name: 'enable_toolset',
27
- description: t('TOOL_ENABLE_TOOLSET_DESCRIPTION', 'Enable one of the Backlog MCP server toolsets. Use get_toolset_tools and list_available_toolsets first to inspect what this will enable.'),
28
- schema: z.object(enableToolsetSchema(t)),
29
- handler: async ({ toolset }) => {
30
- const msg = await toolRegistrar.enableToolsetAndRefresh(toolset);
31
- return {
32
- content: [
33
- {
34
- type: 'text',
35
- text: msg,
36
- },
37
- ],
38
- };
39
- },
40
- };
41
- };
42
- export const listAvailableToolsets = ({ t }, toolsetGroup) => {
43
- return {
44
- name: 'list_available_toolsets',
45
- description: t('TOOL_LIST_AVAILABLE_TOOLSETS_DESCRIPTION', 'List all available toolsets.'),
46
- schema: z.object({}),
47
- handler: async () => {
48
- const result = toolsetGroup.toolsets.map((ts) => ({
49
- name: ts.name,
50
- description: ts.description,
51
- currentlyEnabled: ts.enabled,
52
- canEnable: true,
53
- }));
54
- return {
55
- content: [
56
- {
57
- type: 'text',
58
- text: JSON.stringify(result, null, 2),
59
- },
60
- ],
61
- };
62
- },
63
- };
64
- };
65
- const getToolsetToolsSchema = buildToolSchema((t) => ({
66
- toolset: z
67
- .string()
68
- .describe(t('TOOL_GET_TOOLSET_TOOLS_TOOLSET', 'Toolset name to inspect')),
69
- }));
70
- export const getToolsetTools = ({ t }, toolsetGroup) => {
71
- return {
72
- name: 'get_toolset_tools',
73
- description: t('TOOL_GET_TOOLSET_TOOLS_DESCRIPTION', 'List all tools in a specific toolset.'),
74
- schema: z.object(getToolsetToolsSchema(t)),
75
- handler: async ({ toolset }) => {
76
- const found = toolsetGroup.toolsets.find((ts) => ts.name === toolset);
77
- if (!found) {
78
- return {
79
- content: [
80
- {
81
- type: 'text',
82
- text: `Toolset '${toolset}' not found.`,
83
- },
84
- ],
85
- };
86
- }
87
- const tools = found.tools.map((tool) => ({
88
- name: tool.name,
89
- description: tool.description,
90
- toolset: found.name,
91
- canEnable: true,
92
- }));
93
- return {
94
- content: [
95
- {
96
- type: 'text',
97
- text: JSON.stringify(tools, null, 2),
98
- },
99
- ],
100
- };
101
- },
102
- };
103
- };