@lvmk/jira-mcp 1.0.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/LICENSE +21 -0
- package/README.md +583 -0
- package/dist/client.d.ts +287 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +235 -0
- package/dist/client.js.map +1 -0
- package/dist/config.d.ts +54 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +66 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +222 -0
- package/dist/index.js.map +1 -0
- package/dist/setup.d.ts +41 -0
- package/dist/setup.d.ts.map +1 -0
- package/dist/setup.js +275 -0
- package/dist/setup.js.map +1 -0
- package/dist/tools/index.d.ts +10 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +10 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/issues.d.ts +363 -0
- package/dist/tools/issues.d.ts.map +1 -0
- package/dist/tools/issues.js +365 -0
- package/dist/tools/issues.js.map +1 -0
- package/dist/tools/projects.d.ts +69 -0
- package/dist/tools/projects.d.ts.map +1 -0
- package/dist/tools/projects.js +93 -0
- package/dist/tools/projects.js.map +1 -0
- package/dist/tools/search.d.ts +76 -0
- package/dist/tools/search.d.ts.map +1 -0
- package/dist/tools/search.js +98 -0
- package/dist/tools/search.js.map +1 -0
- package/dist/tools/transitions.d.ts +98 -0
- package/dist/tools/transitions.d.ts.map +1 -0
- package/dist/tools/transitions.js +109 -0
- package/dist/tools/transitions.js.map +1 -0
- package/dist/tools/users.d.ts +69 -0
- package/dist/tools/users.d.ts.map +1 -0
- package/dist/tools/users.js +89 -0
- package/dist/tools/users.js.map +1 -0
- package/package.json +57 -0
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file tools/issues.ts
|
|
3
|
+
* @description Issue-related MCP tools for Jira.
|
|
4
|
+
* Provides tools for creating, reading, updating, and deleting issues.
|
|
5
|
+
*/
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
/**
|
|
8
|
+
* Schema for get_issue tool input.
|
|
9
|
+
*/
|
|
10
|
+
export const getIssueSchema = z.object({
|
|
11
|
+
issueKey: z.string().describe('The issue key (e.g., "PROJ-123") or ID'),
|
|
12
|
+
fields: z
|
|
13
|
+
.string()
|
|
14
|
+
.optional()
|
|
15
|
+
.describe('Comma-separated list of fields to return'),
|
|
16
|
+
});
|
|
17
|
+
/**
|
|
18
|
+
* Schema for create_issue tool input.
|
|
19
|
+
*/
|
|
20
|
+
export const createIssueSchema = z.object({
|
|
21
|
+
projectKey: z.string().describe('The project key (e.g., "PROJ")'),
|
|
22
|
+
summary: z.string().describe('Issue summary/title'),
|
|
23
|
+
issueType: z
|
|
24
|
+
.string()
|
|
25
|
+
.default('Task')
|
|
26
|
+
.describe('Issue type name (e.g., "Bug", "Task", "Story")'),
|
|
27
|
+
description: z.string().optional().describe('Issue description'),
|
|
28
|
+
assignee: z.string().optional().describe('Assignee username'),
|
|
29
|
+
priority: z.string().optional().describe('Priority name (e.g., "High", "Medium")'),
|
|
30
|
+
labels: z.array(z.string()).optional().describe('Array of labels'),
|
|
31
|
+
});
|
|
32
|
+
/**
|
|
33
|
+
* Schema for update_issue tool input.
|
|
34
|
+
*/
|
|
35
|
+
export const updateIssueSchema = z.object({
|
|
36
|
+
issueKey: z.string().describe('The issue key or ID to update'),
|
|
37
|
+
summary: z.string().optional().describe('New summary'),
|
|
38
|
+
description: z.string().optional().describe('New description'),
|
|
39
|
+
assignee: z
|
|
40
|
+
.string()
|
|
41
|
+
.optional()
|
|
42
|
+
.nullable()
|
|
43
|
+
.describe('New assignee username (null to unassign)'),
|
|
44
|
+
priority: z.string().optional().describe('New priority name'),
|
|
45
|
+
labels: z.array(z.string()).optional().describe('New labels array'),
|
|
46
|
+
});
|
|
47
|
+
/**
|
|
48
|
+
* Schema for delete_issue tool input.
|
|
49
|
+
*/
|
|
50
|
+
export const deleteIssueSchema = z.object({
|
|
51
|
+
issueKey: z.string().describe('The issue key or ID to delete'),
|
|
52
|
+
deleteSubtasks: z
|
|
53
|
+
.boolean()
|
|
54
|
+
.default(false)
|
|
55
|
+
.describe('Whether to also delete subtasks'),
|
|
56
|
+
});
|
|
57
|
+
/**
|
|
58
|
+
* Schema for add_comment tool input.
|
|
59
|
+
*/
|
|
60
|
+
export const addCommentSchema = z.object({
|
|
61
|
+
issueKey: z.string().describe('The issue key or ID'),
|
|
62
|
+
body: z.string().describe('Comment body text'),
|
|
63
|
+
});
|
|
64
|
+
/**
|
|
65
|
+
* Schema for get_comments tool input.
|
|
66
|
+
*/
|
|
67
|
+
export const getCommentsSchema = z.object({
|
|
68
|
+
issueKey: z.string().describe('The issue key or ID'),
|
|
69
|
+
});
|
|
70
|
+
/**
|
|
71
|
+
* Creates issue tool handlers.
|
|
72
|
+
* @param client - Jira client instance
|
|
73
|
+
* @returns Object containing all issue tool handlers
|
|
74
|
+
*/
|
|
75
|
+
export function createIssueTools(client) {
|
|
76
|
+
return {
|
|
77
|
+
/**
|
|
78
|
+
* Gets an issue by key or ID.
|
|
79
|
+
*/
|
|
80
|
+
jira_get_issue: async (args) => {
|
|
81
|
+
const issue = await client.getIssue(args.issueKey, args.fields);
|
|
82
|
+
return {
|
|
83
|
+
content: [
|
|
84
|
+
{
|
|
85
|
+
type: 'text',
|
|
86
|
+
text: JSON.stringify({
|
|
87
|
+
key: issue.key,
|
|
88
|
+
id: issue.id,
|
|
89
|
+
summary: issue.fields.summary,
|
|
90
|
+
description: issue.fields.description,
|
|
91
|
+
status: issue.fields.status.name,
|
|
92
|
+
priority: issue.fields.priority?.name,
|
|
93
|
+
assignee: issue.fields.assignee?.displayName,
|
|
94
|
+
reporter: issue.fields.reporter?.displayName,
|
|
95
|
+
issueType: issue.fields.issuetype.name,
|
|
96
|
+
project: issue.fields.project.key,
|
|
97
|
+
labels: issue.fields.labels,
|
|
98
|
+
created: issue.fields.created,
|
|
99
|
+
updated: issue.fields.updated,
|
|
100
|
+
}, null, 2),
|
|
101
|
+
},
|
|
102
|
+
],
|
|
103
|
+
};
|
|
104
|
+
},
|
|
105
|
+
/**
|
|
106
|
+
* Creates a new issue.
|
|
107
|
+
*/
|
|
108
|
+
jira_create_issue: async (args) => {
|
|
109
|
+
const result = await client.createIssue({
|
|
110
|
+
project: { key: args.projectKey },
|
|
111
|
+
summary: args.summary,
|
|
112
|
+
issuetype: { name: args.issueType },
|
|
113
|
+
description: args.description,
|
|
114
|
+
assignee: args.assignee ? { name: args.assignee } : undefined,
|
|
115
|
+
priority: args.priority ? { name: args.priority } : undefined,
|
|
116
|
+
labels: args.labels,
|
|
117
|
+
});
|
|
118
|
+
return {
|
|
119
|
+
content: [
|
|
120
|
+
{
|
|
121
|
+
type: 'text',
|
|
122
|
+
text: JSON.stringify({
|
|
123
|
+
success: true,
|
|
124
|
+
key: result.key,
|
|
125
|
+
id: result.id,
|
|
126
|
+
self: result.self,
|
|
127
|
+
}, null, 2),
|
|
128
|
+
},
|
|
129
|
+
],
|
|
130
|
+
};
|
|
131
|
+
},
|
|
132
|
+
/**
|
|
133
|
+
* Updates an existing issue.
|
|
134
|
+
*/
|
|
135
|
+
jira_update_issue: async (args) => {
|
|
136
|
+
await client.updateIssue(args.issueKey, {
|
|
137
|
+
summary: args.summary,
|
|
138
|
+
description: args.description,
|
|
139
|
+
assignee: args.assignee === null ? null : args.assignee ? { name: args.assignee } : undefined,
|
|
140
|
+
priority: args.priority ? { name: args.priority } : undefined,
|
|
141
|
+
labels: args.labels,
|
|
142
|
+
});
|
|
143
|
+
return {
|
|
144
|
+
content: [
|
|
145
|
+
{
|
|
146
|
+
type: 'text',
|
|
147
|
+
text: JSON.stringify({
|
|
148
|
+
success: true,
|
|
149
|
+
message: `Issue ${args.issueKey} updated successfully`,
|
|
150
|
+
}, null, 2),
|
|
151
|
+
},
|
|
152
|
+
],
|
|
153
|
+
};
|
|
154
|
+
},
|
|
155
|
+
/**
|
|
156
|
+
* Deletes an issue.
|
|
157
|
+
*/
|
|
158
|
+
jira_delete_issue: async (args) => {
|
|
159
|
+
await client.deleteIssue(args.issueKey, args.deleteSubtasks);
|
|
160
|
+
return {
|
|
161
|
+
content: [
|
|
162
|
+
{
|
|
163
|
+
type: 'text',
|
|
164
|
+
text: JSON.stringify({
|
|
165
|
+
success: true,
|
|
166
|
+
message: `Issue ${args.issueKey} deleted successfully`,
|
|
167
|
+
}, null, 2),
|
|
168
|
+
},
|
|
169
|
+
],
|
|
170
|
+
};
|
|
171
|
+
},
|
|
172
|
+
/**
|
|
173
|
+
* Adds a comment to an issue.
|
|
174
|
+
*/
|
|
175
|
+
jira_add_comment: async (args) => {
|
|
176
|
+
const comment = await client.addComment(args.issueKey, args.body);
|
|
177
|
+
return {
|
|
178
|
+
content: [
|
|
179
|
+
{
|
|
180
|
+
type: 'text',
|
|
181
|
+
text: JSON.stringify({
|
|
182
|
+
success: true,
|
|
183
|
+
commentId: comment.id,
|
|
184
|
+
author: comment.author.displayName,
|
|
185
|
+
created: comment.created,
|
|
186
|
+
}, null, 2),
|
|
187
|
+
},
|
|
188
|
+
],
|
|
189
|
+
};
|
|
190
|
+
},
|
|
191
|
+
/**
|
|
192
|
+
* Gets comments on an issue.
|
|
193
|
+
*/
|
|
194
|
+
jira_get_comments: async (args) => {
|
|
195
|
+
const result = await client.getComments(args.issueKey);
|
|
196
|
+
return {
|
|
197
|
+
content: [
|
|
198
|
+
{
|
|
199
|
+
type: 'text',
|
|
200
|
+
text: JSON.stringify({
|
|
201
|
+
total: result.total,
|
|
202
|
+
comments: result.comments.map((c) => ({
|
|
203
|
+
id: c.id,
|
|
204
|
+
author: c.author.displayName,
|
|
205
|
+
body: c.body,
|
|
206
|
+
created: c.created,
|
|
207
|
+
updated: c.updated,
|
|
208
|
+
})),
|
|
209
|
+
}, null, 2),
|
|
210
|
+
},
|
|
211
|
+
],
|
|
212
|
+
};
|
|
213
|
+
},
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Tool definitions for issue-related operations.
|
|
218
|
+
*/
|
|
219
|
+
export const issueToolDefinitions = [
|
|
220
|
+
{
|
|
221
|
+
name: 'jira_get_issue',
|
|
222
|
+
description: 'Get details of a Jira issue by its key or ID',
|
|
223
|
+
inputSchema: {
|
|
224
|
+
type: 'object',
|
|
225
|
+
properties: {
|
|
226
|
+
issueKey: {
|
|
227
|
+
type: 'string',
|
|
228
|
+
description: 'The issue key (e.g., "PROJ-123") or ID',
|
|
229
|
+
},
|
|
230
|
+
fields: {
|
|
231
|
+
type: 'string',
|
|
232
|
+
description: 'Comma-separated list of fields to return',
|
|
233
|
+
},
|
|
234
|
+
},
|
|
235
|
+
required: ['issueKey'],
|
|
236
|
+
},
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
name: 'jira_create_issue',
|
|
240
|
+
description: 'Create a new Jira issue',
|
|
241
|
+
inputSchema: {
|
|
242
|
+
type: 'object',
|
|
243
|
+
properties: {
|
|
244
|
+
projectKey: {
|
|
245
|
+
type: 'string',
|
|
246
|
+
description: 'The project key (e.g., "PROJ")',
|
|
247
|
+
},
|
|
248
|
+
summary: {
|
|
249
|
+
type: 'string',
|
|
250
|
+
description: 'Issue summary/title',
|
|
251
|
+
},
|
|
252
|
+
issueType: {
|
|
253
|
+
type: 'string',
|
|
254
|
+
description: 'Issue type name (e.g., "Bug", "Task", "Story")',
|
|
255
|
+
default: 'Task',
|
|
256
|
+
},
|
|
257
|
+
description: {
|
|
258
|
+
type: 'string',
|
|
259
|
+
description: 'Issue description',
|
|
260
|
+
},
|
|
261
|
+
assignee: {
|
|
262
|
+
type: 'string',
|
|
263
|
+
description: 'Assignee username',
|
|
264
|
+
},
|
|
265
|
+
priority: {
|
|
266
|
+
type: 'string',
|
|
267
|
+
description: 'Priority name (e.g., "High", "Medium")',
|
|
268
|
+
},
|
|
269
|
+
labels: {
|
|
270
|
+
type: 'array',
|
|
271
|
+
items: { type: 'string' },
|
|
272
|
+
description: 'Array of labels',
|
|
273
|
+
},
|
|
274
|
+
},
|
|
275
|
+
required: ['projectKey', 'summary'],
|
|
276
|
+
},
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
name: 'jira_update_issue',
|
|
280
|
+
description: 'Update an existing Jira issue',
|
|
281
|
+
inputSchema: {
|
|
282
|
+
type: 'object',
|
|
283
|
+
properties: {
|
|
284
|
+
issueKey: {
|
|
285
|
+
type: 'string',
|
|
286
|
+
description: 'The issue key or ID to update',
|
|
287
|
+
},
|
|
288
|
+
summary: {
|
|
289
|
+
type: 'string',
|
|
290
|
+
description: 'New summary',
|
|
291
|
+
},
|
|
292
|
+
description: {
|
|
293
|
+
type: 'string',
|
|
294
|
+
description: 'New description',
|
|
295
|
+
},
|
|
296
|
+
assignee: {
|
|
297
|
+
type: ['string', 'null'],
|
|
298
|
+
description: 'New assignee username (null to unassign)',
|
|
299
|
+
},
|
|
300
|
+
priority: {
|
|
301
|
+
type: 'string',
|
|
302
|
+
description: 'New priority name',
|
|
303
|
+
},
|
|
304
|
+
labels: {
|
|
305
|
+
type: 'array',
|
|
306
|
+
items: { type: 'string' },
|
|
307
|
+
description: 'New labels array',
|
|
308
|
+
},
|
|
309
|
+
},
|
|
310
|
+
required: ['issueKey'],
|
|
311
|
+
},
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
name: 'jira_delete_issue',
|
|
315
|
+
description: 'Delete a Jira issue',
|
|
316
|
+
inputSchema: {
|
|
317
|
+
type: 'object',
|
|
318
|
+
properties: {
|
|
319
|
+
issueKey: {
|
|
320
|
+
type: 'string',
|
|
321
|
+
description: 'The issue key or ID to delete',
|
|
322
|
+
},
|
|
323
|
+
deleteSubtasks: {
|
|
324
|
+
type: 'boolean',
|
|
325
|
+
description: 'Whether to also delete subtasks',
|
|
326
|
+
default: false,
|
|
327
|
+
},
|
|
328
|
+
},
|
|
329
|
+
required: ['issueKey'],
|
|
330
|
+
},
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
name: 'jira_add_comment',
|
|
334
|
+
description: 'Add a comment to a Jira issue',
|
|
335
|
+
inputSchema: {
|
|
336
|
+
type: 'object',
|
|
337
|
+
properties: {
|
|
338
|
+
issueKey: {
|
|
339
|
+
type: 'string',
|
|
340
|
+
description: 'The issue key or ID',
|
|
341
|
+
},
|
|
342
|
+
body: {
|
|
343
|
+
type: 'string',
|
|
344
|
+
description: 'Comment body text',
|
|
345
|
+
},
|
|
346
|
+
},
|
|
347
|
+
required: ['issueKey', 'body'],
|
|
348
|
+
},
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
name: 'jira_get_comments',
|
|
352
|
+
description: 'Get all comments on a Jira issue',
|
|
353
|
+
inputSchema: {
|
|
354
|
+
type: 'object',
|
|
355
|
+
properties: {
|
|
356
|
+
issueKey: {
|
|
357
|
+
type: 'string',
|
|
358
|
+
description: 'The issue key or ID',
|
|
359
|
+
},
|
|
360
|
+
},
|
|
361
|
+
required: ['issueKey'],
|
|
362
|
+
},
|
|
363
|
+
},
|
|
364
|
+
];
|
|
365
|
+
//# sourceMappingURL=issues.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"issues.js","sourceRoot":"","sources":["../../src/tools/issues.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,wCAAwC,CAAC;IACvE,MAAM,EAAE,CAAC;SACJ,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,0CAA0C,CAAC;CAC5D,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,UAAU,EAAE,CAAC,CAAC,MAAM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;oBACZ,IAAI,EAAE,SAAS;oBACf,WAAW,EAAE,iCAAiC;oBAC9C,OAAO,EAAE,KAAK;iBACjB;aACJ;YACD,QAAQ,EAAE,CAAC,UAAU,CAAC;SACzB;KACJ;IACD;QACI,IAAI,EAAE,kBAAkB;QACxB,WAAW,EAAE,+BAA+B;QAC5C,WAAW,EAAE;YACT,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACR,QAAQ,EAAE;oBACN,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,qBAAqB;iBACrC;gBACD,IAAI,EAAE;oBACF,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,mBAAmB;iBACnC;aACJ;YACD,QAAQ,EAAE,CAAC,UAAU,EAAE,MAAM,CAAC;SACjC;KACJ;IACD;QACI,IAAI,EAAE,mBAAmB;QACzB,WAAW,EAAE,kCAAkC;QAC/C,WAAW,EAAE;YACT,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACR,QAAQ,EAAE;oBACN,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,qBAAqB;iBACrC;aACJ;YACD,QAAQ,EAAE,CAAC,UAAU,CAAC;SACzB;KACJ;CACJ,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file tools/projects.ts
|
|
3
|
+
* @description Project-related MCP tools for Jira.
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import { JiraClient } from '../client.js';
|
|
7
|
+
/**
|
|
8
|
+
* Schema for get_project tool input.
|
|
9
|
+
*/
|
|
10
|
+
export declare const getProjectSchema: z.ZodObject<{
|
|
11
|
+
projectKey: z.ZodString;
|
|
12
|
+
}, "strip", z.ZodTypeAny, {
|
|
13
|
+
projectKey: string;
|
|
14
|
+
}, {
|
|
15
|
+
projectKey: string;
|
|
16
|
+
}>;
|
|
17
|
+
/**
|
|
18
|
+
* Creates project tool handlers.
|
|
19
|
+
* @param client - Jira client instance
|
|
20
|
+
* @returns Object containing project tool handlers
|
|
21
|
+
*/
|
|
22
|
+
export declare function createProjectTools(client: JiraClient): {
|
|
23
|
+
/**
|
|
24
|
+
* Lists all accessible projects.
|
|
25
|
+
*/
|
|
26
|
+
jira_list_projects: () => Promise<{
|
|
27
|
+
content: {
|
|
28
|
+
type: "text";
|
|
29
|
+
text: string;
|
|
30
|
+
}[];
|
|
31
|
+
}>;
|
|
32
|
+
/**
|
|
33
|
+
* Gets a project by key or ID.
|
|
34
|
+
*/
|
|
35
|
+
jira_get_project: (args: z.infer<typeof getProjectSchema>) => Promise<{
|
|
36
|
+
content: {
|
|
37
|
+
type: "text";
|
|
38
|
+
text: string;
|
|
39
|
+
}[];
|
|
40
|
+
}>;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Tool definitions for project operations.
|
|
44
|
+
*/
|
|
45
|
+
export declare const projectToolDefinitions: ({
|
|
46
|
+
name: string;
|
|
47
|
+
description: string;
|
|
48
|
+
inputSchema: {
|
|
49
|
+
type: "object";
|
|
50
|
+
properties: {
|
|
51
|
+
projectKey?: undefined;
|
|
52
|
+
};
|
|
53
|
+
required: never[];
|
|
54
|
+
};
|
|
55
|
+
} | {
|
|
56
|
+
name: string;
|
|
57
|
+
description: string;
|
|
58
|
+
inputSchema: {
|
|
59
|
+
type: "object";
|
|
60
|
+
properties: {
|
|
61
|
+
projectKey: {
|
|
62
|
+
type: string;
|
|
63
|
+
description: string;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
required: string[];
|
|
67
|
+
};
|
|
68
|
+
})[];
|
|
69
|
+
//# sourceMappingURL=projects.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../../src/tools/projects.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;EAE3B,CAAC;AAEH;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,UAAU;IAE7C;;OAEG;;;;;;;IA0BH;;OAEG;6BAC4B,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC;;;;;;EAuBtE;AAED;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;IAwBlC,CAAC"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file tools/projects.ts
|
|
3
|
+
* @description Project-related MCP tools for Jira.
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
/**
|
|
7
|
+
* Schema for get_project tool input.
|
|
8
|
+
*/
|
|
9
|
+
export const getProjectSchema = z.object({
|
|
10
|
+
projectKey: z.string().describe('The project key (e.g., "PROJ") or ID'),
|
|
11
|
+
});
|
|
12
|
+
/**
|
|
13
|
+
* Creates project tool handlers.
|
|
14
|
+
* @param client - Jira client instance
|
|
15
|
+
* @returns Object containing project tool handlers
|
|
16
|
+
*/
|
|
17
|
+
export function createProjectTools(client) {
|
|
18
|
+
return {
|
|
19
|
+
/**
|
|
20
|
+
* Lists all accessible projects.
|
|
21
|
+
*/
|
|
22
|
+
jira_list_projects: async () => {
|
|
23
|
+
const projects = await client.getProjects();
|
|
24
|
+
return {
|
|
25
|
+
content: [
|
|
26
|
+
{
|
|
27
|
+
type: 'text',
|
|
28
|
+
text: JSON.stringify({
|
|
29
|
+
total: projects.length,
|
|
30
|
+
projects: projects.map((p) => ({
|
|
31
|
+
key: p.key,
|
|
32
|
+
name: p.name,
|
|
33
|
+
id: p.id,
|
|
34
|
+
projectType: p.projectTypeKey,
|
|
35
|
+
lead: p.lead?.displayName,
|
|
36
|
+
})),
|
|
37
|
+
}, null, 2),
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
};
|
|
41
|
+
},
|
|
42
|
+
/**
|
|
43
|
+
* Gets a project by key or ID.
|
|
44
|
+
*/
|
|
45
|
+
jira_get_project: async (args) => {
|
|
46
|
+
const project = await client.getProject(args.projectKey);
|
|
47
|
+
return {
|
|
48
|
+
content: [
|
|
49
|
+
{
|
|
50
|
+
type: 'text',
|
|
51
|
+
text: JSON.stringify({
|
|
52
|
+
key: project.key,
|
|
53
|
+
name: project.name,
|
|
54
|
+
id: project.id,
|
|
55
|
+
description: project.description,
|
|
56
|
+
projectType: project.projectTypeKey,
|
|
57
|
+
lead: project.lead?.displayName,
|
|
58
|
+
}, null, 2),
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
|
+
};
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Tool definitions for project operations.
|
|
67
|
+
*/
|
|
68
|
+
export const projectToolDefinitions = [
|
|
69
|
+
{
|
|
70
|
+
name: 'jira_list_projects',
|
|
71
|
+
description: 'List all Jira projects accessible to the authenticated user',
|
|
72
|
+
inputSchema: {
|
|
73
|
+
type: 'object',
|
|
74
|
+
properties: {},
|
|
75
|
+
required: [],
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: 'jira_get_project',
|
|
80
|
+
description: 'Get details of a specific Jira project',
|
|
81
|
+
inputSchema: {
|
|
82
|
+
type: 'object',
|
|
83
|
+
properties: {
|
|
84
|
+
projectKey: {
|
|
85
|
+
type: 'string',
|
|
86
|
+
description: 'The project key (e.g., "PROJ") or ID',
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
required: ['projectKey'],
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
];
|
|
93
|
+
//# sourceMappingURL=projects.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projects.js","sourceRoot":"","sources":["../../src/tools/projects.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KA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AE;4BACd,WAAW,EAAE,OAAO,CAAC,WAAW;4BAChC,WAAW,EAAE,OAAO,CAAC,cAAc;4BACnC,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,WAAW;yBAClC,EACD,IAAI,EACJ,CAAC,CACJ;qBACJ;iBACJ;aACJ,CAAC;QACN,CAAC;KACJ,CAAC;AACN,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;IAClC;QACI,IAAI,EAAE,oBAAoB;QAC1B,WAAW,EAAE,6DAA6D;QAC1E,WAAW,EAAE;YACT,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE,EAAE;YACd,QAAQ,EAAE,EAAE;SACf;KACJ;IACD;QACI,IAAI,EAAE,kBAAkB;QACxB,WAAW,EAAE,wCAAwC;QACrD,WAAW,EAAE;YACT,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACR,UAAU,EAAE;oBACR,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,sCAAsC;iBACtD;aACJ;YACD,QAAQ,EAAE,CAAC,YAAY,CAAC;SAC3B;KACJ;CACJ,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file tools/search.ts
|
|
3
|
+
* @description JQL search tool for Jira MCP.
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import { JiraClient } from '../client.js';
|
|
7
|
+
/**
|
|
8
|
+
* Schema for search tool input.
|
|
9
|
+
*/
|
|
10
|
+
export declare const searchSchema: z.ZodObject<{
|
|
11
|
+
jql: z.ZodString;
|
|
12
|
+
maxResults: z.ZodDefault<z.ZodNumber>;
|
|
13
|
+
startAt: z.ZodDefault<z.ZodNumber>;
|
|
14
|
+
fields: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
15
|
+
}, "strip", z.ZodTypeAny, {
|
|
16
|
+
jql: string;
|
|
17
|
+
maxResults: number;
|
|
18
|
+
startAt: number;
|
|
19
|
+
fields?: string[] | undefined;
|
|
20
|
+
}, {
|
|
21
|
+
jql: string;
|
|
22
|
+
fields?: string[] | undefined;
|
|
23
|
+
maxResults?: number | undefined;
|
|
24
|
+
startAt?: number | undefined;
|
|
25
|
+
}>;
|
|
26
|
+
/**
|
|
27
|
+
* Creates search tool handlers.
|
|
28
|
+
* @param client - Jira client instance
|
|
29
|
+
* @returns Object containing search tool handler
|
|
30
|
+
*/
|
|
31
|
+
export declare function createSearchTools(client: JiraClient): {
|
|
32
|
+
/**
|
|
33
|
+
* Searches for issues using JQL.
|
|
34
|
+
*/
|
|
35
|
+
jira_search: (args: z.infer<typeof searchSchema>) => Promise<{
|
|
36
|
+
content: {
|
|
37
|
+
type: "text";
|
|
38
|
+
text: string;
|
|
39
|
+
}[];
|
|
40
|
+
}>;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Tool definitions for search operations.
|
|
44
|
+
*/
|
|
45
|
+
export declare const searchToolDefinitions: {
|
|
46
|
+
name: string;
|
|
47
|
+
description: string;
|
|
48
|
+
inputSchema: {
|
|
49
|
+
type: "object";
|
|
50
|
+
properties: {
|
|
51
|
+
jql: {
|
|
52
|
+
type: string;
|
|
53
|
+
description: string;
|
|
54
|
+
};
|
|
55
|
+
maxResults: {
|
|
56
|
+
type: string;
|
|
57
|
+
description: string;
|
|
58
|
+
default: number;
|
|
59
|
+
};
|
|
60
|
+
startAt: {
|
|
61
|
+
type: string;
|
|
62
|
+
description: string;
|
|
63
|
+
default: number;
|
|
64
|
+
};
|
|
65
|
+
fields: {
|
|
66
|
+
type: string;
|
|
67
|
+
items: {
|
|
68
|
+
type: string;
|
|
69
|
+
};
|
|
70
|
+
description: string;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
required: string[];
|
|
74
|
+
};
|
|
75
|
+
}[];
|
|
76
|
+
//# sourceMappingURL=search.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/tools/search.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;EAmBvB,CAAC;AAEH;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,UAAU;IAE5C;;OAEG;wBACuB,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC;;;;;;EAiC7D;AAED;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BjC,CAAC"}
|