The Adversary MCP Server is an enterprise-grade security analysis tool that combines AI-powered vulnerability detection with Semgrep static analysis and Git diff-aware scanning for intelligent code security. It performs comprehensive security scans on files, folders, or codebases, leveraging OpenAI and Anthropic LLMs for context-aware vulnerability detection with confidence scoring and false positive filtering. Key capabilities include Git diff-aware scans for efficient CI/CD pipelines, proof-of-concept exploit generation, false positive management by UUID, and optimization for large codebases through parallel processing and intelligent file filtering. Results are output in both human-readable text and structured JSON formats, with seamless integration for Cursor IDE and command-line interfaces, ensuring security coverage aligned with industry standards like OWASP Top 10 and CWE.
Offers security analysis for JavaScript code, detecting vulnerabilities like DOM-based XSS, code injection, and prototype pollution through AST parsing.
Optional integration for enhanced exploit generation, allowing the MCP server to use OpenAI GPT models to create more sophisticated educational security exploit examples.
Integrates OWASP security guidelines and references for vulnerability classifications and remediation advice, mapping detected issues to OWASP Top 10 categories.
Provides vulnerability detection and analysis for Python code, including AST-based parsing to identify SQL injection, command injection, unsafe deserialization, and other Python-specific security issues.
Detects SQL injection vulnerabilities specific to SQLite database interactions in application code.
Enables security scanning of TypeScript code to identify vulnerabilities like DOM-based XSS, code injection, and other TypeScript-specific security concerns.
Adversary MCP Server
🔒 Enterprise-grade security analysis with AI-powered vulnerability detection and validation
We think about your vulns so you don't have to.
Installation • Quick Start • Cursor Setup • CLI Usage • MCP Tools • Architecture
Features
- 🤖 AI-Powered Analysis - OpenAI/Anthropic LLM integration for intelligent vulnerability detection.
- 🎯 Smart Validation - Reduces false positives with LLM validation
- 🔍 Multi-Engine Scanning - Combines Semgrep static analysis & AI analysis
- 📊 Interactive Dashboard - Rich web-based telemetry with Chart.js visualizations and comprehensive analytics
- 🚀 Git Diff Scanning - Analyze only changed code for faster CI/CD integration
- 📦 Monorepo Ready - Optimized for large codebases with batch processing
- 📈 Performance Telemetry - Automatic tracking of all operations with SQLAlchemy backend
Installation
Prerequisites
Quick Install
Verify Installation
Quick Start
1. Configure Security Engine
2. Run Your First Scan
Cursor IDE Setup
Configure MCP Server
Create .cursor/mcp.json
in your project:
Using pip installation:
For development:
Using MCP Tools in Cursor
Once configured, these tools are available in Cursor's chat:
- Ask Cursor: "Scan this file for security issues using adv_scan_file"
- Ask Cursor: "Check for vulnerabilities in the current project with adv_scan_folder"
- Ask Cursor: "Show me security issues in recent changes using adv_diff_scan"
CLI Usage
Basic Commands
Scanning Examples
Dashboard Commands
Advanced Options
MCP Tools
Available Tools
Tool | Description | Example Usage |
---|---|---|
adv_scan_code | Scan code snippets | "Scan this code for vulnerabilities" |
adv_scan_file | Scan specific files | "Check security issues in auth.py" |
adv_scan_folder | Scan directories | "Analyze the src folder for vulnerabilities" |
adv_diff_scan | Scan git changes | "Show security issues in recent commits" |
adv_configure_settings | Update configuration | "Configure OpenAI for security scanning" |
adv_get_status | Check server status | "Is the security scanner configured?" |
adv_mark_false_positive | Mark false positives | "Mark finding XYZ as false positive" |
MCP Tool Examples
Dashboard & Telemetry
Comprehensive HTML Dashboard
The scanner includes a rich web-based dashboard for comprehensive telemetry analysis:
Dashboard Features:
- 📊 Interactive Charts - Real-time performance metrics with Chart.js visualizations
- 🔍 MCP Tool Analytics - Track tool usage, success rates, and performance across Cursor IDE
- ⚡ Scan Engine Metrics - Monitor Semgrep, LLM, and validation performance
- 💾 Cache Performance - Analyze cache hit rates and efficiency
- 🎯 Threat Analysis - Categorize findings by severity and confidence
- 🏥 System Health - CPU, memory, and database performance monitoring
- 📈 Language Performance - Track scanning efficiency by programming language
- 🕒 Recent Activity - Timeline view of recent scans and operations
Performance Metrics
Include --include-stats
to see detailed metrics:
Telemetry System
Adversary MCP Server includes comprehensive telemetry tracking:
- Automatic Collection - All MCP tools, CLI commands, and scan operations are automatically tracked
- SQLAlchemy Backend - Production-quality database with rich query capabilities
- Zero Configuration - Telemetry works out-of-the-box with no setup required
- Privacy First - All data stored locally, never transmitted to external services
- Performance Insights - Identify bottlenecks and optimize scanning workflows
- Usage Analytics - Understand tool usage patterns and effectiveness
Architecture
How It Works
- Multi-Engine Scanning: Combines Semgrep rules with LLM analysis
- Intelligent Validation: LLM validator reduces false positives
- Batch Processing: Optimizes API calls for large codebases
- Git Integration: Focuses on changed code for faster CI/CD
- Comprehensive Telemetry: Automatic performance tracking with SQLAlchemy backend
- Interactive Dashboard: Rich web-based analytics with Chart.js visualizations
- Zero-Config Monitoring: Telemetry works out-of-the-box with automatic migration
Configuration
Environment Variables
Configuration File
Settings are stored in ~/.adversary/config.json
:
Dashboard Configuration
The telemetry system creates a unified SQLAlchemy database at:
- Location:
~/.local/share/adversary-mcp-server/cache/adversary.db
- Migration: Existing JSON metrics automatically migrated on first dashboard use
- Retention: Data retained indefinitely for historical analysis (configurable)
CI/CD Integration
GitHub Actions
Development
Setup Development Environment
Running Tests
Support
- 📖 Documentation
- 🐛 Report Issues
- 💬 Discussions
- 📧 Contact: brettbergin@gmail.com
License
MIT License - see LICENSE for details.
Contributing
Contributions are welcome! Please see our Contributing Guide for details.
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Tools
A security-focused server that integrates with Cursor IDE to provide real-time vulnerability detection, exploit generation, and security insights during software development.
Related MCP Servers
- -securityAlicense-qualityAn AI-powered development toolkit for Cursor providing intelligent coding assistance through advanced reasoning, UI screenshot analysis, and code review tools.Last updated -575329TypeScriptMIT License
- -securityAlicense-qualityA collection of Laravel helper tools for integration with Cursor IDE, providing features like log viewing, error searching, artisan command execution, and model information display directly within the editor.Last updated -12PythonMIT License
- -securityFlicense-qualityA TypeScript-based server project that can be integrated with Cursor IDE as an MCP (Model Control Protocol) server, enabling enhanced development capabilities.Last updated -138TypeScript
- AsecurityAlicenseAqualityA security testing tool that enables automated vulnerability detection including XSS and SQL injection, along with comprehensive browser interaction capabilities for web application penetration testing.Last updated -121,34617JavaScriptMIT License