@crowdstrike/aidr-mcp-proxy 1.4.0 → 1.6.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 +16 -0
- package/dist/proxy.mjs +13 -4
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -104,4 +104,20 @@ environment variable.
|
|
|
104
104
|
To identify the calling user by ID in CrowdStrike AIDR, set the
|
|
105
105
|
`CS_AIDR_USER_ID` environment variable.
|
|
106
106
|
|
|
107
|
+
### User name
|
|
108
|
+
|
|
109
|
+
To identify the calling user by name in CrowdStrike AIDR, set the
|
|
110
|
+
`CS_AIDR_USER_NAME` environment variable.
|
|
111
|
+
|
|
112
|
+
### Proxies
|
|
113
|
+
|
|
114
|
+
See the [AIDR documentation](https://aidr-docs.crowdstrike.com/docs/aidr#cloud-origins)
|
|
115
|
+
for connectivity requirements.
|
|
116
|
+
|
|
117
|
+
The AIDR MCP Proxy automatically reads proxy configuration from the environment
|
|
118
|
+
variables `http_proxy`, `https_proxy`, and `no_proxy`. Uppercase environment
|
|
119
|
+
variables are also supported: `HTTP_PROXY`, `HTTPS_PROXY`, and `NO_PROXY`. If
|
|
120
|
+
both the lowercase and uppercase environment variables are set, the uppercase
|
|
121
|
+
environment variables will be ignored.
|
|
122
|
+
|
|
107
123
|
[mcp-remote]: https://github.com/geelen/mcp-remote
|
package/dist/proxy.mjs
CHANGED
|
@@ -7,6 +7,7 @@ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
|
|
|
7
7
|
import { CallToolRequestSchema, CompleteRequestSchema, GetPromptRequestSchema, ListPromptsRequestSchema, ListResourceTemplatesRequestSchema, ListResourcesRequestSchema, ListToolsRequestSchema, LoggingMessageNotificationSchema, ReadResourceRequestSchema, ResourceUpdatedNotificationSchema, SubscribeRequestSchema, UnsubscribeRequestSchema } from "@modelcontextprotocol/sdk/types.js";
|
|
8
8
|
import { defineCommand, runMain } from "citty";
|
|
9
9
|
import { consola } from "consola";
|
|
10
|
+
import { EnvHttpProxyAgent } from "undici";
|
|
10
11
|
//#region src/proxy.ts
|
|
11
12
|
function isTextContent(x) {
|
|
12
13
|
return x.type === "text";
|
|
@@ -29,7 +30,8 @@ runMain(defineCommand({
|
|
|
29
30
|
env: {
|
|
30
31
|
...process.env,
|
|
31
32
|
CS_AIDR_TOKEN: void 0,
|
|
32
|
-
CS_AIDR_USER_ID: void 0
|
|
33
|
+
CS_AIDR_USER_ID: void 0,
|
|
34
|
+
CS_AIDR_USER_NAME: void 0
|
|
33
35
|
}
|
|
34
36
|
});
|
|
35
37
|
const client = new Client({
|
|
@@ -60,9 +62,14 @@ runMain(defineCommand({
|
|
|
60
62
|
}
|
|
61
63
|
}
|
|
62
64
|
if (serverCapabilities?.tools) {
|
|
65
|
+
const dispatcher = new EnvHttpProxyAgent();
|
|
63
66
|
const aiGuard = new AIGuard({
|
|
64
67
|
token: process.env.CS_AIDR_TOKEN,
|
|
65
|
-
baseURLTemplate: process.env.CS_AIDR_BASE_URL_TEMPLATE
|
|
68
|
+
baseURLTemplate: process.env.CS_AIDR_BASE_URL_TEMPLATE,
|
|
69
|
+
fetch: (url, init) => fetch(url, {
|
|
70
|
+
...init,
|
|
71
|
+
dispatcher
|
|
72
|
+
})
|
|
66
73
|
});
|
|
67
74
|
server.setRequestHandler(ListToolsRequestSchema, async (args) => {
|
|
68
75
|
const response = await client.listTools(args.params);
|
|
@@ -77,7 +84,8 @@ runMain(defineCommand({
|
|
|
77
84
|
user_id: process.env.CS_AIDR_USER_ID,
|
|
78
85
|
extra_info: {
|
|
79
86
|
app_name: process.env.APP_NAME,
|
|
80
|
-
mcp_server_name: serverVersion.name
|
|
87
|
+
mcp_server_name: serverVersion.name,
|
|
88
|
+
user_name: process.env.CS_AIDR_USER_NAME
|
|
81
89
|
}
|
|
82
90
|
});
|
|
83
91
|
if (guardedToolsList.status !== "Success") throw new Error(`Failed to guard tools list. ${JSON.stringify(guardedToolsList, null, 2)}`);
|
|
@@ -98,7 +106,8 @@ runMain(defineCommand({
|
|
|
98
106
|
extra_info: {
|
|
99
107
|
app_name: process.env.APP_NAME,
|
|
100
108
|
mcp_server_name: serverVersion.name,
|
|
101
|
-
tool_name: args.params.name
|
|
109
|
+
tool_name: args.params.name,
|
|
110
|
+
user_name: process.env.CS_AIDR_USER_NAME
|
|
102
111
|
}
|
|
103
112
|
});
|
|
104
113
|
if (guardedInput.status !== "Success") throw new Error("Failed to guard input.");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crowdstrike/aidr-mcp-proxy",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "Protect any MCP server from malicious entities and confidential PII.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -24,13 +24,14 @@
|
|
|
24
24
|
"@crowdstrike/aidr": "^1.1.1",
|
|
25
25
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
26
26
|
"citty": "^0.1.6",
|
|
27
|
-
"consola": "^3.4.2"
|
|
27
|
+
"consola": "^3.4.2",
|
|
28
|
+
"undici": "^7.25.0"
|
|
28
29
|
},
|
|
29
30
|
"devDependencies": {
|
|
30
31
|
"@biomejs/biome": "2.3.11",
|
|
31
|
-
"@containerbase/semantic-release-pnpm": "1.
|
|
32
|
+
"@containerbase/semantic-release-pnpm": "1.4.1",
|
|
32
33
|
"@tsconfig/node22": "22.0.5",
|
|
33
|
-
"@types/node": "22.19.
|
|
34
|
+
"@types/node": "22.19.17",
|
|
34
35
|
"conventional-changelog-conventionalcommits": "9.3.0",
|
|
35
36
|
"lefthook": "2.0.15",
|
|
36
37
|
"semantic-release": "25.0.3",
|