@impart-security/impart-mcp 0.1.2 → 0.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.
- package/README.md +76 -35
- package/dist/index.js +1352 -501
- package/dist/test/integration.test.d.ts +1 -0
- package/dist/test/integration.test.js +262 -0
- package/dist/test/rule-recipe.test.d.ts +1 -0
- package/dist/test/rule-recipe.test.js +278 -0
- package/dist/test/smoke.test.d.ts +1 -0
- package/dist/test/smoke.test.js +37 -0
- package/dist/types.d.ts +1588 -86
- package/dist/types.js +127 -0
- package/package.json +20 -12
- package/dist/client.d.ts +0 -4
- package/dist/client.js +0 -38
package/dist/types.js
CHANGED
|
@@ -1,2 +1,129 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LabelColor = exports.LabelTypeEnum = exports.EndpointSchemaParametersInnerParameterInEnum = exports.EndpointSourceEnum = exports.TagCategoryEnum = exports.TagRemediationActionEnum = exports.TagTypeEnum = exports.ListFunctionality = exports.ListSubkind = exports.ListKind = exports.ObservedHostEnvEnum = exports.ObservedHostSuspectedEnum = exports.RulesTestCaseAssertionTagsLocationEnum = exports.RulesTestCaseAssertionTagsAssertionTypeEnum = exports.RulesTestCaseAssertionConditionDefault = exports.RulesTestCaseAssertionConditionPresence = exports.RulesTestCaseAssertionOutputAssertionTypeEnum = exports.RulesTestCaseAssertionStatusCodeLocationEnum = exports.RulesTestCaseAssertionStatusCodeAssertionTypeEnum = exports.RulesTestCaseAssertionBlockLocationEnum = exports.RulesTestCaseAssertionBlockAssertionTypeEnum = exports.BlockingEffectType = exports.RulesScriptLangEnum = exports.RulesScriptTypeEnum = void 0;
|
|
4
|
+
exports.RulesScriptTypeEnum = {
|
|
5
|
+
Custom: "custom",
|
|
6
|
+
Core: "core",
|
|
7
|
+
Recipe: "recipe",
|
|
8
|
+
};
|
|
9
|
+
exports.RulesScriptLangEnum = {
|
|
10
|
+
Assemblyscript: "assemblyscript",
|
|
11
|
+
};
|
|
12
|
+
exports.BlockingEffectType = {
|
|
13
|
+
Block: "block",
|
|
14
|
+
Simulate: "simulate",
|
|
15
|
+
};
|
|
16
|
+
exports.RulesTestCaseAssertionBlockAssertionTypeEnum = {
|
|
17
|
+
Block: "block",
|
|
18
|
+
};
|
|
19
|
+
exports.RulesTestCaseAssertionBlockLocationEnum = {
|
|
20
|
+
Req: "req",
|
|
21
|
+
Res: "res",
|
|
22
|
+
};
|
|
23
|
+
exports.RulesTestCaseAssertionStatusCodeAssertionTypeEnum = {
|
|
24
|
+
StatusCode: "status_code",
|
|
25
|
+
};
|
|
26
|
+
exports.RulesTestCaseAssertionStatusCodeLocationEnum = {
|
|
27
|
+
Req: "req",
|
|
28
|
+
Res: "res",
|
|
29
|
+
};
|
|
30
|
+
exports.RulesTestCaseAssertionOutputAssertionTypeEnum = {
|
|
31
|
+
Output: "output",
|
|
32
|
+
};
|
|
33
|
+
exports.RulesTestCaseAssertionConditionPresence = {
|
|
34
|
+
Contains: "contains",
|
|
35
|
+
NotContains: "not_contains",
|
|
36
|
+
};
|
|
37
|
+
exports.RulesTestCaseAssertionConditionDefault = {
|
|
38
|
+
Equal: "equal",
|
|
39
|
+
NotEqual: "not_equal",
|
|
40
|
+
GreaterThan: "greater_than",
|
|
41
|
+
LessThan: "less_than",
|
|
42
|
+
OneOf: "one_of",
|
|
43
|
+
};
|
|
44
|
+
exports.RulesTestCaseAssertionTagsAssertionTypeEnum = {
|
|
45
|
+
Tags: "tags",
|
|
46
|
+
};
|
|
47
|
+
exports.RulesTestCaseAssertionTagsLocationEnum = {
|
|
48
|
+
Req: "req",
|
|
49
|
+
Res: "res",
|
|
50
|
+
};
|
|
51
|
+
exports.ObservedHostSuspectedEnum = {
|
|
52
|
+
ServiceDomain: "service_domain",
|
|
53
|
+
HealthcheckDomain: "healthcheck_domain",
|
|
54
|
+
ProbedDomain: "probed_domain",
|
|
55
|
+
};
|
|
56
|
+
exports.ObservedHostEnvEnum = {
|
|
57
|
+
Prod: "prod",
|
|
58
|
+
Stage: "stage",
|
|
59
|
+
Demo: "demo",
|
|
60
|
+
TestQa: "test/qa",
|
|
61
|
+
Perf: "perf",
|
|
62
|
+
Dev: "dev",
|
|
63
|
+
Unknown: "unknown",
|
|
64
|
+
};
|
|
65
|
+
exports.ListKind = {
|
|
66
|
+
String: "string",
|
|
67
|
+
Uuid: "uuid",
|
|
68
|
+
Ip: "ip",
|
|
69
|
+
Country: "country",
|
|
70
|
+
Path: "path",
|
|
71
|
+
Asn: "asn",
|
|
72
|
+
};
|
|
73
|
+
exports.ListSubkind = {
|
|
74
|
+
SpecUuid: "spec_uuid",
|
|
75
|
+
EndpointUuid: "endpoint_uuid",
|
|
76
|
+
};
|
|
77
|
+
exports.ListFunctionality = {
|
|
78
|
+
Add: "add",
|
|
79
|
+
AddRemove: "add/remove",
|
|
80
|
+
};
|
|
81
|
+
exports.TagTypeEnum = {
|
|
82
|
+
Custom: "custom",
|
|
83
|
+
Core: "core",
|
|
84
|
+
Default: "default",
|
|
85
|
+
};
|
|
86
|
+
exports.TagRemediationActionEnum = {
|
|
87
|
+
Undefined: "undefined",
|
|
88
|
+
RateLimit: "rate_limit",
|
|
89
|
+
};
|
|
90
|
+
exports.TagCategoryEnum = {
|
|
91
|
+
Requests: "requests",
|
|
92
|
+
HighRisk: "highRisk",
|
|
93
|
+
SecurityPosture: "securityPosture",
|
|
94
|
+
Conformance: "conformance",
|
|
95
|
+
Waf: "waf",
|
|
96
|
+
SensitiveData: "sensitiveData",
|
|
97
|
+
HttpPosture: "httpPosture",
|
|
98
|
+
Jwt: "jwt",
|
|
99
|
+
Graphql: "graphql",
|
|
100
|
+
Analytics: "analytics",
|
|
101
|
+
Country: "country",
|
|
102
|
+
Custom: "custom",
|
|
103
|
+
};
|
|
104
|
+
exports.EndpointSourceEnum = {
|
|
105
|
+
Provided: "provided",
|
|
106
|
+
Learned: "learned",
|
|
107
|
+
};
|
|
108
|
+
exports.EndpointSchemaParametersInnerParameterInEnum = {
|
|
109
|
+
Query: "query",
|
|
110
|
+
Header: "header",
|
|
111
|
+
Path: "path",
|
|
112
|
+
Cookie: "cookie",
|
|
113
|
+
};
|
|
114
|
+
exports.LabelTypeEnum = {
|
|
115
|
+
Custom: "custom",
|
|
116
|
+
Default: "default",
|
|
117
|
+
};
|
|
118
|
+
exports.LabelColor = {
|
|
119
|
+
Gray: "gray",
|
|
120
|
+
Red: "red",
|
|
121
|
+
Orange: "orange",
|
|
122
|
+
Yellow: "yellow",
|
|
123
|
+
Green: "green",
|
|
124
|
+
Teal: "teal",
|
|
125
|
+
Cyan: "cyan",
|
|
126
|
+
Blue: "blue",
|
|
127
|
+
Purple: "purple",
|
|
128
|
+
Pink: "pink",
|
|
129
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@impart-security/impart-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Model Context Protocol (MCP) implementation for interacting with Impart's API",
|
|
5
5
|
"author": "Impart Security",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -18,21 +18,26 @@
|
|
|
18
18
|
"model-context-protocol"
|
|
19
19
|
],
|
|
20
20
|
"engines": {
|
|
21
|
-
"node": ">=
|
|
21
|
+
"node": ">=22.0.0"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@modelcontextprotocol/sdk": "1.
|
|
25
|
-
"axios": "1.
|
|
26
|
-
"zod": "
|
|
24
|
+
"@modelcontextprotocol/sdk": "1.21.1",
|
|
25
|
+
"axios": "1.13.2",
|
|
26
|
+
"zod": "4.1.12"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@types/node": "
|
|
29
|
+
"@types/node": "24.10.1",
|
|
30
30
|
"shx": "0.4.0",
|
|
31
|
-
"typescript": "5.
|
|
31
|
+
"typescript": "5.9.3"
|
|
32
32
|
},
|
|
33
33
|
"nx": {
|
|
34
34
|
"targets": {
|
|
35
|
-
"lint": {}
|
|
35
|
+
"lint": {},
|
|
36
|
+
"test": {
|
|
37
|
+
"dependsOn": [
|
|
38
|
+
"build"
|
|
39
|
+
]
|
|
40
|
+
}
|
|
36
41
|
},
|
|
37
42
|
"projectType": "application",
|
|
38
43
|
"tags": [
|
|
@@ -43,12 +48,15 @@
|
|
|
43
48
|
"circular-check": "madge --circular ./src",
|
|
44
49
|
"dep-check": "echo 'No dependencies to check'",
|
|
45
50
|
"dev": "shx rm -rf dist && tsc -b --watch",
|
|
46
|
-
"build": "shx rm -rf dist && tsc -b
|
|
51
|
+
"build": "shx rm -rf dist && tsc -b",
|
|
47
52
|
"format": "prettier ./src --write --cache",
|
|
48
53
|
"type-check": "tsc --noEmit",
|
|
49
|
-
"
|
|
50
|
-
"test
|
|
51
|
-
"
|
|
54
|
+
"lint": "echo 'Linting skipped for MCP server'",
|
|
55
|
+
"test": "npm run test:smoke && npm run test:integration",
|
|
56
|
+
"test:smoke": "node --test dist/test/smoke.test.js",
|
|
57
|
+
"test:integration": "node --test dist/test/integration.test.js",
|
|
58
|
+
"test:watch": "node --test --watch dist/test/*.test.js",
|
|
59
|
+
"clean": "shx rm -rf dist",
|
|
52
60
|
"version": "nx run build && node scripts/update-version-file"
|
|
53
61
|
}
|
|
54
62
|
}
|
package/dist/client.d.ts
DELETED
package/dist/client.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.client = exports.createClient = void 0;
|
|
7
|
-
exports.makeRequest = makeRequest;
|
|
8
|
-
const axios_1 = __importDefault(require("axios"));
|
|
9
|
-
const config_js_1 = require("./config.js");
|
|
10
|
-
// Create axios instance with default configuration
|
|
11
|
-
const createClient = () => {
|
|
12
|
-
const client = axios_1.default.create({
|
|
13
|
-
baseURL: config_js_1.config.apiBase,
|
|
14
|
-
headers: {
|
|
15
|
-
Authorization: `Bearer ${config_js_1.config.authToken}`,
|
|
16
|
-
"User-Agent": config_js_1.config.userAgent,
|
|
17
|
-
"X-Impart-Org-ID": config_js_1.config.orgId,
|
|
18
|
-
"Content-Type": "application/json",
|
|
19
|
-
},
|
|
20
|
-
});
|
|
21
|
-
// Add request interceptor for error handling
|
|
22
|
-
client.interceptors.response.use((response) => response, (error) => {
|
|
23
|
-
if (error.response) {
|
|
24
|
-
const { status, data } = error.response;
|
|
25
|
-
throw new Error(`API request failed with status ${status}: ${JSON.stringify(data)}`);
|
|
26
|
-
}
|
|
27
|
-
throw error;
|
|
28
|
-
});
|
|
29
|
-
return client;
|
|
30
|
-
};
|
|
31
|
-
exports.createClient = createClient;
|
|
32
|
-
// Export default client instance
|
|
33
|
-
exports.client = (0, exports.createClient)();
|
|
34
|
-
// Helper function to make API requests with proper typing
|
|
35
|
-
async function makeRequest(config) {
|
|
36
|
-
const response = await exports.client.request(config);
|
|
37
|
-
return response.data;
|
|
38
|
-
}
|