You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+46Lines changed: 46 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,6 +21,9 @@ An MCP (Model Context Protocol) server that converts HTML content to Markdown fo
21
21
-[Local Development](#local-development)
22
22
-[Testing](#testing)
23
23
-[Publishing a New Version](#publishing-a-new-version)
24
+
-[Security](#security)
25
+
-[SSRF Protection](#ssrf-protection)
26
+
-[Allowing Local Network Access](#allowing-local-network-access)
24
27
-[Technical Details](#technical-details)
25
28
-[Related Projects](#related-projects)
26
29
-[License](#license)
@@ -33,6 +36,7 @@ An MCP (Model Context Protocol) server that converts HTML content to Markdown fo
33
36
- 🗑️ Automatically removes unwanted elements (scripts, styles, etc.)
34
37
- 📊 Auto-extracts page titles and metadata
35
38
- ⚡ Fast conversion using Turndown.js
39
+
- 🔒 **SSRF protection** - Blocks requests to private/internal networks by default
36
40
37
41
## Installation
38
42
@@ -351,6 +355,7 @@ The test suite includes:
351
355
- URL fetching tests
352
356
- File saving tests
353
357
- Truncation and large page handling tests
358
+
- SSRF protection tests
354
359
- Integration workflow tests
355
360
356
361
### Publishing a New Version
@@ -381,6 +386,47 @@ npm run release:minor --otp=<code>
381
386
npm run release:major --otp=<code>
382
387
```
383
388
389
+
## Security
390
+
391
+
### SSRF Protection
392
+
393
+
By default, the server blocks URL requests to private and internal network addresses to prevent [Server-Side Request Forgery (SSRF)](https://owasp.org/www-community/attacks/Server-Side_Request_Forgery) attacks. This includes:
DNS resolution is checked to prevent bypass via hostnames that resolve to private IPs.
401
+
402
+
### Allowing Local Network Access
403
+
404
+
If you need to convert HTML from local or internal servers (e.g., a local dev server), you can opt in with the `--allow-local` flag or the `ALLOW_LOCAL_NETWORK` environment variable:
405
+
406
+
```bash
407
+
# Via CLI flag
408
+
npx html-to-markdown-mcp --allow-local
409
+
```
410
+
411
+
```bash
412
+
# Via environment variable
413
+
ALLOW_LOCAL_NETWORK=true npx html-to-markdown-mcp
414
+
```
415
+
416
+
**Claude Desktop / Cursor configuration with local access:**
417
+
```json
418
+
{
419
+
"mcpServers": {
420
+
"html-to-markdown": {
421
+
"command": "npx",
422
+
"args": ["html-to-markdown-mcp", "--allow-local"]
423
+
}
424
+
}
425
+
}
426
+
```
427
+
428
+
> **Warning:** Only enable local network access if you trust the AI agent's URL inputs. With this flag enabled, the server can reach internal services, localhost ports, and cloud metadata endpoints.
0 commit comments