@draftt-io/draftt-mcp 1.1.1 → 1.2.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 (57) hide show
  1. package/README.md +23 -29
  2. package/dist/api/drafttClient.d.ts +2 -0
  3. package/dist/api/drafttClient.js +6 -0
  4. package/dist/api/drafttClient.js.map +1 -1
  5. package/dist/api/responseFormatter.d.ts +6 -6
  6. package/dist/api/responseFormatter.js +7 -160
  7. package/dist/api/responseFormatter.js.map +1 -1
  8. package/dist/handlers/componentHandler.js +1 -6
  9. package/dist/handlers/componentHandler.js.map +1 -1
  10. package/dist/handlers/drafttHandler.js +1 -6
  11. package/dist/handlers/drafttHandler.js.map +1 -1
  12. package/dist/handlers/policyHandler.d.ts +8 -0
  13. package/dist/handlers/policyHandler.js +19 -19
  14. package/dist/handlers/policyHandler.js.map +1 -1
  15. package/dist/index.js +23 -166
  16. package/dist/index.js.map +1 -1
  17. package/dist/models/component.d.ts +4 -4
  18. package/dist/models/draftt.d.ts +1 -1
  19. package/dist/models/policy.d.ts +1 -1
  20. package/dist/models/policyK8sComponent.d.ts +12 -0
  21. package/dist/{interfaces/component.js → models/policyK8sComponent.js} +1 -1
  22. package/dist/models/policyK8sComponent.js.map +1 -0
  23. package/dist/schemas/componentSchema.d.ts +484 -474
  24. package/dist/schemas/componentSchema.js +202 -117
  25. package/dist/schemas/componentSchema.js.map +1 -1
  26. package/dist/schemas/drafttSchema.d.ts +11 -15
  27. package/dist/schemas/drafttSchema.js +6 -6
  28. package/dist/schemas/drafttSchema.js.map +1 -1
  29. package/dist/schemas/policySchema.d.ts +65 -234
  30. package/dist/schemas/policySchema.js +54 -54
  31. package/dist/schemas/policySchema.js.map +1 -1
  32. package/dist/server/serverFactory.d.ts +8 -0
  33. package/dist/server/serverFactory.js +122 -0
  34. package/dist/server/serverFactory.js.map +1 -0
  35. package/dist/utils/logger.js +1 -1
  36. package/dist/utils/logger.js.map +1 -1
  37. package/package.json +7 -8
  38. package/dist/drafttClient.d.ts +0 -17
  39. package/dist/drafttClient.js +0 -187
  40. package/dist/drafttClient.js.map +0 -1
  41. package/dist/helpers/constants.d.ts +0 -31
  42. package/dist/helpers/constants.js +0 -37
  43. package/dist/helpers/constants.js.map +0 -1
  44. package/dist/interfaces/component.d.ts +0 -60
  45. package/dist/interfaces/component.js.map +0 -1
  46. package/dist/interfaces/draftt.d.ts +0 -3
  47. package/dist/interfaces/draftt.js +0 -3
  48. package/dist/interfaces/draftt.js.map +0 -1
  49. package/dist/interfaces/policy.d.ts +0 -21
  50. package/dist/interfaces/policy.js +0 -3
  51. package/dist/interfaces/policy.js.map +0 -1
  52. package/dist/mcp-server-sse.d.ts +0 -2
  53. package/dist/mcp-server-sse.js +0 -151
  54. package/dist/mcp-server-sse.js.map +0 -1
  55. package/dist/tools.d.ts +0 -6
  56. package/dist/tools.js +0 -277
  57. package/dist/tools.js.map +0 -1
package/dist/index.js CHANGED
@@ -5,181 +5,38 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  };
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  require("dotenv/config");
8
- const mcp_js_1 = require("@modelcontextprotocol/sdk/server/mcp.js");
9
8
  const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
10
9
  const minimist_1 = __importDefault(require("minimist"));
11
- const drafttClient_1 = require("./api/drafttClient");
12
- const componentHandler_1 = require("./handlers/componentHandler");
13
- const policyHandler_1 = require("./handlers/policyHandler");
14
- const drafttHandler_1 = require("./handlers/drafttHandler");
15
10
  const logger_1 = require("./utils/logger");
16
- const componentSchema_1 = require("./schemas/componentSchema");
17
- const policySchema_1 = require("./schemas/policySchema");
18
- const drafttSchema_1 = require("./schemas/drafttSchema");
19
- async function main() {
11
+ const serverFactory_1 = require("./server/serverFactory");
12
+ function parseConfig() {
20
13
  const argv = (0, minimist_1.default)(process.argv.slice(2));
21
- const accessKey = argv["access-key"] || process.env.DRAFTT_ACCESS_KEY;
22
- const debug = argv["debug"] || false;
23
- // Set up logging
24
- const logger = (0, logger_1.setupLogger)(debug);
25
- logger.info("Starting Draftt MCP Server...");
26
- if (!accessKey) {
27
- logger.error("Missing access-key");
28
- throw new Error("Missing access-key. Please provide one via --access-key or DRAFTT_ACCESS_KEY environment variable");
14
+ const accessKey = argv['access-key'] || process.env.DRAFTT_ACCESS_KEY;
15
+ const debug = argv['debug'] || process.env.DEBUG === 'true' || false;
16
+ return { accessKey, debug };
17
+ }
18
+ function validateConfig(config) {
19
+ if (!config.accessKey) {
20
+ throw new Error('Missing access-key. Provide via --access-key or DRAFTT_ACCESS_KEY environment variable');
29
21
  }
30
- // Create API client
31
- const drafttClient = new drafttClient_1.DrafttClient(logger, accessKey);
32
- // Create handlers
33
- const componentHandler = new componentHandler_1.ComponentHandler(drafttClient);
34
- const policyHandler = new policyHandler_1.PolicyHandler(drafttClient);
35
- const drafttHandler = new drafttHandler_1.DrafttHandler(drafttClient);
36
- // Create MCP server
37
- const server = new mcp_js_1.McpServer({
38
- name: "Draftt MCP Server",
39
- version: "1.0.0",
40
- });
41
- // Register tools
42
- server.tool("draftt_component_search", "Search and filter components in Draftt, component is a cloud asset with version, technology, type, etc. For example: EKS cluster, AWS Lambda, Azure Function, etc.", componentSchema_1.componentSearchSchema.shape, async (args) => {
43
- try {
44
- const validatedArgs = componentSchema_1.componentSearchSchema.parse(args);
45
- const result = await componentHandler.search(validatedArgs);
46
- return {
47
- content: result.content
48
- };
49
- }
50
- catch (error) {
51
- logger.error("Error in draftt_component_search:", error);
52
- return {
53
- content: [{
54
- type: "text",
55
- text: `Error: ${error instanceof Error ? error.message : 'Unknown error occurred'}`
56
- }]
57
- };
58
- }
59
- });
60
- server.tool("draftt_component_get", "Get a detailed information about a component in Draftt where you can get all the data about a component like: name, version, technology, type, etc.", componentSchema_1.componentGetSchema.shape, async (args) => {
61
- try {
62
- const validatedArgs = componentSchema_1.componentGetSchema.parse(args);
63
- const result = await componentHandler.get(validatedArgs);
64
- return {
65
- content: result.content
66
- };
67
- }
68
- catch (error) {
69
- logger.error("Error in draftt_component_get:", error);
70
- return {
71
- content: [{
72
- type: "text",
73
- text: `Error: ${error instanceof Error ? error.message : 'Unknown error occurred'}`
74
- }]
75
- };
76
- }
77
- });
78
- server.tool("draftt_policy_search", "Search for policies in Draftt(currently: EOL and Latest and Greatest), we're using policies for assessing specific rules for components, for example, a policy might indicate that a component reached end of life and needs to be updated.", policySchema_1.policySearchSchema.shape, async (args) => {
79
- try {
80
- const validatedArgs = policySchema_1.policySearchSchema.parse(args);
81
- const result = await policyHandler.search(validatedArgs);
82
- return {
83
- content: result.content
84
- };
85
- }
86
- catch (error) {
87
- logger.error("Error in draftt_policy_search:", error);
88
- return {
89
- content: [{
90
- type: "text",
91
- text: `Error: ${error instanceof Error ? error.message : 'Unknown error occurred'}`
92
- }]
93
- };
94
- }
95
- });
96
- server.tool("draftt_policy_get", "Get a detailed information about a policy in Draftt", policySchema_1.policyGetSchema.shape, async (args) => {
97
- try {
98
- const validatedArgs = policySchema_1.policyGetSchema.parse(args);
99
- const result = await policyHandler.get(validatedArgs);
100
- return {
101
- content: result.content
102
- };
103
- }
104
- catch (error) {
105
- logger.error("Error in draftt_policy_get:", error);
106
- return {
107
- content: [{
108
- type: "text",
109
- text: `Error: ${error instanceof Error ? error.message : 'Unknown error occurred'}`
110
- }]
111
- };
112
- }
113
- });
114
- server.tool("draftt_policy_component_get", "Get a analyzed information about a component meeting a draftt policy, for example: when an EKS cluster will reach end of life, what is the next version to upgrade to, etc.", componentSchema_1.policyComponentGetSchema.shape, async (args) => {
115
- try {
116
- const validatedArgs = componentSchema_1.policyComponentGetSchema.parse(args);
117
- const result = await policyHandler.componentGet(validatedArgs);
118
- return {
119
- content: result.content
120
- };
121
- }
122
- catch (error) {
123
- logger.error("Error in draftt_policy_component_get:", error);
124
- return {
125
- content: [{
126
- type: "text",
127
- text: `Error: ${error instanceof Error ? error.message : 'Unknown error occurred'}`
128
- }]
129
- };
130
- }
131
- });
132
- server.tool("draftt_policy_component_query", "Advanced query for policy components with rich filtering using operators like $eq, $ne, $gt, $gte, $lt, $lte, $in, $nin, $exists. Supports tag filtering, pagination, field selection, and cost analysis. Policy components describe how components match specific policies (e.g., EOL status, compliance requirements).", componentSchema_1.policyComponentQuerySchema.shape, async (args) => {
133
- try {
134
- const validatedArgs = componentSchema_1.policyComponentQuerySchema.parse(args);
135
- const result = await policyHandler.componentQuery(validatedArgs);
136
- return {
137
- content: result.content
138
- };
139
- }
140
- catch (error) {
141
- logger.error("Error in draftt_policy_component_query:", error);
142
- return {
143
- content: [{
144
- type: "text",
145
- text: `Error: ${error instanceof Error ? error.message : 'Unknown error occurred'}`
146
- }]
147
- };
148
- }
149
- });
150
- server.tool("draftt_upgrade_guide(draftt)_get", "Get a draftt which in this context represents an upgrade guide. currently for a k8s components only, draftt is a step by step guide for upgrading a k8s component from one version to another, it includes couple of sections (nodes,images, API, etc.), we generating it for a components that integrated to our platform", drafttSchema_1.drafttQuerySchema.shape, async (args) => {
151
- try {
152
- const validatedArgs = drafttSchema_1.drafttQuerySchema.parse(args);
153
- const result = await drafttHandler.query(validatedArgs);
154
- return {
155
- content: result.content
156
- };
157
- }
158
- catch (error) {
159
- logger.error("Error in draftt_query:", error);
160
- return {
161
- content: [{
162
- type: "text",
163
- text: `Error: ${error instanceof Error ? error.message : 'Unknown error occurred'}`
164
- }]
165
- };
166
- }
167
- });
168
- // Connect to transport
22
+ }
23
+ async function startServer(config) {
24
+ const logger = (0, logger_1.setupLogger)(config.debug);
25
+ logger.info('Starting Draftt MCP Server (stdio transport)...');
26
+ const server = (0, serverFactory_1.createMcpServer)(logger, config.accessKey);
169
27
  const transport = new stdio_js_1.StdioServerTransport();
170
- logger.info("Connecting server to transport...");
171
- try {
172
- await server.connect(transport);
173
- logger.info("Server connected to transport");
174
- }
175
- catch (error) {
176
- logger.error("Error connecting to transport:", error);
177
- process.exit(1);
178
- }
28
+ logger.info('Connecting server to stdio transport...');
29
+ await server.connect(transport);
30
+ logger.info('Server connected to stdio transport');
31
+ }
32
+ async function main() {
33
+ const config = parseConfig();
34
+ validateConfig(config);
35
+ await startServer(config);
179
36
  }
180
37
  main().catch((error) => {
181
38
  const logger = (0, logger_1.getLogger)();
182
- logger.error("Fatal error in main():", error);
39
+ logger.error('Fatal error in main():', error);
183
40
  process.exit(1);
184
41
  });
185
42
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AACA,yBAAuB;AACvB,oEAAoE;AACpE,wEAAiF;AACjF,wDAAgC;AAEhC,qDAAkD;AAClD,kEAA+D;AAC/D,4DAAyD;AACzD,4DAAyD;AACzD,2CAAwD;AAExD,+DAA4I;AAC5I,yDAA6E;AAC7E,yDAA4E;AAK5E,KAAK,UAAU,IAAI;IACf,MAAM,IAAI,GAAG,IAAA,kBAAQ,EAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7C,MAAM,SAAS,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC;IACtE,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,KAAK,CAAC;IAErC,iBAAiB;IACjB,MAAM,MAAM,GAAG,IAAA,oBAAW,EAAC,KAAK,CAAC,CAAC;IAClC,MAAM,CAAC,IAAI,CAAC,+BAA+B,CAAC,CAAC;IAE7C,IAAI,CAAC,SAAS,EAAE,CAAC;QACb,MAAM,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;QACnC,MAAM,IAAI,KAAK,CAAC,mGAAmG,CAAC,CAAC;IACzH,CAAC;IAED,oBAAoB;IACpB,MAAM,YAAY,GAAG,IAAI,2BAAY,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAEzD,kBAAkB;IAClB,MAAM,gBAAgB,GAAG,IA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CAAC;AAChC,CAAC;AAED,SAAS,cAAc,CAAC,MAAoB;IACxC,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CAAC,wFAAwF,CAAC,CAAC;IAC9G,CAAC;AACL,CAAC;AAED,KAAK,UAAU,WAAW,CAAC,MAAoB;IAC3C,MAAM,MAAM,GAAG,IAAA,oBAAW,EAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACzC,MAAM,CAAC,IAAI,CAAC,iDAAiD,CAAC,CAAC;IAE/D,MAAM,MAAM,GAAG,IAAA,+BAAe,EAAC,MAAM,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC;IACzD,MAAM,SAAS,GAAG,IAAI,+BAAoB,EAAE,CAAC;IAE7C,MAAM,CAAC,IAAI,CAAC,yCAAyC,CAAC,CAAC;IACvD,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,MAAM,CAAC,IAAI,CAAC,qCAAqC,CAAC,CAAC;AACvD,CAAC;AAED,KAAK,UAAU,IAAI;IACf,MAAM,MAAM,GAAG,WAAW,EAAE,CAAC;IAC7B,cAAc,CAAC,MAAM,CAAC,CAAC;IACvB,MAAM,WAAW,CAAC,MAAM,CAAC,CAAC;AAC9B,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACnB,MAAM,MAAM,GAAG,IAAA,kBAAS,GAAE,CAAC;IAC3B,MAAM,CAAC,KAAK,CAAC,wBAAwB,EAAE,KAAK,CAAC,CAAC;IAC9C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"}
@@ -37,14 +37,14 @@ export interface ComponentSearchArgs {
37
37
  pageSize?: number;
38
38
  }
39
39
  export interface ComponentGetArgs {
40
- componentId: string | number;
40
+ componentId: number;
41
41
  }
42
42
  export interface PolicyComponentGetArgs {
43
- policyId: string | number;
44
- componentId: string | number;
43
+ policyId: number;
44
+ componentId: number;
45
45
  }
46
46
  export interface PolicyComponentQueryArgs {
47
- policyId: string | number;
47
+ policyId: number;
48
48
  filter?: QueryFilter;
49
49
  tagFilters?: TagFilterQuery;
50
50
  selectTags?: boolean;
@@ -2,6 +2,6 @@ export interface DrafttGetArgs {
2
2
  random_string?: string;
3
3
  }
4
4
  export interface DrafttQueryArgs {
5
- componentId: string | number;
5
+ componentId: number;
6
6
  sections?: ("eksAddOns" | "deployments" | "controlPlane" | "nodes" | "k8sApi")[];
7
7
  }
@@ -17,7 +17,7 @@ export interface PolicySearchArgs {
17
17
  pageSize?: number;
18
18
  }
19
19
  export interface PolicyGetArgs {
20
- policyId: string | number;
20
+ policyId: number;
21
21
  }
22
22
  interface FilterOperator<T> {
23
23
  $eq?: T;
@@ -0,0 +1,12 @@
1
+ export interface K8sCatalogComponentData {
2
+ filter?: Record<string, unknown>;
3
+ select?: string[];
4
+ }
5
+ export interface PolicyK8sComponentQueryArgs {
6
+ filter?: Record<string, unknown>;
7
+ sort?: Record<string, unknown>;
8
+ select?: string[];
9
+ pageSize?: number;
10
+ pageToken?: string;
11
+ k8sCatalogComponentData?: K8sCatalogComponentData;
12
+ }
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=component.js.map
3
+ //# sourceMappingURL=policyK8sComponent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"policyK8sComponent.js","sourceRoot":"","sources":["../../src/models/policyK8sComponent.ts"],"names":[],"mappings":""}