Vulnerability-Scanner-MCP-Server

surendra-bishnoi29/Vulnerability-Scanner-MCP-Server

3.2

If you are the rightful owner of Vulnerability-Scanner-MCP-Server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

The Vulnerability Scanner MCP Server is a tool designed to provide on-demand vulnerability scanning for software projects, automatically detecting project ecosystems, running security checks, and generating comprehensive reports.

Tools
  1. runFullScanAndGenerateReport

    Performs a complete vulnerability scan on a project directory.

Vulnerability Scanner MCP Server

A Model Context Protocol (MCP) server that provides on-demand vulnerability scanning capabilities for software projects. This server automatically detects project ecosystems, runs security checks, and generates comprehensive reports in HTML or PDF format.

Features

  • šŸ” Automated Vulnerability Scanning: Detects and analyzes security vulnerabilities in your projects
  • šŸŽÆ Ecosystem Detection: Automatically identifies project types (Node.js, Python, etc.)
  • šŸ“Š Multiple Report Formats: Generate reports in HTML or PDF format
  • šŸŽØ Professional Reports: Lighthouse-style HTML reports with visual metrics
  • šŸ”Œ MCP Compatible: Works with any MCP-compatible client (Claude Desktop, etc.)
  • ⚔ Fast & Efficient: Optimized for quick scanning and reporting
  • šŸ›”ļø Secure: Input validation and error handling built-in

Installation

Prerequisites

  • Node.js 18+
  • npm or yarn

Setup

  1. Clone or download the project

    git clone <repository-url>
    cd vulnerability-scanner-mcp
    
  2. Install dependencies

    npm install
    
  3. Build the server

    npm run build
    

Usage

As an MCP Server

With Claude Desktop

Add to your Claude Desktop MCP configuration:

{
  "mcpServers": {
    "vulnerability-scanner": {
      "command": "node",
      "args": ["/path/to/vulnerability-scanner-mcp/dist/server.js"],
      "env": {}
    }
  }
}
With MCP Inspector (for testing)
  1. Install MCP Inspector:

    npx @modelcontextprotocol/inspector
    
  2. Configure connection:

    • Transport Type: STDIO
    • Command: node
    • Arguments: /path/to/vulnerability-scanner-mcp/dist/server.js

Available Tools

runFullScanAndGenerateReport

Performs a complete vulnerability scan on a project directory.

Parameters:

  • projectPath (optional): Absolute path to project directory. Defaults to current working directory.
  • reportFormat (optional): Report format - "html" or "pdf". If omitted, returns JSON summary only.

Examples:

// Basic scan (JSON summary only)
{
  "name": "runFullScanAndGenerateReport",
  "arguments": {}
}

// Scan with HTML report
{
  "name": "runFullScanAndGenerateReport", 
  "arguments": {
    "reportFormat": "html"
  }
}

// Scan specific directory with PDF report
{
  "name": "runFullScanAndGenerateReport",
  "arguments": {
    "projectPath": "/path/to/project",
    "reportFormat": "pdf"
  }
}

Response Format:

{
  "content": [{
    "type": "text",
    "text": "{\"summary\":\"Scan complete. Found 19 vulnerabilities across 2 ecosystem(s).\",\"reportFilePath\":\"/tmp/security-report-123.html\",\"scanResults\":[...]}"
  }]
}

Development

Scripts

# Build the project
npm run build

# Start the server
npm start

# Development mode with auto-rebuild
npm run dev

# Run tests
npm test

# Run error handling tests
npm run test:errors

# Run all tests
npm run test:all

Project Structure

vulnerability-scanner-mcp/
ā”œā”€ā”€ src/
│   └── server.ts              # Main MCP server implementation
ā”œā”€ā”€ dist/                      # Built JavaScript files
ā”œā”€ā”€ test-mcp-server.js         # Comprehensive test suite
ā”œā”€ā”€ test-error-cases.js        # Error handling tests
ā”œā”€ā”€ manual-vulnerability-scan.js # Manual testing script
ā”œā”€ā”€ TESTING_GUIDE.md           # Detailed testing instructions
ā”œā”€ā”€ TEST_RESULTS.md            # Test results and validation
ā”œā”€ā”€ package.json               # Dependencies and scripts
ā”œā”€ā”€ tsconfig.json              # TypeScript configuration
└── tsup.config.ts             # Build configuration

Testing

The project includes comprehensive testing:

  1. Automated Tests: Run npm test for full test suite
  2. Manual Testing: Use MCP Inspector for interactive testing
  3. Error Handling: Dedicated error case testing
  4. Integration Testing: Real MCP protocol compliance testing

See for detailed testing instructions.

Report Formats

HTML Reports

Professional Lighthouse-style reports featuring:

  • šŸ“Š Visual vulnerability metrics with circular progress indicators
  • šŸŽØ Color-coded severity levels (Critical, High, Moderate, Low)
  • šŸ“ˆ Summary statistics and risk scoring
  • šŸ¤– AI-powered security analysis
  • šŸ“± Responsive design for all devices

PDF Reports

Clean, printable reports with:

  • šŸ“„ Executive summary
  • šŸ“‹ Detailed vulnerability listings
  • šŸ·ļø Severity classifications
  • šŸ“Š Statistical overview

Architecture

Core Components

  • MCP Server: Handles protocol communication and tool registration
  • Vulnerability Engine: Performs actual security scanning (via core-engine)
  • Report Generator: Creates HTML and PDF reports
  • Input Validation: Zod-based parameter validation

Dependencies

  • @modelcontextprotocol/sdk: MCP protocol implementation
  • zod: Runtime type validation
  • pdfkit: PDF generation
  • core-engine: Vulnerability scanning engine

Security

  • āœ… Input validation with Zod schemas
  • āœ… Enum validation for report formats
  • āœ… Path sanitization for project directories
  • āœ… Error handling without information leakage
  • āœ… No code injection vulnerabilities

Error Handling

The server provides robust error handling:

  • Invalid Parameters: Proper validation error messages
  • Missing Dependencies: Clear dependency error reporting
  • File System Errors: Graceful handling of permission issues
  • Timeout Handling: Prevents hanging operations

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests for new functionality
  5. Ensure all tests pass: npm run test:all
  6. Submit a pull request

Troubleshooting

Common Issues

Server won't start:

  • Ensure Node.js 18+ is installed
  • Run npm run build first
  • Check for port conflicts

Tool not found in MCP client:

  • Verify server path in MCP configuration
  • Check server logs for initialization errors
  • Ensure proper MCP protocol version

Scan failures:

  • Verify project directory exists and is readable
  • Check for required ecosystem files (package.json, requirements.txt, etc.)
  • Review server logs for detailed error messages

Debug Mode

Enable debug logging:

DEBUG=* npm start

License

ISC License

Support

For issues and questions:

  1. Check the for testing procedures
  2. Review for expected behavior
  3. Enable debug logging for detailed error information
  4. Create an issue with reproduction steps

Status: āœ… Production Ready - All tests passing, MCP protocol compliant