@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.
Files changed (43) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +583 -0
  3. package/dist/client.d.ts +287 -0
  4. package/dist/client.d.ts.map +1 -0
  5. package/dist/client.js +235 -0
  6. package/dist/client.js.map +1 -0
  7. package/dist/config.d.ts +54 -0
  8. package/dist/config.d.ts.map +1 -0
  9. package/dist/config.js +66 -0
  10. package/dist/config.js.map +1 -0
  11. package/dist/index.d.ts +10 -0
  12. package/dist/index.d.ts.map +1 -0
  13. package/dist/index.js +222 -0
  14. package/dist/index.js.map +1 -0
  15. package/dist/setup.d.ts +41 -0
  16. package/dist/setup.d.ts.map +1 -0
  17. package/dist/setup.js +275 -0
  18. package/dist/setup.js.map +1 -0
  19. package/dist/tools/index.d.ts +10 -0
  20. package/dist/tools/index.d.ts.map +1 -0
  21. package/dist/tools/index.js +10 -0
  22. package/dist/tools/index.js.map +1 -0
  23. package/dist/tools/issues.d.ts +363 -0
  24. package/dist/tools/issues.d.ts.map +1 -0
  25. package/dist/tools/issues.js +365 -0
  26. package/dist/tools/issues.js.map +1 -0
  27. package/dist/tools/projects.d.ts +69 -0
  28. package/dist/tools/projects.d.ts.map +1 -0
  29. package/dist/tools/projects.js +93 -0
  30. package/dist/tools/projects.js.map +1 -0
  31. package/dist/tools/search.d.ts +76 -0
  32. package/dist/tools/search.d.ts.map +1 -0
  33. package/dist/tools/search.js +98 -0
  34. package/dist/tools/search.js.map +1 -0
  35. package/dist/tools/transitions.d.ts +98 -0
  36. package/dist/tools/transitions.d.ts.map +1 -0
  37. package/dist/tools/transitions.js +109 -0
  38. package/dist/tools/transitions.js.map +1 -0
  39. package/dist/tools/users.d.ts +69 -0
  40. package/dist/tools/users.d.ts.map +1 -0
  41. package/dist/tools/users.js +89 -0
  42. package/dist/tools/users.js.map +1 -0
  43. package/package.json +57 -0
@@ -0,0 +1,98 @@
1
+ /**
2
+ * @file tools/search.ts
3
+ * @description JQL search tool for Jira MCP.
4
+ */
5
+ import { z } from 'zod';
6
+ /**
7
+ * Schema for search tool input.
8
+ */
9
+ export const searchSchema = z.object({
10
+ jql: z.string().describe('JQL query string (e.g., "project = PROJ AND status = Open")'),
11
+ maxResults: z
12
+ .number()
13
+ .int()
14
+ .min(1)
15
+ .max(100)
16
+ .default(50)
17
+ .describe('Maximum number of results to return (1-100)'),
18
+ startAt: z
19
+ .number()
20
+ .int()
21
+ .min(0)
22
+ .default(0)
23
+ .describe('Starting index for pagination'),
24
+ fields: z
25
+ .array(z.string())
26
+ .optional()
27
+ .describe('Fields to include in results'),
28
+ });
29
+ /**
30
+ * Creates search tool handlers.
31
+ * @param client - Jira client instance
32
+ * @returns Object containing search tool handler
33
+ */
34
+ export function createSearchTools(client) {
35
+ return {
36
+ /**
37
+ * Searches for issues using JQL.
38
+ */
39
+ jira_search: async (args) => {
40
+ const result = await client.search(args.jql, args.maxResults, args.startAt, args.fields);
41
+ return {
42
+ content: [
43
+ {
44
+ type: 'text',
45
+ text: JSON.stringify({
46
+ total: result.total,
47
+ startAt: result.startAt,
48
+ maxResults: result.maxResults,
49
+ issues: result.issues.map((issue) => ({
50
+ key: issue.key,
51
+ summary: issue.fields.summary,
52
+ status: issue.fields.status.name,
53
+ assignee: issue.fields.assignee?.displayName,
54
+ priority: issue.fields.priority?.name,
55
+ issueType: issue.fields.issuetype.name,
56
+ })),
57
+ }, null, 2),
58
+ },
59
+ ],
60
+ };
61
+ },
62
+ };
63
+ }
64
+ /**
65
+ * Tool definitions for search operations.
66
+ */
67
+ export const searchToolDefinitions = [
68
+ {
69
+ name: 'jira_search',
70
+ description: 'Search for Jira issues using JQL (Jira Query Language). Examples: "project = PROJ", "assignee = currentUser()", "status = Open"',
71
+ inputSchema: {
72
+ type: 'object',
73
+ properties: {
74
+ jql: {
75
+ type: 'string',
76
+ description: 'JQL query string',
77
+ },
78
+ maxResults: {
79
+ type: 'number',
80
+ description: 'Maximum number of results to return (1-100)',
81
+ default: 50,
82
+ },
83
+ startAt: {
84
+ type: 'number',
85
+ description: 'Starting index for pagination',
86
+ default: 0,
87
+ },
88
+ fields: {
89
+ type: 'array',
90
+ items: { type: 'string' },
91
+ description: 'Fields to include in results',
92
+ },
93
+ },
94
+ required: ['jql'],
95
+ },
96
+ },
97
+ ];
98
+ //# sourceMappingURL=search.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/tools/search.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IACjC,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,6DAA6D,CAAC;IACvF,UAAU,EAAE,CAAC;SACR,MAAM,EAAE;SACR,GAAG,EAAE;SACL,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,GAAG,CAAC;SACR,OAAO,CAAC,EAAE,CAAC;SACX,QAAQ,CAAC,6CAA6C,CAAC;IAC5D,OAAO,EAAE,CAAC;SACL,MAAM,EAAE;SACR,GAAG,EAAE;SACL,GAAG,CAAC,CAAC,CAAC;SACN,OAAO,CAAC,CAAC,CAAC;SACV,QAAQ,CAAC,+BAA+B,CAAC;IAC9C,MAAM,EAAE,CAAC;SACJ,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;SACjB,QAAQ,EAAE;SACV,QAAQ,CAAC,8BAA8B,CAAC;CAChD,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAkB;IAChD,OAAO;QACH;;WAEG;QACH,WAAW,EAAE,KAAK,EAAE,IAAkC,EAAE,EAAE;YACtD,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,MAAM,CAC9B,IAAI,CAAC,GAAG,EACR,I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AAE,+BAA+B;oBAC5C,OAAO,EAAE,CAAC;iBACb;gBACD,MAAM,EAAE;oBACJ,IAAI,EAAE,OAAO;oBACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;oBACzB,WAAW,EAAE,8BAA8B;iBAC9C;aACJ;YACD,QAAQ,EAAE,CAAC,KAAK,CAAC;SACpB;KACJ;CACJ,CAAC"}
@@ -0,0 +1,98 @@
1
+ /**
2
+ * @file tools/transitions.ts
3
+ * @description Workflow transition tools for Jira MCP.
4
+ */
5
+ import { z } from 'zod';
6
+ import { JiraClient } from '../client.js';
7
+ /**
8
+ * Schema for get_transitions tool input.
9
+ */
10
+ export declare const getTransitionsSchema: z.ZodObject<{
11
+ issueKey: z.ZodString;
12
+ }, "strip", z.ZodTypeAny, {
13
+ issueKey: string;
14
+ }, {
15
+ issueKey: string;
16
+ }>;
17
+ /**
18
+ * Schema for transition_issue tool input.
19
+ */
20
+ export declare const transitionIssueSchema: z.ZodObject<{
21
+ issueKey: z.ZodString;
22
+ transitionId: z.ZodString;
23
+ comment: z.ZodOptional<z.ZodString>;
24
+ }, "strip", z.ZodTypeAny, {
25
+ issueKey: string;
26
+ transitionId: string;
27
+ comment?: string | undefined;
28
+ }, {
29
+ issueKey: string;
30
+ transitionId: string;
31
+ comment?: string | undefined;
32
+ }>;
33
+ /**
34
+ * Creates transition tool handlers.
35
+ * @param client - Jira client instance
36
+ * @returns Object containing transition tool handlers
37
+ */
38
+ export declare function createTransitionTools(client: JiraClient): {
39
+ /**
40
+ * Gets available transitions for an issue.
41
+ */
42
+ jira_get_transitions: (args: z.infer<typeof getTransitionsSchema>) => Promise<{
43
+ content: {
44
+ type: "text";
45
+ text: string;
46
+ }[];
47
+ }>;
48
+ /**
49
+ * Transitions an issue to a new status.
50
+ */
51
+ jira_transition_issue: (args: z.infer<typeof transitionIssueSchema>) => Promise<{
52
+ content: {
53
+ type: "text";
54
+ text: string;
55
+ }[];
56
+ }>;
57
+ };
58
+ /**
59
+ * Tool definitions for transition operations.
60
+ */
61
+ export declare const transitionToolDefinitions: ({
62
+ name: string;
63
+ description: string;
64
+ inputSchema: {
65
+ type: "object";
66
+ properties: {
67
+ issueKey: {
68
+ type: string;
69
+ description: string;
70
+ };
71
+ transitionId?: undefined;
72
+ comment?: undefined;
73
+ };
74
+ required: string[];
75
+ };
76
+ } | {
77
+ name: string;
78
+ description: string;
79
+ inputSchema: {
80
+ type: "object";
81
+ properties: {
82
+ issueKey: {
83
+ type: string;
84
+ description: string;
85
+ };
86
+ transitionId: {
87
+ type: string;
88
+ description: string;
89
+ };
90
+ comment: {
91
+ type: string;
92
+ description: string;
93
+ };
94
+ };
95
+ required: string[];
96
+ };
97
+ })[];
98
+ //# sourceMappingURL=transitions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transitions.d.ts","sourceRoot":"","sources":["../../src/tools/transitions.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,oBAAoB;;;;;;EAE/B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;EAIhC,CAAC;AAEH;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,UAAU;IAEhD;;OAEG;iCACgC,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC;;;;;;IAwBvE;;OAEG;kCACiC,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC;;;;;;EAmBhF;AAED;;GAEG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAuCrC,CAAC"}
@@ -0,0 +1,109 @@
1
+ /**
2
+ * @file tools/transitions.ts
3
+ * @description Workflow transition tools for Jira MCP.
4
+ */
5
+ import { z } from 'zod';
6
+ /**
7
+ * Schema for get_transitions tool input.
8
+ */
9
+ export const getTransitionsSchema = z.object({
10
+ issueKey: z.string().describe('The issue key or ID'),
11
+ });
12
+ /**
13
+ * Schema for transition_issue tool input.
14
+ */
15
+ export const transitionIssueSchema = z.object({
16
+ issueKey: z.string().describe('The issue key or ID'),
17
+ transitionId: z.string().describe('The ID of the transition to execute'),
18
+ comment: z.string().optional().describe('Optional comment to add during transition'),
19
+ });
20
+ /**
21
+ * Creates transition tool handlers.
22
+ * @param client - Jira client instance
23
+ * @returns Object containing transition tool handlers
24
+ */
25
+ export function createTransitionTools(client) {
26
+ return {
27
+ /**
28
+ * Gets available transitions for an issue.
29
+ */
30
+ jira_get_transitions: async (args) => {
31
+ const result = await client.getTransitions(args.issueKey);
32
+ return {
33
+ content: [
34
+ {
35
+ type: 'text',
36
+ text: JSON.stringify({
37
+ issueKey: args.issueKey,
38
+ transitions: result.transitions.map((t) => ({
39
+ id: t.id,
40
+ name: t.name,
41
+ toStatus: t.to.name,
42
+ toStatusCategory: t.to.statusCategory.name,
43
+ })),
44
+ }, null, 2),
45
+ },
46
+ ],
47
+ };
48
+ },
49
+ /**
50
+ * Transitions an issue to a new status.
51
+ */
52
+ jira_transition_issue: async (args) => {
53
+ await client.transitionIssue(args.issueKey, args.transitionId, args.comment);
54
+ return {
55
+ content: [
56
+ {
57
+ type: 'text',
58
+ text: JSON.stringify({
59
+ success: true,
60
+ message: `Issue ${args.issueKey} transitioned successfully`,
61
+ }, null, 2),
62
+ },
63
+ ],
64
+ };
65
+ },
66
+ };
67
+ }
68
+ /**
69
+ * Tool definitions for transition operations.
70
+ */
71
+ export const transitionToolDefinitions = [
72
+ {
73
+ name: 'jira_get_transitions',
74
+ description: 'Get available workflow transitions for a Jira issue. Use this to find valid transition IDs before transitioning an issue.',
75
+ inputSchema: {
76
+ type: 'object',
77
+ properties: {
78
+ issueKey: {
79
+ type: 'string',
80
+ description: 'The issue key or ID',
81
+ },
82
+ },
83
+ required: ['issueKey'],
84
+ },
85
+ },
86
+ {
87
+ name: 'jira_transition_issue',
88
+ description: 'Transition a Jira issue to a new status. First use jira_get_transitions to get valid transition IDs.',
89
+ inputSchema: {
90
+ type: 'object',
91
+ properties: {
92
+ issueKey: {
93
+ type: 'string',
94
+ description: 'The issue key or ID',
95
+ },
96
+ transitionId: {
97
+ type: 'string',
98
+ description: 'The ID of the transition to execute',
99
+ },
100
+ comment: {
101
+ type: 'string',
102
+ description: 'Optional comment to add during transition',
103
+ },
104
+ },
105
+ required: ['issueKey', 'transitionId'],
106
+ },
107
+ },
108
+ ];
109
+ //# sourceMappingURL=transitions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transitions.js","sourceRoot":"","sources":["../../src/tools/transitions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qBAAqB,CAAC;CACvD,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qBAAqB,CAAC;IACpD,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qCAAqC,CAAC;IACxE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,2CAA2C,CAAC;CACvF,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,MAAkB;IACpD,OAAO;QACH;;WAEG;QACH,oBAAoB,EAAE,KAAK,EAAE,IAA0C,EAAE,EAAE;YACvE,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ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aACJ;YACD,QAAQ,EAAE,CAAC,UAAU,CAAC;SACzB;KACJ;IACD;QACI,IAAI,EAAE,uBAAuB;QAC7B,WAAW,EACP,sGAAsG;QAC1G,WAAW,EAAE;YACT,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACR,QAAQ,EAAE;oBACN,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,qBAAqB;iBACrC;gBACD,YAAY,EAAE;oBACV,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,qCAAqC;iBACrD;gBACD,OAAO,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,2CAA2C;iBAC3D;aACJ;YACD,QAAQ,EAAE,CAAC,UAAU,EAAE,cAAc,CAAC;SACzC;KACJ;CACJ,CAAC"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * @file tools/users.ts
3
+ * @description User-related MCP tools for Jira.
4
+ */
5
+ import { z } from 'zod';
6
+ import { JiraClient } from '../client.js';
7
+ /**
8
+ * Schema for get_user tool input.
9
+ */
10
+ export declare const getUserSchema: z.ZodObject<{
11
+ username: z.ZodString;
12
+ }, "strip", z.ZodTypeAny, {
13
+ username: string;
14
+ }, {
15
+ username: string;
16
+ }>;
17
+ /**
18
+ * Creates user tool handlers.
19
+ * @param client - Jira client instance
20
+ * @returns Object containing user tool handlers
21
+ */
22
+ export declare function createUserTools(client: JiraClient): {
23
+ /**
24
+ * Gets the currently authenticated user.
25
+ */
26
+ jira_get_current_user: () => Promise<{
27
+ content: {
28
+ type: "text";
29
+ text: string;
30
+ }[];
31
+ }>;
32
+ /**
33
+ * Gets a user by username.
34
+ */
35
+ jira_get_user: (args: z.infer<typeof getUserSchema>) => Promise<{
36
+ content: {
37
+ type: "text";
38
+ text: string;
39
+ }[];
40
+ }>;
41
+ };
42
+ /**
43
+ * Tool definitions for user operations.
44
+ */
45
+ export declare const userToolDefinitions: ({
46
+ name: string;
47
+ description: string;
48
+ inputSchema: {
49
+ type: "object";
50
+ properties: {
51
+ username?: undefined;
52
+ };
53
+ required: never[];
54
+ };
55
+ } | {
56
+ name: string;
57
+ description: string;
58
+ inputSchema: {
59
+ type: "object";
60
+ properties: {
61
+ username: {
62
+ type: string;
63
+ description: string;
64
+ };
65
+ };
66
+ required: string[];
67
+ };
68
+ })[];
69
+ //# sourceMappingURL=users.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../src/tools/users.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,aAAa;;;;;;EAExB,CAAC;AAEH;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,UAAU;IAE1C;;OAEG;;;;;;;IAuBH;;OAEG;0BACyB,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC;;;;;;EAsBhE;AAED;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;IAwB/B,CAAC"}
@@ -0,0 +1,89 @@
1
+ /**
2
+ * @file tools/users.ts
3
+ * @description User-related MCP tools for Jira.
4
+ */
5
+ import { z } from 'zod';
6
+ /**
7
+ * Schema for get_user tool input.
8
+ */
9
+ export const getUserSchema = z.object({
10
+ username: z.string().describe('The username to look up'),
11
+ });
12
+ /**
13
+ * Creates user tool handlers.
14
+ * @param client - Jira client instance
15
+ * @returns Object containing user tool handlers
16
+ */
17
+ export function createUserTools(client) {
18
+ return {
19
+ /**
20
+ * Gets the currently authenticated user.
21
+ */
22
+ jira_get_current_user: async () => {
23
+ const user = await client.getCurrentUser();
24
+ return {
25
+ content: [
26
+ {
27
+ type: 'text',
28
+ text: JSON.stringify({
29
+ name: user.name,
30
+ displayName: user.displayName,
31
+ emailAddress: user.emailAddress,
32
+ active: user.active,
33
+ timeZone: user.timeZone,
34
+ }, null, 2),
35
+ },
36
+ ],
37
+ };
38
+ },
39
+ /**
40
+ * Gets a user by username.
41
+ */
42
+ jira_get_user: async (args) => {
43
+ const user = await client.getUser(args.username);
44
+ return {
45
+ content: [
46
+ {
47
+ type: 'text',
48
+ text: JSON.stringify({
49
+ name: user.name,
50
+ displayName: user.displayName,
51
+ emailAddress: user.emailAddress,
52
+ active: user.active,
53
+ timeZone: user.timeZone,
54
+ }, null, 2),
55
+ },
56
+ ],
57
+ };
58
+ },
59
+ };
60
+ }
61
+ /**
62
+ * Tool definitions for user operations.
63
+ */
64
+ export const userToolDefinitions = [
65
+ {
66
+ name: 'jira_get_current_user',
67
+ description: 'Get information about the currently authenticated Jira user',
68
+ inputSchema: {
69
+ type: 'object',
70
+ properties: {},
71
+ required: [],
72
+ },
73
+ },
74
+ {
75
+ name: 'jira_get_user',
76
+ description: 'Get information about a Jira user by username',
77
+ inputSchema: {
78
+ type: 'object',
79
+ properties: {
80
+ username: {
81
+ type: 'string',
82
+ description: 'The username to look up',
83
+ },
84
+ },
85
+ required: ['username'],
86
+ },
87
+ },
88
+ ];
89
+ //# sourceMappingURL=users.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"users.js","sourceRoot":"","sources":["../../src/tools/users.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,yBAAyB,CAAC;CAC3D,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,MAAkB;IAC9C,OAAO;QACH;;WAEG;QACH,qBAAqB,EAAE,KAAK,IAAI,EAAE;YAC9B,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,cAAc,EAAE,CAAC;YAC3C,OAAO;gBACH,OAAO,EAAE;oBACL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QAAQ;oBACd,WAAW,EAAE,yBAAyB;iBACzC;aACJ;YACD,QAAQ,EAAE,CAAC,UAAU,CAAC;SACzB;KACJ;CACJ,CAAC"}
package/package.json ADDED
@@ -0,0 +1,57 @@
1
+ {
2
+ "name": "@lvmk/jira-mcp",
3
+ "version": "1.0.0",
4
+ "description": "MCP server providing Jira tools with basic authentication support for legacy Jira Server (v7.x and older)",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "bin": {
9
+ "jira-mcp": "dist/index.js"
10
+ },
11
+ "scripts": {
12
+ "build": "tsc",
13
+ "dev": "tsc --watch",
14
+ "start": "node dist/index.js",
15
+ "test": "npm run test:build && node dist-test/test/client.test.js",
16
+ "test:tools": "npm run test:build && node dist-test/test/tools.test.js",
17
+ "test:integration": "npm run test:build && node dist-test/test/integration.test.js",
18
+ "test:build": "tsc -p tsconfig.test.json",
19
+ "test:all": "npm run test:build && node dist-test/test/client.test.js && node dist-test/test/tools.test.js",
20
+ "prepublishOnly": "npm run build",
21
+ "clean": "rm -rf dist dist-test"
22
+ },
23
+ "keywords": [
24
+ "mcp",
25
+ "jira",
26
+ "model-context-protocol",
27
+ "ai-tools",
28
+ "claude",
29
+ "copilot",
30
+ "basic-auth",
31
+ "jira-server",
32
+ "legacy"
33
+ ],
34
+ "author": "lvmk",
35
+ "license": "MIT",
36
+ "repository": {
37
+ "type": "git",
38
+ "url": "git@github.com:stommazh/jira-mcp.git"
39
+ },
40
+ "engines": {
41
+ "node": ">=18.0.0"
42
+ },
43
+ "files": [
44
+ "dist",
45
+ "README.md",
46
+ "LICENSE"
47
+ ],
48
+ "dependencies": {
49
+ "@modelcontextprotocol/sdk": "^1.0.0",
50
+ "zod": "^3.23.0"
51
+ },
52
+ "devDependencies": {
53
+ "@types/node": "^20.0.0",
54
+ "dotenv": "^16.4.0",
55
+ "typescript": "^5.4.0"
56
+ }
57
+ }