Skip to content

H4ck3r-netizen/apache-security-scan-mcp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Apache Security Scan MCP Server

CI Python >=3.10 License: Apache-2.0 MCP

A Model Context Protocol (MCP) server that enables LLM agents to scan domains and URLs for common security vulnerabilities. Wraps a self-contained security scanning engine that checks DNS resolution, HTTP security headers, TLS configuration, and commonly exposed sensitive paths.

Features

  • DNS Resolution — Verifies the target domain resolves to an IP address
  • HTTP Security Headers — Checks for HSTS, CSP, X-Frame-Options, X-Content-Type-Options, X-XSS-Protection, Referrer-Policy, and Server header disclosure
  • TLS Verification — Establishes a TLS connection and reports the protocol version and certificate expiry
  • Exposed Path Detection — Probes for commonly exposed sensitive paths (.env, .git/config, wp-admin, phpinfo.php, server-status, actuator, .DS_Store, backup.zip, admin, api/docs, swagger-ui.html)
  • In-Memory Result Cache — Scan results are cached so the full JSON report can be retrieved later via get_scan_report()

Installation

pip install apache-security-scan-mcp

Or install from source:

git clone https://github.com/H4ck3r-netizen/apache-security-scan-mcp.git
cd apache-security-scan-mcp
pip install -e .

Usage

As a CLI tool

apache-security-scan-mcp

With Claude Desktop / Cursor / any MCP client

Add the following to your MCP client configuration:

{
  "mcpServers": {
    "apache-security-scan": {
      "command": "apache-security-scan-mcp"
    }
  }
}

Or, if running from source:

{
  "mcpServers": {
    "apache-security-scan": {
      "command": "python3",
      "args": ["/full/path/to/src/mcp_scan_server.py"]
    }
  }
}

Tools

scan_url(url: str) -> str

Scan a URL or domain for security vulnerabilities.

Parameters:

Parameter Type Description
url str The URL or domain to scan (e.g. "example.com" or "https://example.com")

Returns: A formatted security scan report with findings grouped by severity, including a Scan ID for retrieving the raw JSON later.

Example output:

🔒 Security Scan Report for example.com
   Scan time: 2025-01-15T12:00:00+00:00
   Findings: 0 critical · 2 warnings · 0 errors · 5 passed · 3 info

   ℹ️ [INFO] DNS Resolution
      example.com resolves to 93.184.216.34
   🟢 [GOOD] ✓ Strict-Transport-Security
      HSTS: max-age=31536000
   🟡 [WARNING] ✗ Missing: Content-Security-Policy
      CSP header is missing

   Scan ID: a1b2c3d4e5f6g7h8
   Use get_scan_report() with this ID for the raw JSON report.

get_scan_report(scan_id: str) -> str

Retrieve the full JSON scan report for a previously run scan.

Parameters:

Parameter Type Description
scan_id str The Scan ID returned by a prior scan_url() call

Returns: The complete scan report as pretty-printed JSON, or an error message if the ID is not found.

Note: The cache is in-memory only — the scan must have been run in the same server session.

health_check() -> str

Check that the MCP Scan Server is running and ready.

Returns: A JSON status message confirming server health, version, and available tools.

Example output:

{
  "status": "ok",
  "service": "apache-security-scan-mcp",
  "version": "1.0.0",
  "tools": ["scan_url", "get_scan_report", "health_check"]
}

Development

Running tests

pip install pytest
pytest tests/ -v

Project structure

apache-security-scan-mcp/
├── pyproject.toml
├── README.md
├── src/
│   └── mcp_scan_server.py    # Main MCP server implementation
├── tests/
│   └── test_server.py        # Unit tests
└── .github/
    └── workflows/
        └── ci.yml            # CI pipeline

License

This project is licensed under the Apache License 2.0.

About

MCP server for scanning domains for security vulnerabilities — DNS, headers, TLS, exposed paths. Free tier: 100 scans/month.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages