surendra-bishnoi29/Vulnerability-Scanner-MCP-Server
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.
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
-
Clone or download the project
git clone <repository-url> cd vulnerability-scanner-mcp
-
Install dependencies
npm install
-
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)
-
Install MCP Inspector:
npx @modelcontextprotocol/inspector
-
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:
- Automated Tests: Run
npm test
for full test suite - Manual Testing: Use MCP Inspector for interactive testing
- Error Handling: Dedicated error case testing
- 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 implementationzod
: Runtime type validationpdfkit
: PDF generationcore-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
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Ensure all tests pass:
npm run test:all
- 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:
- Check the for testing procedures
- Review for expected behavior
- Enable debug logging for detailed error information
- Create an issue with reproduction steps
Status: ā Production Ready - All tests passing, MCP protocol compliant