@attackforge/mcp-server 0.3.2 → 0.3.4

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
@@ -16,7 +16,8 @@ The server requires the following environment variables:
16
16
  |----------|----------|-------------|
17
17
  | `AF_HOSTNAME` | Yes | Your AttackForge server hostname (e.g., `your-instance.attackforge.com`) |
18
18
  | `AF_USER_KEY` | Yes | Your AttackForge API user key for authentication |
19
- | `AF_PORT` | No | Custom port if your AttackForge server uses a non-standard HTTPS port |
19
+ | `AF_PORT` | No | Custom port if your AttackForge server does not listen on the protocol's standard port |
20
+ | `AF_PROTOCOL` | No | `https` (default) or `http`. `http` sends your API key unencrypted and is intended only for a local development instance |
20
21
  | `AF_TIMEOUT_MS` | No | How long to wait on an AttackForge request before giving up (default `60000`) |
21
22
 
22
23
  ## Usage
@@ -67,6 +68,8 @@ This MCP server implements the [Model Context Protocol](https://modelcontextprot
67
68
  3. When the client calls a tool, the server forwards the request to `https://{AF_HOSTNAME}/mcp/tools/call`
68
69
  4. All requests are authenticated using the `x-user-key` header
69
70
 
71
+ Requests go over HTTPS unless `AF_PROTOCOL=http` is set.
72
+
70
73
  The tools available are determined by your AttackForge instance configuration and the permissions of the user whose key is configured.
71
74
 
72
75
  ### Protocol versions
@@ -120,7 +123,7 @@ npm run test:integration
120
123
 
121
124
  The tests are TypeScript run directly by Node, which needs Node.js 22.18 or later.
122
125
 
123
- Integration tests read `AF_HOSTNAME`, `AF_USER_KEY` and optionally `AF_PORT` and `AF_TIMEOUT_MS` from a gitignored `.env.integration` - copy `.env.integration.example` to start. They are skipped when those are not set, and are read-only unless `AF_TEST_ALLOW_WRITES=true`, which creates a tagged testsuite per protocol era on each run.
126
+ Integration tests read `AF_HOSTNAME`, `AF_USER_KEY` and optionally `AF_PORT`, `AF_PROTOCOL` and `AF_TIMEOUT_MS` from a gitignored `.env.integration` - copy `.env.integration.example` to start. They are skipped when those are not set, and are read-only unless `AF_TEST_ALLOW_WRITES=true`, which creates a tagged testsuite per protocol era on each run.
124
127
 
125
128
  ## Requirements
126
129
 
package/dist/index.js CHANGED
@@ -8,6 +8,11 @@ if (!process.env.AF_HOSTNAME) {
8
8
  if (!process.env.AF_USER_KEY) {
9
9
  throw new Error('Environment variable AF_USER_KEY is required');
10
10
  }
11
+ // http sends AF_USER_KEY unencrypted, so it is opt-in and never inferred.
12
+ const protocol = process.env.AF_PROTOCOL || 'https';
13
+ if (protocol !== 'http' && protocol !== 'https') {
14
+ throw new Error('Environment variable AF_PROTOCOL must be http or https');
15
+ }
11
16
  const DEFAULT_TIMEOUT_MS = 60_000;
12
17
  let packageJson;
13
18
  try {
@@ -37,7 +42,7 @@ function describeFailure(status, body) {
37
42
  }
38
43
  }
39
44
  async function forward(path, request) {
40
- const url = new URL(path, `https://${process.env.AF_HOSTNAME}`);
45
+ const url = new URL(path, `${protocol}://${process.env.AF_HOSTNAME}`);
41
46
  if (process.env.AF_PORT) {
42
47
  url.port = process.env.AF_PORT;
43
48
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@attackforge/mcp-server",
3
- "version": "0.3.2",
3
+ "version": "0.3.4",
4
4
  "description": "AttackForge MCP Server",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -11,7 +11,7 @@
11
11
  "dist"
12
12
  ],
13
13
  "scripts": {
14
- "build": "tsc && shx chmod +x dist/index.js",
14
+ "build": "tsc && chmod +x dist/index.js",
15
15
  "clean": "rm -rf dist",
16
16
  "prepare": "npm run rebuild",
17
17
  "rebuild": "npm run clean && npm run build",
@@ -24,13 +24,12 @@
24
24
  "node": ">=22"
25
25
  },
26
26
  "devDependencies": {
27
- "@modelcontextprotocol/client": "^2.2.0",
27
+ "@modelcontextprotocol/client": "^2.3.0",
28
28
  "@tsconfig/node22": "^22.0.6",
29
- "@types/node": "^22.20.4",
30
- "shx": "^0.4.0",
29
+ "@types/node": "^22.20.5",
31
30
  "typescript": "^6.0.2"
32
31
  },
33
32
  "dependencies": {
34
- "@modelcontextprotocol/server": "^2.2.0"
33
+ "@modelcontextprotocol/server": "^2.3.0"
35
34
  }
36
35
  }