mpx-scan 1.0.2 โ 1.2.1
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 +152 -94
- package/bin/cli.js +241 -58
- package/package.json +7 -2
- package/src/index.js +1 -1
- package/src/mcp.js +260 -0
- package/src/scanners/cookies.js +13 -1
- package/src/scanners/exposed-files.js +1 -1
- package/src/scanners/fingerprint.js +9 -2
- package/src/scanners/headers.js +72 -46
- package/src/scanners/redirects.js +1 -1
- package/src/scanners/server.js +16 -5
- package/src/scanners/sri.js +1 -1
- package/src/schema.js +198 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# mpx-scan ๐
|
|
2
2
|
|
|
3
|
-
**Professional website security scanner for developers**
|
|
3
|
+
**Professional website security scanner for developers and AI agents**
|
|
4
4
|
|
|
5
5
|
Check your site's security headers, SSL/TLS configuration, DNS settings, and get actionable fix suggestions โ all from your terminal.
|
|
6
6
|
|
|
@@ -13,10 +13,14 @@ Part of the [Mesaplex](https://mesaplex.com) developer toolchain.
|
|
|
13
13
|
|
|
14
14
|
- **Zero-config security scanning** โ just point it at a URL
|
|
15
15
|
- **Beautiful terminal output** with color-coded results
|
|
16
|
+
- **Structured JSON output** โ `--json` for CI/CD and AI agent consumption
|
|
17
|
+
- **MCP server** โ integrates with any MCP-compatible AI agent (Claude, GPT, Cursor, etc.)
|
|
16
18
|
- **Actionable fix suggestions** โ copy-paste config for nginx, Apache, Caddy, Cloudflare
|
|
19
|
+
- **Batch scanning** โ pipe URLs from stdin
|
|
20
|
+
- **Self-documenting** โ `--schema` returns machine-readable tool description
|
|
17
21
|
- **Fast** โ scans complete in seconds
|
|
18
22
|
- **Zero native dependencies** โ installs cleanly everywhere
|
|
19
|
-
- **CI/CD ready** โ
|
|
23
|
+
- **CI/CD ready** โ predictable exit codes and JSON output
|
|
20
24
|
|
|
21
25
|
### Security Checks
|
|
22
26
|
|
|
@@ -50,40 +54,20 @@ mpx-scan https://example.com
|
|
|
50
54
|
mpx-scan https://example.com
|
|
51
55
|
```
|
|
52
56
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
### Get Fix Suggestions
|
|
56
|
-
|
|
57
|
-
```bash
|
|
58
|
-
mpx-scan https://example.com --fix nginx
|
|
59
|
-
mpx-scan https://example.com --fix apache
|
|
60
|
-
mpx-scan https://example.com --fix caddy
|
|
61
|
-
mpx-scan https://example.com --fix cloudflare
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
Generates copy-paste configuration snippets for your platform.
|
|
65
|
-
|
|
66
|
-
### Deep Scan (Pro)
|
|
67
|
-
|
|
68
|
-
```bash
|
|
69
|
-
mpx-scan https://example.com --full
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
Runs all security checks including DNS, cookies, SRI, exposed files.
|
|
73
|
-
|
|
74
|
-
### JSON Output (Pro)
|
|
57
|
+
### JSON Output
|
|
75
58
|
|
|
76
59
|
```bash
|
|
77
60
|
mpx-scan https://example.com --json
|
|
78
61
|
```
|
|
79
62
|
|
|
80
|
-
|
|
63
|
+
Returns structured JSON to stdout (progress/status goes to stderr):
|
|
81
64
|
|
|
82
65
|
```json
|
|
83
66
|
{
|
|
84
67
|
"mpxScan": {
|
|
85
|
-
"version": "1.
|
|
86
|
-
"scannedAt": "2026-02-
|
|
68
|
+
"version": "1.1.0",
|
|
69
|
+
"scannedAt": "2026-02-16T22:00:00.000Z",
|
|
70
|
+
"scanDuration": 350
|
|
87
71
|
},
|
|
88
72
|
"target": {
|
|
89
73
|
"url": "https://example.com",
|
|
@@ -98,28 +82,123 @@ Perfect for CI/CD pipelines:
|
|
|
98
82
|
"summary": {
|
|
99
83
|
"passed": 12,
|
|
100
84
|
"warnings": 3,
|
|
101
|
-
"failed": 2
|
|
102
|
-
|
|
85
|
+
"failed": 2,
|
|
86
|
+
"info": 0
|
|
87
|
+
},
|
|
88
|
+
"sections": { ... },
|
|
89
|
+
"tier": "free"
|
|
103
90
|
}
|
|
104
91
|
```
|
|
105
92
|
|
|
93
|
+
### Get Fix Suggestions
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
mpx-scan https://example.com --fix nginx
|
|
97
|
+
mpx-scan https://example.com --fix apache
|
|
98
|
+
mpx-scan https://example.com --fix caddy
|
|
99
|
+
mpx-scan https://example.com --fix cloudflare
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Deep Scan (Pro)
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
mpx-scan https://example.com --full
|
|
106
|
+
```
|
|
107
|
+
|
|
106
108
|
### Brief Output
|
|
107
109
|
|
|
108
110
|
```bash
|
|
109
111
|
mpx-scan https://example.com --brief
|
|
110
112
|
```
|
|
111
113
|
|
|
112
|
-
|
|
114
|
+
### Batch Scanning
|
|
113
115
|
|
|
114
|
-
|
|
116
|
+
```bash
|
|
117
|
+
cat urls.txt | mpx-scan --batch --json
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Reads one URL per line from stdin, outputs one JSON result per line (JSONL format). Lines starting with `#` are ignored.
|
|
121
|
+
|
|
122
|
+
### Tool Schema
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
mpx-scan --schema
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Returns a JSON schema describing all commands, flags, inputs, and outputs โ designed for AI agent tool discovery.
|
|
129
|
+
|
|
130
|
+
## ๐ค AI Agent Usage
|
|
131
|
+
|
|
132
|
+
mpx-scan is designed to be used by AI agents as well as humans.
|
|
133
|
+
|
|
134
|
+
### MCP Integration
|
|
135
|
+
|
|
136
|
+
Add to your MCP client configuration (Claude Desktop, Cursor, Windsurf, etc.):
|
|
115
137
|
|
|
116
|
-
|
|
138
|
+
```json
|
|
139
|
+
{
|
|
140
|
+
"mcpServers": {
|
|
141
|
+
"mpx-scan": {
|
|
142
|
+
"command": "npx",
|
|
143
|
+
"args": ["mpx-scan", "mcp"]
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
The MCP server exposes these tools:
|
|
150
|
+
- **`scan`** โ Scan a URL and return structured results
|
|
151
|
+
- **`generate_fixes`** โ Scan and generate platform-specific fix config
|
|
152
|
+
- **`get_schema`** โ Get full tool schema
|
|
153
|
+
|
|
154
|
+
### Programmatic Usage
|
|
117
155
|
|
|
118
156
|
```bash
|
|
119
|
-
|
|
157
|
+
# JSON output for parsing
|
|
158
|
+
mpx-scan https://example.com --json
|
|
159
|
+
|
|
160
|
+
# Batch processing
|
|
161
|
+
cat urls.txt | mpx-scan --batch --json
|
|
162
|
+
|
|
163
|
+
# Schema discovery
|
|
164
|
+
mpx-scan --schema
|
|
165
|
+
|
|
166
|
+
# Quiet mode (no banners, progress goes to stderr)
|
|
167
|
+
mpx-scan https://example.com --json --quiet
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### Exit Codes
|
|
171
|
+
|
|
172
|
+
| Code | Meaning |
|
|
173
|
+
|------|---------|
|
|
174
|
+
| 0 | Scan complete, no security issues found |
|
|
175
|
+
| 1 | Scan complete, security issues found |
|
|
176
|
+
| 2 | Invalid arguments |
|
|
177
|
+
| 3 | Configuration error (license, rate limit) |
|
|
178
|
+
| 4 | Network/connectivity error |
|
|
179
|
+
|
|
180
|
+
### Error Responses (JSON mode)
|
|
181
|
+
|
|
182
|
+
When `--json` is used, errors return structured JSON:
|
|
183
|
+
|
|
184
|
+
```json
|
|
185
|
+
{
|
|
186
|
+
"error": "Description of what went wrong",
|
|
187
|
+
"code": "ERR_NETWORK"
|
|
188
|
+
}
|
|
120
189
|
```
|
|
121
190
|
|
|
122
|
-
|
|
191
|
+
Error codes: `ERR_NETWORK`, `ERR_SCAN`, `ERR_RATE_LIMIT`, `ERR_PRO_REQUIRED`, `ERR_NO_INPUT`
|
|
192
|
+
|
|
193
|
+
### Automation Tips
|
|
194
|
+
|
|
195
|
+
- Use `--json` for machine-parseable output (stdout only, no ANSI)
|
|
196
|
+
- Use `--no-color` to strip ANSI codes from human-readable output
|
|
197
|
+
- Use `--quiet` to suppress banners and progress info
|
|
198
|
+
- Pipe `--batch --json` for JSONL (one result per line) processing
|
|
199
|
+
- Check exit codes for pass/fail decisions in CI/CD
|
|
200
|
+
|
|
201
|
+
## ๐ฏ Use Cases
|
|
123
202
|
|
|
124
203
|
### CI/CD Integration
|
|
125
204
|
|
|
@@ -131,14 +210,17 @@ jobs:
|
|
|
131
210
|
scan:
|
|
132
211
|
runs-on: ubuntu-latest
|
|
133
212
|
steps:
|
|
134
|
-
- run: npx mpx-scan https://mysite.com --json
|
|
213
|
+
- run: npx mpx-scan https://mysite.com --ci --min-score 70 --json
|
|
135
214
|
```
|
|
136
215
|
|
|
137
|
-
###
|
|
216
|
+
### Monitoring Script
|
|
138
217
|
|
|
139
218
|
```bash
|
|
219
|
+
#!/bin/bash
|
|
140
220
|
for site in site1.com site2.com site3.com; do
|
|
141
|
-
mpx-scan $site --json
|
|
221
|
+
result=$(npx mpx-scan "$site" --json 2>/dev/null)
|
|
222
|
+
grade=$(echo "$result" | jq -r '.score.grade')
|
|
223
|
+
echo "$site: $grade"
|
|
142
224
|
done
|
|
143
225
|
```
|
|
144
226
|
|
|
@@ -150,38 +232,27 @@ done
|
|
|
150
232
|
| **Security headers** | โ
| โ
|
|
|
151
233
|
| **SSL/TLS checks** | โ
| โ
|
|
|
152
234
|
| **Server info checks** | โ
| โ
|
|
|
235
|
+
| **JSON output** | โ
| โ
|
|
|
236
|
+
| **Batch scanning** | โ
| โ
|
|
|
237
|
+
| **MCP server** | โ
| โ
|
|
|
153
238
|
| **DNS security** | โ | โ
|
|
|
154
239
|
| **Cookie security** | โ | โ
|
|
|
155
240
|
| **SRI checks** | โ | โ
|
|
|
156
241
|
| **Exposed files** | โ | โ
|
|
|
157
242
|
| **Mixed content** | โ | โ
|
|
|
158
|
-
| **
|
|
159
|
-
| **Batch scanning** | โ | โ
|
|
|
160
|
-
| **CI/CD integration** | โ | โ
|
|
|
243
|
+
| **Full scan (--full)** | โ | โ
|
|
|
161
244
|
|
|
162
245
|
**Upgrade to Pro:** [https://mesaplex.com/mpx-scan](https://mesaplex.com/mpx-scan)
|
|
163
246
|
|
|
164
247
|
## ๐ License Management
|
|
165
248
|
|
|
166
|
-
### Check License Status
|
|
167
|
-
|
|
168
|
-
```bash
|
|
169
|
-
mpx-scan license
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
### Activate Pro License
|
|
173
|
-
|
|
174
|
-
```bash
|
|
175
|
-
mpx-scan activate MPX-PRO-XXXXXXXXXXXXXXXX
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
### Deactivate
|
|
179
|
-
|
|
180
249
|
```bash
|
|
181
|
-
mpx-scan
|
|
250
|
+
mpx-scan license # Check status
|
|
251
|
+
mpx-scan activate MPX-PRO-XXXXXXXX # Activate Pro
|
|
252
|
+
mpx-scan deactivate # Return to free tier
|
|
182
253
|
```
|
|
183
254
|
|
|
184
|
-
## ๐ ๏ธ CLI
|
|
255
|
+
## ๐ ๏ธ CLI Reference
|
|
185
256
|
|
|
186
257
|
```
|
|
187
258
|
Usage: mpx-scan [url] [options]
|
|
@@ -190,48 +261,44 @@ Arguments:
|
|
|
190
261
|
url URL to scan
|
|
191
262
|
|
|
192
263
|
Options:
|
|
193
|
-
-V, --version
|
|
264
|
+
-V, --version Output version number
|
|
265
|
+
--json Output as structured JSON
|
|
194
266
|
--full Run all checks (Pro only)
|
|
195
|
-
--
|
|
196
|
-
--
|
|
267
|
+
--brief Brief one-line output
|
|
268
|
+
--quiet, -q Minimal output (no banners)
|
|
269
|
+
--no-color Disable ANSI color codes
|
|
270
|
+
--batch Read URLs from stdin (one per line)
|
|
271
|
+
--schema Output JSON schema for tool discovery
|
|
197
272
|
--fix <platform> Generate fix config (nginx, apache, caddy, cloudflare)
|
|
198
|
-
--timeout <seconds> Connection timeout (default:
|
|
199
|
-
|
|
273
|
+
--timeout <seconds> Connection timeout (default: 10)
|
|
274
|
+
--ci CI mode: exit 1 if below --min-score
|
|
275
|
+
--min-score <score> Minimum score for CI mode (default: 70)
|
|
276
|
+
-h, --help Display help
|
|
200
277
|
|
|
201
278
|
Commands:
|
|
202
|
-
license
|
|
203
|
-
activate <key> Activate
|
|
204
|
-
deactivate
|
|
279
|
+
license Show license status
|
|
280
|
+
activate <key> Activate Pro license
|
|
281
|
+
deactivate Return to free tier
|
|
282
|
+
mcp Start MCP stdio server
|
|
205
283
|
```
|
|
206
284
|
|
|
207
285
|
## ๐ฆ Installation
|
|
208
286
|
|
|
209
|
-
### Global Install
|
|
210
|
-
|
|
211
287
|
```bash
|
|
288
|
+
# Global
|
|
212
289
|
npm install -g mpx-scan
|
|
213
|
-
```
|
|
214
|
-
|
|
215
|
-
### Project Dependency
|
|
216
290
|
|
|
217
|
-
|
|
291
|
+
# Project dependency
|
|
218
292
|
npm install --save-dev mpx-scan
|
|
219
|
-
```
|
|
220
|
-
|
|
221
|
-
Add to `package.json`:
|
|
222
293
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
"scripts": {
|
|
226
|
-
"security": "mpx-scan https://mysite.com"
|
|
227
|
-
}
|
|
228
|
-
}
|
|
294
|
+
# One-off with npx
|
|
295
|
+
npx mpx-scan https://example.com
|
|
229
296
|
```
|
|
230
297
|
|
|
231
298
|
### Requirements
|
|
232
299
|
|
|
233
300
|
- Node.js 18.0.0 or higher
|
|
234
|
-
- No
|
|
301
|
+
- No native dependencies
|
|
235
302
|
- Works on macOS, Linux, Windows
|
|
236
303
|
|
|
237
304
|
## ๐งช Testing
|
|
@@ -240,11 +307,9 @@ Add to `package.json`:
|
|
|
240
307
|
npm test
|
|
241
308
|
```
|
|
242
309
|
|
|
243
|
-
Runs the built-in test suite for core scanning logic.
|
|
244
|
-
|
|
245
310
|
## ๐ค Contributing
|
|
246
311
|
|
|
247
|
-
|
|
312
|
+
Security improvements and bug fixes are welcome!
|
|
248
313
|
|
|
249
314
|
## ๐ License
|
|
250
315
|
|
|
@@ -255,22 +320,15 @@ See [LICENSE](LICENSE) for full terms.
|
|
|
255
320
|
## ๐ Links
|
|
256
321
|
|
|
257
322
|
- **Website:** [https://mesaplex.com/mpx-scan](https://mesaplex.com/mpx-scan)
|
|
258
|
-
- **
|
|
323
|
+
- **npm:** [https://www.npmjs.com/package/mpx-scan](https://www.npmjs.com/package/mpx-scan)
|
|
324
|
+
- **GitHub:** [https://github.com/mesaplexdev/mpx-scan](https://github.com/mesaplexdev/mpx-scan)
|
|
259
325
|
- **Support:** support@mesaplex.com
|
|
260
|
-
- **Twitter:** [@mesaplex](https://twitter.com/mesaplex)
|
|
261
|
-
|
|
262
|
-
## ๐ Known Issues
|
|
263
|
-
|
|
264
|
-
None currently! Report issues via email: support@mesaplex.com
|
|
265
326
|
|
|
266
327
|
## ๐ Related Tools
|
|
267
328
|
|
|
268
|
-
Part of the Mesaplex developer toolchain:
|
|
269
|
-
|
|
270
329
|
- **mpx-scan** โ Security scanner (you are here)
|
|
271
|
-
- **mpx-api** โ API testing toolkit
|
|
272
|
-
- **mpx-
|
|
273
|
-
- **mpx-deploy** โ Deployment automation *(coming soon)*
|
|
330
|
+
- **[mpx-api](https://www.npmjs.com/package/mpx-api)** โ API testing toolkit
|
|
331
|
+
- **[mpx-db](https://www.npmjs.com/package/mpx-db)** โ Database toolkit
|
|
274
332
|
|
|
275
333
|
---
|
|
276
334
|
|