@khanglvm/jira-mcp 1.3.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 (59) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +126 -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-fetcher.d.ts +30 -0
  8. package/dist/config-fetcher.d.ts.map +1 -0
  9. package/dist/config-fetcher.js +279 -0
  10. package/dist/config-fetcher.js.map +1 -0
  11. package/dist/config.d.ts +54 -0
  12. package/dist/config.d.ts.map +1 -0
  13. package/dist/config.js +66 -0
  14. package/dist/config.js.map +1 -0
  15. package/dist/index.d.ts +12 -0
  16. package/dist/index.d.ts.map +1 -0
  17. package/dist/index.js +228 -0
  18. package/dist/index.js.map +1 -0
  19. package/dist/mcp-registry.d.ts +106 -0
  20. package/dist/mcp-registry.d.ts.map +1 -0
  21. package/dist/mcp-registry.js +168 -0
  22. package/dist/mcp-registry.js.map +1 -0
  23. package/dist/setup.d.ts +41 -0
  24. package/dist/setup.d.ts.map +1 -0
  25. package/dist/setup.js +263 -0
  26. package/dist/setup.js.map +1 -0
  27. package/dist/tools/index.d.ts +10 -0
  28. package/dist/tools/index.d.ts.map +1 -0
  29. package/dist/tools/index.js +10 -0
  30. package/dist/tools/index.js.map +1 -0
  31. package/dist/tools/issues.d.ts +364 -0
  32. package/dist/tools/issues.d.ts.map +1 -0
  33. package/dist/tools/issues.js +392 -0
  34. package/dist/tools/issues.js.map +1 -0
  35. package/dist/tools/projects.d.ts +70 -0
  36. package/dist/tools/projects.d.ts.map +1 -0
  37. package/dist/tools/projects.js +101 -0
  38. package/dist/tools/projects.js.map +1 -0
  39. package/dist/tools/search.d.ts +76 -0
  40. package/dist/tools/search.d.ts.map +1 -0
  41. package/dist/tools/search.js +111 -0
  42. package/dist/tools/search.js.map +1 -0
  43. package/dist/tools/transitions.d.ts +99 -0
  44. package/dist/tools/transitions.d.ts.map +1 -0
  45. package/dist/tools/transitions.js +121 -0
  46. package/dist/tools/transitions.js.map +1 -0
  47. package/dist/tools/users.d.ts +70 -0
  48. package/dist/tools/users.d.ts.map +1 -0
  49. package/dist/tools/users.js +96 -0
  50. package/dist/tools/users.js.map +1 -0
  51. package/dist/types/mcp-config.d.ts +154 -0
  52. package/dist/types/mcp-config.d.ts.map +1 -0
  53. package/dist/types/mcp-config.js +7 -0
  54. package/dist/types/mcp-config.js.map +1 -0
  55. package/dist/utils/path-resolver.d.ts +16 -0
  56. package/dist/utils/path-resolver.d.ts.map +1 -0
  57. package/dist/utils/path-resolver.js +37 -0
  58. package/dist/utils/path-resolver.js.map +1 -0
  59. package/package.json +61 -0
@@ -0,0 +1,111 @@
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: `Find Jira issues matching specific criteria. Use when user asks to:
71
+ - Find, list, or show issues (bugs, tasks, stories, epics)
72
+ - Search for work by status, assignee, project, priority, or date
73
+ - Get open, closed, in-progress, or unassigned items
74
+ - Find "my tasks" or someone else's work
75
+ - List recent or updated issues
76
+
77
+ Build JQL from natural language requests:
78
+ - "my open bugs" → assignee = currentUser() AND type = Bug AND status != Done
79
+ - "high priority tasks in PROJECT" → project = PROJECT AND type = Task AND priority = High
80
+ - "issues updated this week" → updated >= startOfWeek()
81
+ - "unassigned bugs" → assignee IS EMPTY AND type = Bug
82
+
83
+ Common JQL fields: project, status, assignee, reporter, priority, type, created, updated, due`,
84
+ inputSchema: {
85
+ type: 'object',
86
+ properties: {
87
+ jql: {
88
+ type: 'string',
89
+ description: 'JQL query. Examples: "project = PROJ AND status = Open", "assignee = currentUser() AND type = Bug"',
90
+ },
91
+ maxResults: {
92
+ type: 'number',
93
+ description: 'Max results (1-100, default 50)',
94
+ default: 50,
95
+ },
96
+ startAt: {
97
+ type: 'number',
98
+ description: 'Pagination offset (default 0)',
99
+ default: 0,
100
+ },
101
+ fields: {
102
+ type: 'array',
103
+ items: { type: 'string' },
104
+ description: 'Fields to include in results',
105
+ },
106
+ },
107
+ required: ['jql'],
108
+ },
109
+ },
110
+ ];
111
+ //# sourceMappingURL=search.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/tools/search.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA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+ 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
+ * Semantic descriptions help AI understand workflow operations.
61
+ */
62
+ export declare const transitionToolDefinitions: ({
63
+ name: string;
64
+ description: string;
65
+ inputSchema: {
66
+ type: "object";
67
+ properties: {
68
+ issueKey: {
69
+ type: string;
70
+ description: string;
71
+ };
72
+ transitionId?: undefined;
73
+ comment?: undefined;
74
+ };
75
+ required: string[];
76
+ };
77
+ } | {
78
+ name: string;
79
+ description: string;
80
+ inputSchema: {
81
+ type: "object";
82
+ properties: {
83
+ issueKey: {
84
+ type: string;
85
+ description: string;
86
+ };
87
+ transitionId: {
88
+ type: string;
89
+ description: string;
90
+ };
91
+ comment: {
92
+ type: string;
93
+ description: string;
94
+ };
95
+ };
96
+ required: string[];
97
+ };
98
+ })[];
99
+ //# 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;;;GAGG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAgDrC,CAAC"}
@@ -0,0 +1,121 @@
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
+ * Semantic descriptions help AI understand workflow operations.
71
+ */
72
+ export const transitionToolDefinitions = [
73
+ {
74
+ name: 'jira_get_transitions',
75
+ description: `Get available workflow transitions for an issue. Use FIRST when user wants to:
76
+ - Move an issue to a different status
77
+ - Start, complete, close, or reopen a ticket
78
+ - Change workflow state
79
+
80
+ Returns list of valid transitions with IDs. Required before calling jira_transition_issue.`,
81
+ inputSchema: {
82
+ type: 'object',
83
+ properties: {
84
+ issueKey: {
85
+ type: 'string',
86
+ description: 'Issue key like PROJ-123',
87
+ },
88
+ },
89
+ required: ['issueKey'],
90
+ },
91
+ },
92
+ {
93
+ name: 'jira_transition_issue',
94
+ description: `Move a Jira issue to a new workflow status. Use when user wants to:
95
+ - Start working on a ticket (→ In Progress)
96
+ - Complete or close an issue (→ Done)
97
+ - Reopen a closed issue
98
+ - Change issue status
99
+
100
+ IMPORTANT: Call jira_get_transitions first to get valid transition IDs.`,
101
+ inputSchema: {
102
+ type: 'object',
103
+ properties: {
104
+ issueKey: {
105
+ type: 'string',
106
+ description: 'Issue key to transition',
107
+ },
108
+ transitionId: {
109
+ type: 'string',
110
+ description: 'Transition ID from jira_get_transitions',
111
+ },
112
+ comment: {
113
+ type: 'string',
114
+ description: 'Optional comment to add with transition',
115
+ },
116
+ },
117
+ required: ['issueKey', 'transitionId'],
118
+ },
119
+ },
120
+ ];
121
+ //# 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,CAAC,CAAC;YAC1D,OAAO;gBACH,OAAO,EAAE;oBACL;wBACI,IAAI,EAAE,M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AAI,EAAE,uBAAuB;QAC7B,WAAW,EAAE;;;;;;wEAMmD;QAChE,WAAW,EAAE;YACT,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACR,QAAQ,EAAE;oBACN,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,yBAAyB;iBACzC;gBACD,YAAY,EAAE;oBACV,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,yCAAyC;iBACzD;gBACD,OAAO,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,yCAAyC;iBACzD;aACJ;YACD,QAAQ,EAAE,CAAC,UAAU,EAAE,cAAc,CAAC;SACzC;KACJ;CACJ,CAAC"}
@@ -0,0 +1,70 @@
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
+ * Semantic descriptions help AI understand user lookups.
45
+ */
46
+ export declare const userToolDefinitions: ({
47
+ name: string;
48
+ description: string;
49
+ inputSchema: {
50
+ type: "object";
51
+ properties: {
52
+ username?: undefined;
53
+ };
54
+ required: never[];
55
+ };
56
+ } | {
57
+ name: string;
58
+ description: string;
59
+ inputSchema: {
60
+ type: "object";
61
+ properties: {
62
+ username: {
63
+ type: string;
64
+ description: string;
65
+ };
66
+ };
67
+ required: string[];
68
+ };
69
+ })[];
70
+ //# 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;;;GAGG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;IA8B/B,CAAC"}
@@ -0,0 +1,96 @@
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
+ * Semantic descriptions help AI understand user lookups.
64
+ */
65
+ export const userToolDefinitions = [
66
+ {
67
+ name: 'jira_get_current_user',
68
+ description: `Get the currently logged-in Jira user's info. Use when user asks:
69
+ - "Who am I logged in as?"
70
+ - "What's my Jira username?"
71
+ - Need to know the current user for searches like "my issues"`,
72
+ inputSchema: {
73
+ type: 'object',
74
+ properties: {},
75
+ required: [],
76
+ },
77
+ },
78
+ {
79
+ name: 'jira_get_user',
80
+ description: `Look up a Jira user by username. Use when user wants to:
81
+ - Find info about a specific team member
82
+ - Check if a username exists
83
+ - Get a user's display name or email`,
84
+ inputSchema: {
85
+ type: 'object',
86
+ properties: {
87
+ username: {
88
+ type: 'string',
89
+ description: 'Jira username to look up',
90
+ },
91
+ },
92
+ required: ['username'],
93
+ },
94
+ },
95
+ ];
96
+ //# 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;;WA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AI,EAAE,eAAe;QACrB,WAAW,EAAE;;;qCAGgB;QAC7B,WAAW,EAAE;YACT,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACR,QAAQ,EAAE;oBACN,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,0BAA0B;iBAC1C;aACJ;YACD,QAAQ,EAAE,CAAC,UAAU,CAAC;SACzB;KACJ;CACJ,CAAC"}
@@ -0,0 +1,154 @@
1
+ /**
2
+ * @file mcp-config.ts
3
+ * @description Type definitions for dynamic MCP configuration system.
4
+ * Defines schemas for remote config fetcher and MCP client registry.
5
+ */
6
+ /**
7
+ * Platform-specific config file locations.
8
+ * Maps platform (macos/windows/linux in remote config) to available config paths.
9
+ * Note: Remote JSON uses macos/windows/linux, not darwin/win32/linux.
10
+ */
11
+ export interface ConfigLocations {
12
+ macos?: PlatformPaths;
13
+ windows?: PlatformPaths;
14
+ linux?: PlatformPaths;
15
+ }
16
+ /**
17
+ * Path configuration for a specific platform.
18
+ */
19
+ export interface PlatformPaths {
20
+ global?: string;
21
+ user?: string;
22
+ project?: string;
23
+ workspace?: string;
24
+ local?: string;
25
+ managed?: string;
26
+ globalAlt?: string;
27
+ }
28
+ /**
29
+ * Wrapper key types used by different MCP clients.
30
+ * Identifies the top-level key containing MCP server configs.
31
+ */
32
+ export type WrapperKey = 'mcpServers' | 'mcp' | 'servers' | 'context_servers' | 'mcp_servers';
33
+ /**
34
+ * Configuration scopes supported by MCP clients.
35
+ */
36
+ export type ConfigScope = 'global' | 'user' | 'project' | 'workspace' | 'local' | 'managed';
37
+ /**
38
+ * Transport types supported by MCP clients.
39
+ */
40
+ export type TransportType = 'stdio' | 'http' | 'sse' | 'local' | 'remote';
41
+ /**
42
+ * Server schema definition for MCP config.
43
+ * Describes required/optional fields for server configuration.
44
+ */
45
+ export interface ServerSchema {
46
+ type?: string;
47
+ command?: SchemaField;
48
+ args?: SchemaField;
49
+ url?: SchemaField;
50
+ headers?: SchemaField;
51
+ env?: SchemaField;
52
+ environment?: SchemaField;
53
+ }
54
+ /**
55
+ * Schema field definition.
56
+ */
57
+ export interface SchemaField {
58
+ type: string;
59
+ required?: boolean;
60
+ description?: string;
61
+ enum?: string[];
62
+ default?: string;
63
+ items?: string;
64
+ }
65
+ /**
66
+ * Configuration format details for an MCP client.
67
+ */
68
+ export interface ConfigFormat {
69
+ wrapperKey: WrapperKey;
70
+ serverSchema: ServerSchema;
71
+ example?: Record<string, unknown>;
72
+ format?: string;
73
+ yamlAlternative?: {
74
+ path: string;
75
+ note: string;
76
+ example: string;
77
+ };
78
+ }
79
+ /**
80
+ * CLI commands for managing MCP servers.
81
+ */
82
+ export interface CliCommands {
83
+ add?: string;
84
+ addJson?: string;
85
+ list?: string;
86
+ get?: string;
87
+ remove?: string;
88
+ enable?: string;
89
+ disable?: string;
90
+ edit?: string;
91
+ show?: string;
92
+ importDesktop?: string;
93
+ }
94
+ /**
95
+ * MCP client configuration from remote JSON.
96
+ */
97
+ export interface McpClientConfig {
98
+ name: string;
99
+ vendor?: string;
100
+ description?: string;
101
+ docsUrl?: string;
102
+ configLocations: ConfigLocations;
103
+ managedConfig?: Record<string, string>;
104
+ configFormat: ConfigFormat;
105
+ cli?: CliCommands;
106
+ scopes: ConfigScope[];
107
+ transportSupport: TransportType[];
108
+ notes?: string[];
109
+ ui?: {
110
+ access?: string;
111
+ install?: string;
112
+ manage?: string;
113
+ };
114
+ }
115
+ /**
116
+ * Remote MCP configuration schema.
117
+ * Top-level structure fetched from GitHub.
118
+ */
119
+ export interface McpConfigSchema {
120
+ $schema?: string;
121
+ $id?: string;
122
+ version: string;
123
+ lastUpdated: string;
124
+ description?: string;
125
+ clients: Record<string, McpClientConfig>;
126
+ commonPatterns?: {
127
+ stdioServer?: Record<string, unknown>;
128
+ httpServer?: Record<string, unknown>;
129
+ };
130
+ wrapperKeyMapping?: Record<WrapperKey, string[]>;
131
+ envVariableExpansion?: Record<string, unknown>;
132
+ }
133
+ /**
134
+ * Options for fetching MCP configuration.
135
+ */
136
+ export interface FetchOptions {
137
+ forceRefresh?: boolean;
138
+ timeout?: number;
139
+ retries?: number;
140
+ }
141
+ /**
142
+ * Cache entry for in-memory caching.
143
+ */
144
+ export interface CacheEntry {
145
+ data: McpConfigSchema;
146
+ etag?: string;
147
+ fetchedAt: number;
148
+ ttl: number;
149
+ }
150
+ /**
151
+ * Config file type (JSON, YAML, TOML).
152
+ */
153
+ export type ConfigFileType = 'json' | 'yaml' | 'toml';
154
+ //# sourceMappingURL=mcp-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-config.d.ts","sourceRoot":"","sources":["../../src/types/mcp-config.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC5B,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,KAAK,CAAC,EAAE,aAAa,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;GAGG;AACH,MAAM,MAAM,UAAU,GAChB,YAAY,GACZ,KAAK,GACL,SAAS,GACT,iBAAiB,GACjB,aAAa,CAAC;AAEpB;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,GAAG,SAAS,CAAC;AAE5F;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE1E;;;GAGG;AACH,MAAM,WAA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