@rad-security/mcp-server 0.0.36-5.g3825a61 → 0.0.36

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 CHANGED
@@ -8,212 +8,225 @@ A Model Context Protocol (MCP) server for RAD Security, providing AI-powered sec
8
8
  <img width="380" height="200" src="https://glama.ai/mcp/servers/@rad-security/mcp-server/badge" alt="RAD Security MCP server" />
9
9
  </a>
10
10
 
11
- ## Connect (hosted — recommended)
11
+ ## Installation
12
12
 
13
- RAD Security runs the MCP server for you, so most users don't need to install or host anything. Point your MCP client at the hosted endpoint and authenticate with your RAD Security credentials.
13
+ ```bash
14
+ npm install @rad-security/mcp-server
15
+ ```
14
16
 
15
- - **Endpoint:** `https://api.rad.security/mcp/` — note the **trailing slash**.
16
- - **Transport:** Streamable HTTP.
17
- - **Authentication:** send your credential in the `Authorization` header:
17
+ ## Usage
18
18
 
19
- ```
20
- Authorization: Bearer <access_key_id>:<secret_key>:<account_id>
21
- ```
19
+ ### Prerequisites
22
20
 
23
- `<access_key_id>` and `<secret_key>` are a RAD Security API access key (create one in the RAD Security console); `<account_id>` is your account ID. The server authenticates every request against the RAD Security API — no credentials are stored server-side.
21
+ - Node.js 20.x or higher
24
22
 
25
- > A short-lived form `Bearer ory_st_<session_token>:<account_id>` also works, but session tokens expire — prefer an access key for anything long-lived (e.g. Slack / Claude Tag).
23
+ ### Environment Variables
26
24
 
27
- ### Claude Code
25
+ The following environment variables are required to use the MCP server with Rad Security:
28
26
 
29
27
  ```bash
30
- claude mcp add --transport http rad-security https://api.rad.security/mcp/ \
31
- --header "Authorization: Bearer <access_key_id>:<secret_key>:<account_id>"
28
+ RAD_SECURITY_ACCESS_KEY_ID="your_access_key"
29
+ RAD_SECURITY_SECRET_KEY="your_secret_key"
30
+ RAD_SECURITY_ACCOUNT_ID="your_account_id"
32
31
  ```
33
32
 
34
- ### OpenAI Codex CLI
35
-
36
- `~/.codex/config.toml`:
33
+ Optional environment variables:
37
34
 
38
- ```toml
39
- [mcp_servers.rad-security]
40
- url = "https://api.rad.security/mcp/"
41
- http_headers = { "Authorization" = "Bearer <access_key_id>:<secret_key>:<account_id>" }
35
+ ```bash
36
+ RAD_SECURITY_TENANT_ID="your_tenant_id" # Optional: If not provided, will be fetched automatically from the account
42
37
  ```
43
38
 
44
- Or via the CLI, keeping the secret in an env var (`export RAD_MCP_TOKEN=<access_key_id>:<secret_key>:<account_id>`):
39
+ #### Optional: Filter Toolkits
45
40
 
46
- ```bash
47
- codex mcp add rad-security --url https://api.rad.security/mcp/ --bearer-token-env-var RAD_MCP_TOKEN
48
- ```
41
+ You can control which toolkits are exposed by the MCP server using these environment variables:
49
42
 
50
- ### Cursor
43
+ - `INCLUDE_TOOLKITS`: Comma-separated list of toolkits to include (only these will be enabled)
44
+ - `EXCLUDE_TOOLKITS`: Comma-separated list of toolkits to exclude (all except these will be enabled)
51
45
 
52
- `.cursor/mcp.json`:
46
+ Available toolkits:
47
+ - `containers` - Container inventory operations
48
+ - `clusters` - Kubernetes cluster operations
49
+ - `audit` - Audit log operations
50
+ - `images` - Container image, vulnerability and CVE disposition operations
51
+ - `kubeobject` - Kubernetes resource operations
52
+ - `runtime` - Runtime analysis operations
53
+ - `findings` - Security findings operations
54
+ - `inbox` - Inbox item operations
55
+ - `workflows` - Workflow execution operations
56
+ - `custom_workflows` - Workflow authoring operations (disabled by default)
57
+ - `knowledge_base` - Knowledge base search operations
58
+ - `radql` - Query interface for rad data platform
59
+ - `dashboards` - Dashboard and widget template operations
60
+ - `integrations` - External integration operations
53
61
 
54
- ```json
55
- {
56
- "mcpServers": {
57
- "rad-security": {
58
- "type": "http",
59
- "url": "https://api.rad.security/mcp/",
60
- "headers": {
61
- "Authorization": "Bearer <access_key_id>:<secret_key>:<account_id>"
62
- }
63
- }
64
- }
65
- }
62
+ Note: `custom_workflows` is disabled by default and must be enabled explicitly via `INCLUDE_TOOLKITS`.
63
+
64
+ #### Inbound authentication (`MCP_AUTH_MODE`)
65
+
66
+ When running over the streamable HTTP transport, the server can authenticate each
67
+ inbound request instead of using a single set of process-env credentials. This is
68
+ what makes a single deployment safe to serve multiple accounts (for example, when
69
+ hosting the server as a remote connector).
70
+
71
+ - `MCP_AUTH_MODE=env` (default) — every session uses the `RAD_SECURITY_*`
72
+ environment credentials. Single-tenant; unauthenticated at the HTTP layer.
73
+ This preserves the existing local / self-hosted / per-account-pod behavior.
74
+ - `MCP_AUTH_MODE=header` — every session must present its own credential in the
75
+ `Authorization` header. A missing or malformed header is rejected with
76
+ `401 Unauthorized`. Only supported with `TRANSPORT_TYPE=streamable`
77
+ (the server refuses to start otherwise).
78
+
79
+ In `header` mode the bearer credential encodes the account, in one of two forms:
80
+
81
+ ```
82
+ Authorization: Bearer <access_key_id>:<secret_key>:<account_id>
83
+ Authorization: Bearer ory_st_<session_token>:<account_id>
66
84
  ```
67
85
 
68
- ### VS Code (GitHub Copilot)
86
+ `RAD_SECURITY_API_URL` is still taken from server configuration (not the caller).
87
+ The credential shape is validated on connect; whether it actually authenticates
88
+ against the Rad API surfaces on the first tool call.
69
89
 
70
- `.vscode/mcp.json` — note the wrapper key is `servers`, not `mcpServers`:
90
+ > **Note:** exposing the server publicly requires `MCP_AUTH_MODE=header` (or an
91
+ > authenticating proxy in front). The default `env` mode does **not** authenticate
92
+ > inbound HTTP requests and must not be reachable from untrusted networks.
71
93
 
72
- ```json
73
- {
74
- "servers": {
75
- "rad-security": {
76
- "type": "http",
77
- "url": "https://api.rad.security/mcp/",
78
- "headers": {
79
- "Authorization": "Bearer <access_key_id>:<secret_key>:<account_id>"
80
- }
81
- }
82
- }
83
- }
94
+ Examples:
95
+
96
+ ```bash
97
+ # Only enable workflow toolkit
98
+ INCLUDE_TOOLKITS="workflows"
99
+
100
+ # Enable only containers and images toolkits
101
+ INCLUDE_TOOLKITS="containers,images"
102
+
103
+ # Exclude workflow toolkit (enable all others)
104
+ EXCLUDE_TOOLKITS="workflows"
105
+
106
+ # Exclude runtime toolkit
107
+ EXCLUDE_TOOLKITS="runtime"
84
108
  ```
85
109
 
86
- ### Gemini CLI
110
+ Note: If `INCLUDE_TOOLKITS` is set, `EXCLUDE_TOOLKITS` is ignored.
87
111
 
88
- `~/.gemini/settings.json` — note the URL field is `httpUrl` (not `url`):
112
+ ### In cursor IDE
89
113
 
90
- ```json
91
- {
92
- "mcpServers": {
93
- "rad-security": {
94
- "httpUrl": "https://api.rad.security/mcp/",
95
- "headers": {
96
- "Authorization": "Bearer <access_key_id>:<secret_key>:<account_id>"
97
- }
98
- }
99
- }
100
- }
114
+ It's quite problematic to set ENV variables in cursor IDE.
115
+
116
+ So, you can use the following start.sh script to start the server.
117
+
118
+ ```bash
119
+ ./start.sh
101
120
  ```
102
121
 
103
- ### Cline
122
+ Please set the ENV variables in the start.sh script first!
123
+
124
+ ### In Claude Desktop
104
125
 
105
- `cline_mcp_settings.json` — note `type` must be exactly `streamableHttp` (camelCase):
126
+ You can use the following config to start the server in Claude Desktop.
106
127
 
107
128
  ```json
108
129
  {
109
130
  "mcpServers": {
110
131
  "rad-security": {
111
- "type": "streamableHttp",
112
- "url": "https://api.rad.security/mcp/",
113
- "headers": {
114
- "Authorization": "Bearer <access_key_id>:<secret_key>:<account_id>"
132
+ "command": "npx",
133
+ "args": ["-y", "@rad-security/mcp-server"],
134
+ "env": {
135
+ "RAD_SECURITY_ACCESS_KEY_ID": "<your-access-key-id>",
136
+ "RAD_SECURITY_SECRET_KEY": "<your-secret-key>",
137
+ "RAD_SECURITY_ACCOUNT_ID": "<your-account-id>"
115
138
  }
116
139
  }
117
140
  }
118
141
  }
119
142
  ```
120
143
 
121
- ### Windsurf
122
-
123
- `~/.codeium/windsurf/mcp_config.json` — note the URL field is `serverUrl`:
144
+ To filter toolkits, add `INCLUDE_TOOLKITS` or `EXCLUDE_TOOLKITS` to the env:
124
145
 
125
146
  ```json
126
147
  {
127
148
  "mcpServers": {
128
149
  "rad-security": {
129
- "serverUrl": "https://api.rad.security/mcp/",
130
- "headers": {
131
- "Authorization": "Bearer <access_key_id>:<secret_key>:<account_id>"
150
+ "command": "npx",
151
+ "args": ["-y", "@rad-security/mcp-server"],
152
+ "env": {
153
+ "RAD_SECURITY_ACCESS_KEY_ID": "<your-access-key-id>",
154
+ "RAD_SECURITY_SECRET_KEY": "<your-secret-key>",
155
+ "RAD_SECURITY_ACCOUNT_ID": "<your-account-id>",
156
+ "EXCLUDE_TOOLKITS": "workflows"
132
157
  }
133
158
  }
134
159
  }
135
- }
136
160
  ```
137
161
 
138
- ### Other clients
139
-
140
- Most MCP clients accept a remote Streamable HTTP server with a URL and an `Authorization` header — only the field names differ. Keep the **trailing slash** on the URL in every case.
162
+ ### As a Docker Container - with Streamable HTTP
141
163
 
142
- | Client | Config location | URL field | Transport marker | Header field |
143
- | --- | --- | --- | --- | --- |
144
- | Claude Code | `claude mcp add` | positional arg | `--transport http` | `--header` |
145
- | OpenAI Codex CLI | `~/.codex/config.toml` | `url` | inferred | `http_headers` / `bearer_token_env_var` |
146
- | Cursor | `.cursor/mcp.json` | `url` | `type: "http"` | `headers` |
147
- | VS Code | `.vscode/mcp.json` (`servers`) | `url` | `type: "http"` | `headers` |
148
- | Gemini CLI | `~/.gemini/settings.json` | `httpUrl` | inferred | `headers` |
149
- | Cline | `cline_mcp_settings.json` | `url` | `type: "streamableHttp"` | `headers` |
150
- | Windsurf | `~/.codeium/windsurf/mcp_config.json` | `serverUrl` | inferred | `headers` |
164
+ ```bash
165
+ docker build -t rad-security/mcp-server .
166
+ docker run \
167
+ -e TRANSPORT_TYPE=streamable \
168
+ -e RAD_SECURITY_ACCESS_KEY_ID=your_access_key \
169
+ -e RAD_SECURITY_SECRET_KEY=your_secret_key \
170
+ -e RAD_SECURITY_ACCOUNT_ID=your_account_id \
171
+ -p 3000:3000 \
172
+ rad-security/mcp-server
173
+ ```
151
174
 
152
- ### Claude.ai / Claude Desktop / Claude Tag (Slack)
175
+ With toolkit filters:
153
176
 
154
- These surfaces add remote MCP servers as **connectors**, which use their own credential settings rather than a raw request header. Add `https://api.rad.security/mcp/` as a custom connector, then supply the bearer credential through the connector's settings:
177
+ ```bash
178
+ docker run \
179
+ -e TRANSPORT_TYPE=streamable \
180
+ -e RAD_SECURITY_ACCESS_KEY_ID=your_access_key \
181
+ -e RAD_SECURITY_SECRET_KEY=your_secret_key \
182
+ -e RAD_SECURITY_ACCOUNT_ID=your_account_id \
183
+ -e INCLUDE_TOOLKITS=workflows,containers \
184
+ -p 3000:3000 \
185
+ rad-security/mcp-server
186
+ ```
155
187
 
156
- - **Claude Tag (Slack):** attach the server as a plugin whose `.mcp.json` points at the endpoint, and add the bearer credential on the Access bundle's **Credentials** tab. See [Claude Tag — connect a custom MCP server](https://claude.com/docs/claude-tag/admins/connections/custom).
157
- - **Claude.ai / Desktop:** add it under Settings → Connectors; see [custom connectors](https://support.claude.com/en/articles/11175166-get-started-with-custom-connectors-using-remote-mcp).
188
+ ### As a Docker Container - multi-tenant (per-request auth)
158
189
 
159
- ### Test it (MCP Inspector or curl)
190
+ Serve multiple accounts from one deployment by requiring each request to carry its
191
+ own credential. Note there are no `RAD_SECURITY_ACCESS_KEY_ID` / `_SECRET_KEY` /
192
+ `_ACCOUNT_ID` env vars here — those arrive per request in the `Authorization` header.
160
193
 
161
194
  ```bash
162
- npx @modelcontextprotocol/inspector
163
- # Transport: Streamable HTTP
164
- # URL: https://api.rad.security/mcp/ (trailing slash)
165
- # Custom headers: { "Authorization": "Bearer <access_key_id>:<secret_key>:<account_id>" }
195
+ docker run \
196
+ -e TRANSPORT_TYPE=streamable \
197
+ -e MCP_AUTH_MODE=header \
198
+ -e RAD_SECURITY_API_URL=https://api.rad.security \
199
+ -p 3000:3000 \
200
+ rad-security/mcp-server
166
201
  ```
167
202
 
203
+ Callers then authenticate per request:
204
+
168
205
  ```bash
169
206
  curl -H "authorization: Bearer <access_key_id>:<secret_key>:<account_id>" \
170
207
  -H "content-type: application/json" \
171
208
  -H "accept: application/json, text/event-stream" \
172
- -X POST https://api.rad.security/mcp/ \
173
- -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"curl","version":"1"}}}'
209
+ -X POST http://localhost:3000/mcp -d '{...}'
174
210
  ```
175
211
 
176
- ### Scoping the tools an agent sees
177
-
178
- By default a connection gets every toolkit. To give an agent a smaller set — less context/token overhead, and least privilege — add a scoping header to that connection alongside `Authorization`. The subset is enforced: an out-of-scope tool is hidden from `tools/list` **and** rejected if called.
212
+ ### As a Docker Container - with SSE (deprecated)
179
213
 
180
- | Header | Effect |
181
- | --- | --- |
182
- | `X-Rad-Toolkits: findings, images` | only these toolkits |
183
- | `X-Rad-Exclude-Toolkits: workflows` | every toolkit except these |
184
- | `X-Rad-Readonly: true` | only read-only tools (drops the write tools) |
185
-
186
- Toolkits: `containers`, `clusters`, `audit`, `images`, `kubeobject`, `runtime`, `findings`, `inbox`, `workflows`, `knowledge_base`, `radql`, `dashboards`, `integrations` (plus `custom_workflows`, off by default).
187
-
188
- Example — a read-only findings/images agent (any client that supports headers; Cursor shown):
189
-
190
- ```json
191
- {
192
- "mcpServers": {
193
- "rad-security-findings": {
194
- "type": "http",
195
- "url": "https://api.rad.security/mcp/",
196
- "headers": {
197
- "Authorization": "Bearer <access_key_id>:<secret_key>:<account_id>",
198
- "X-Rad-Toolkits": "findings, images",
199
- "X-Rad-Readonly": "true"
200
- }
201
- }
202
- }
203
- }
204
- ```
205
-
206
- In Claude Code, pass an extra `--header`:
214
+ *Note:* The SSE transport is now deprecated in favor of Streamable HTTP. It's still supported for backward compatibility, but it's recommended to use Streamable HTTP instead.
207
215
 
208
216
  ```bash
209
- claude mcp add --transport http rad-security https://api.rad.security/mcp/ \
210
- --header "Authorization: Bearer <access_key_id>:<secret_key>:<account_id>" \
211
- --header "X-Rad-Toolkits: findings, images"
217
+ docker build -t rad-security/mcp-server .
218
+ docker run \
219
+ -e TRANSPORT_TYPE=sse \
220
+ -e RAD_SECURITY_ACCESS_KEY_ID=your_access_key \
221
+ -e RAD_SECURITY_SECRET_KEY=your_secret_key \
222
+ -e RAD_SECURITY_ACCOUNT_ID=your_account_id \
223
+ -p 3000:3000 \
224
+ rad-security/mcp-server
212
225
  ```
213
226
 
214
227
  ## Features
215
228
 
216
- All tools require authentication and an account in RAD Security. The hosted endpoint exposes every toolkit below except `custom_workflows` (workflow authoring), which is off by default.
229
+ All tools require authentication and an account in Rad Security.
217
230
 
218
231
  - Account Inventory
219
232
  - List clusters and their details
@@ -273,93 +286,6 @@ All tools require authentication and an account in RAD Security. The hosted endp
273
286
  - Build queries programmatically from structured conditions
274
287
  - Execute multiple queries in parallel
275
288
 
276
- ## Self-hosting
277
-
278
- Prefer to run the server yourself — for example an air-gapped environment, data-residency requirements, or if you don't want to route through the hosted gateway? It's published to npm and as a container image.
279
-
280
- ### Prerequisites
281
-
282
- - Node.js 20.x or higher
283
-
284
- ### Credentials
285
-
286
- Provide your RAD Security credentials via environment variables:
287
-
288
- ```bash
289
- RAD_SECURITY_ACCESS_KEY_ID="your_access_key"
290
- RAD_SECURITY_SECRET_KEY="your_secret_key"
291
- RAD_SECURITY_ACCOUNT_ID="your_account_id"
292
-
293
- # Optional: fetched automatically from the account if not set
294
- RAD_SECURITY_TENANT_ID="your_tenant_id"
295
- ```
296
-
297
- ### npx (stdio) — e.g. Claude Desktop
298
-
299
- ```json
300
- {
301
- "mcpServers": {
302
- "rad-security": {
303
- "command": "npx",
304
- "args": ["-y", "@rad-security/mcp-server"],
305
- "env": {
306
- "RAD_SECURITY_ACCESS_KEY_ID": "<your-access-key-id>",
307
- "RAD_SECURITY_SECRET_KEY": "<your-secret-key>",
308
- "RAD_SECURITY_ACCOUNT_ID": "<your-account-id>"
309
- }
310
- }
311
- }
312
- }
313
- ```
314
-
315
- ### Docker (Streamable HTTP)
316
-
317
- ```bash
318
- docker build -t rad-security/mcp-server .
319
- docker run \
320
- -e TRANSPORT_TYPE=streamable \
321
- -e RAD_SECURITY_ACCESS_KEY_ID=your_access_key \
322
- -e RAD_SECURITY_SECRET_KEY=your_secret_key \
323
- -e RAD_SECURITY_ACCOUNT_ID=your_account_id \
324
- -p 3000:3000 \
325
- rad-security/mcp-server
326
- ```
327
-
328
- ### Toolkit filtering
329
-
330
- Control which toolkits a self-hosted server exposes:
331
-
332
- - `INCLUDE_TOOLKITS`: comma-separated list of toolkits to include (only these are enabled).
333
- - `EXCLUDE_TOOLKITS`: comma-separated list of toolkits to exclude (all others are enabled). Ignored if `INCLUDE_TOOLKITS` is set.
334
-
335
- Available toolkits: `containers`, `clusters`, `audit`, `images`, `kubeobject`, `runtime`, `findings`, `inbox`, `workflows`, `custom_workflows` (disabled by default), `knowledge_base`, `radql`, `dashboards`, `integrations`.
336
-
337
- ```bash
338
- # Only the workflows toolkit
339
- INCLUDE_TOOLKITS="workflows"
340
-
341
- # Everything except runtime
342
- EXCLUDE_TOOLKITS="runtime"
343
- ```
344
-
345
- ### Multi-tenant (per-request auth)
346
-
347
- `MCP_AUTH_MODE` controls how a streamable HTTP deployment authenticates inbound requests — this is what the hosted endpoint uses:
348
-
349
- - `MCP_AUTH_MODE=env` (default) — every session uses the `RAD_SECURITY_*` environment credentials. Single-tenant, and **unauthenticated at the HTTP layer**, so it must not be reachable from untrusted networks.
350
- - `MCP_AUTH_MODE=header` — every request must carry its own credential in the `Authorization` header (the `Bearer <access_key_id>:<secret_key>:<account_id>` form above); a missing or malformed header is rejected with `401`. Only supported with `TRANSPORT_TYPE=streamable`. `RAD_SECURITY_API_URL` is taken from server config, not the caller.
351
-
352
- ```bash
353
- docker run \
354
- -e TRANSPORT_TYPE=streamable \
355
- -e MCP_AUTH_MODE=header \
356
- -e RAD_SECURITY_API_URL=https://api.rad.security \
357
- -p 3000:3000 \
358
- rad-security/mcp-server
359
- ```
360
-
361
- > The SSE transport (`TRANSPORT_TYPE=sse`) is deprecated in favor of Streamable HTTP and uses env credentials only.
362
-
363
289
  ## Development
364
290
 
365
291
  ```bash
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "0.0.36-5.g3825a61";
1
+ export declare const VERSION = "0.0.36";
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = "0.0.36-5.g3825a61";
1
+ export const VERSION = "0.0.36";
2
2
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,mBAAmB,CAAC"}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rad-security/mcp-server",
3
- "version": "0.0.36-5.g3825a61",
3
+ "version": "0.0.36",
4
4
  "description": "RAD Security MCP Server for AI-powered security insights",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",