AI Agent Security Hardening Tool using Model Context Protocol (MCP).
- Static security analysis of Python code
- AI-powered vulnerability detection using Google Gemini
- Risk categorization (Critical, Medium, Low)
- Modern React web dashboard for viewing scan results
- Real-time scan monitoring and history
- MCP server for integration with AI clients
- Python 3.8+
- Node.js 16+
- Google Gemini API key
- Clone the repository
git clone https://github.com/aegentdev/mcpagentscanner.git
cd mcpagentscanner- Install dependencies
pip install -r requirements.txt
npm install- Set up environment variables
Create a
.envfile:
GOOGLE_API_KEY=your_gemini_api_key_here
Configure your MCP client (Gemini, Cursor, etc.) to connect to the server:
Add to MCP Servers in settings:
{
"mcpServers": {
"autohardener": {
"command": "python",
"args": ["/path/to/mcpagentscanner/server.py"],
"env": {
"GOOGLE_API_KEY": "your_api_key_here"
}
}
}
}Add to settings.json:
{
"mcp.servers": {
"autohardener": {
"command": "python",
"args": ["/path/to/mcpagentscanner/server.py"],
"env": {
"GOOGLE_API_KEY": "your_api_key_here"
}
}
}
}autoharden_agent(agent_path: str)- Analyze single Python fileping_pong(random_string: str)- Health check
# Terminal 1: Start React development server
npm run dev
# Terminal 2: Start Flask backend (optional - for API endpoints)
python app.pyAccess the dashboard at http://localhost:3000
# Build the React app
npm run build
# Start Flask backend (serves the built React app)
python app.pyAccess the dashboard at http://localhost:5000
# Builds React app and starts both frontend and backend
python run_modern_dashboard.py- Real-time Dashboard: Live monitoring of scan results
- Scan History: View previous scans and their results
- Risk Analysis: Detailed breakdown of security risks
- Modern UI: Built with React, TypeScript, and Tailwind CSS
- Responsive Design: Works on desktop and mobile devices
- Static Analysis - Scans code for security patterns
- AI Analysis - Uses Google Gemini for vulnerability detection
- Risk Assessment - Provides severity levels and mitigation suggestions
- Real-time Updates - Frontend automatically refreshes with new scan results
- Code execution vulnerability detection
- Tool misuse pattern identification
- File operation security analysis
- Network security concerns
- Prompt injection detection
mcpagentscanner/
├── src/ # React frontend source
│ ├── components/ # React components
│ ├── pages/ # Page components
│ └── lib/ # Utility functions
├── server.py # MCP server
├── app.py # Flask backend API
├── run_modern_dashboard.py # All-in-one runner
└── package.json # Node.js dependencies
- Ensure Google API key is set in environment
- Check file permissions and paths
- Verify MCP client configuration
- Restart MCP client after configuration changes
- If frontend doesn't load, try
npm installto ensure dependencies are installed
MIT License - see LICENSE file for details.