GuardianMCP ๐ก๏ธ
Your vigilant security companion that automatically guards your projects against vulnerabilities.
GuardianMCP is an MCP (Model Context Protocol) server that scans project dependencies for known security vulnerabilities using the OSV.dev database. Works with Cursor, VS Code, Claude Desktop, and other MCP-compatible IDEs.
Features
๐ก๏ธ Automatic vulnerability scanning for npm and Composer dependencies
๐จ Real-time alerts for CRITICAL and HIGH severity issues
๐ฏ Three scan modes: full, summary, critical-high-only
๐ Auto-trigger support via IDE rules (on install, commit, build)
๐ Multi-language keyword detection (English, Latvian, French, Spanish, German, Russian, etc.)
๐ณ Docker support for containerized deployment
๐ Detailed reports with remediation guidance and CVE links
โก Fast & lightweight using OSV.dev API
๐ Secure by design - 0 vulnerabilities, minimal dependencies
Security Status
โ Latest security audit: All dependencies scanned, 0 vulnerabilities found โ Node.js: Latest LTS (22.x) with security updates โ Regular updates: Weekly dependency checks and monthly security reviews
See SECURITY.md for our security policy and audit details.
Quick Start
Choose your preferred method:
Option 1: npm (Recommended for most users)
Option 2: From Source
Option 3: Docker
IDE Setup Instructions
Click on your IDE to see setup instructions:
Cursor Setup
Cursor has native MCP support. Follow these steps:
1. Install GuardianMCP
2. Configure Cursor
Open Cursor settings:
macOS/Linux:
~/.cursor/config.jsonorCursor Settings > Features > MCP ServersWindows:
%APPDATA%\Cursor\config.json
Add GuardianMCP configuration:
Or if installed locally:
3. Enable Auto-Scanning (Optional)
Create .cursor/rules.md in your project:
4. Restart Cursor
Completely restart Cursor to load GuardianMCP.
5. Test It
Open Cursor's AI chat and type:
GuardianMCP will automatically scan your dependencies!
VS Code Setup
VS Code can use MCP servers through extensions or configuration.
Method 1: Using Continue.dev Extension
Install Continue.dev extension
Open Continue settings (
.continue/config.json)Add MCP server configuration:
Method 2: Direct Configuration
Install GuardianMCP:
npm install -g guardian-mcpAdd to VS Code settings (
.vscode/settings.json):
3. Enable Auto-Scanning
Create .vscode/rules.md:
4. Restart VS Code
Reload window: Cmd/Ctrl + Shift + P โ "Reload Window"
Claude Desktop Setup
Claude Desktop has built-in MCP support.
1. Install GuardianMCP
2. Configure Claude Desktop
Open configuration file:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
Add GuardianMCP:
Or for local installation:
3. Configure Auto-Scanning
Add to ~/.claude/rules.md (global) or project's .claude/rules.md:
4. Restart Claude Desktop
Completely quit and reopen Claude Desktop.
Windsurf Setup
Windsurf supports MCP servers similar to Cursor.
1. Install GuardianMCP
2. Configure Windsurf
Open Windsurf configuration:
Location:
~/.windsurf/config.json
Add MCP server:
3. Create Project Rules
Add .windsurf/rules.md to your project:
4. Restart Windsurf
Reload the editor to activate GuardianMCP.
Zed Setup
Zed is adding MCP support. Check current status:
1. Install GuardianMCP
2. Configure Zed
Open Zed settings:
macOS:
~/.config/zed/settings.jsonLinux:
~/.config/zed/settings.json
Add configuration:
3. Restart Zed
Reload the editor.
Note: MCP support in Zed may be experimental. Check Zed documentation for latest status.
Docker Setup
Run GuardianMCP in a Docker container and connect from any IDE.
Method 1: Using Docker Compose (Recommended)
Clone the repository:
Build and run:
Configure your IDE:
In your IDE's MCP configuration, use:
Method 2: Docker Run
Build the image:
Run the container:
Configure your IDE:
For Cursor with Docker:
Edit ~/.cursor/config.json:
Volume Mounting
To scan projects outside the container:
Then scan with:
Docker Health Check
Stopping the Container
Generic MCP Setup
For any IDE that supports Model Context Protocol:
1. Install GuardianMCP
2. Find Your IDE's MCP Configuration
Common locations:
~/.config/[IDE_NAME]/config.json~/.config/[IDE_NAME]/settings.json~/.[IDE_NAME]/mcp.json
3. Add GuardianMCP
Or with full path:
4. Verify Setup
Test by asking your IDE's AI assistant:
Usage
Once GuardianMCP is installed in your IDE, you can:
Manual Scanning
Simply ask your AI assistant:
Automatic Scanning
Configure rules in your IDE's rules file (.cursor/rules.md, .claude/rules.md, etc.):
Tool Parameters
GuardianMCP provides the check_vulnerabilities tool with these parameters:
Parameter | Type | Options | Default | Description |
| string | any path | current dir | Path to project directory |
| string |
,
,
|
| Which files to scan |
| string |
,
,
|
| Output detail level |
Examples
Full scan:
Quick summary:
Auto-scan mode (recommended):
Scan Modes Explained
๐ full Mode
Best for: Manual security audits, comprehensive reviews
Shows ALL vulnerabilities with complete details:
CRITICAL, HIGH, MODERATE, and LOW severity
Detailed descriptions and remediation steps
Reference links and CVE IDs
Update commands for each package
Example output:
๐ summary Mode
Best for: Quick health checks, CI/CD dashboards
Shows only vulnerability counts:
Fast overview
No detailed descriptions
Total counts by severity
Example output:
๐ฏ critical-high-only Mode
Best for: Auto-scans, automated monitoring (RECOMMENDED for rules)
Shows detailed info for CRITICAL/HIGH, counts others:
Reduces noise
Highlights actionable issues
Perfect for automatic scans
Hides moderate/low details
Example output:
Severity Levels
Level | Icon | Action | Examples |
CRITICAL | ๐ด | Update IMMEDIATELY | RCE, Auth bypass, Privilege escalation |
HIGH | ๐ | Update ASAP | SQL injection, XSS, CSRF |
MODERATE | ๐ก | Plan update | DoS, Information disclosure |
LOW | ๐ข | Consider updating | Deprecated packages, Minor issues |
Example Rules Files
See examples/ for ready-to-use templates:
claude-rules.md- Comprehensive template with all scenariosproject-rules.md- Project-specific configuration exampleglobal-rules.md- User-wide configuration for all projects
Copy these to:
Cursor:
.cursor/rules.mdClaude Desktop:
.claude/rules.mdVS Code:
.vscode/rules.md(with Continue.dev)
Supported Ecosystems
Ecosystem | File | Status |
npm (Node.js) |
| โ Supported |
Composer (PHP) |
| โ Supported |
PyPI (Python) |
| ๐ Planned |
Go Modules |
| ๐ Planned |
Maven (Java) |
| ๐ Planned |
NuGet (.NET) |
| ๐ Planned |
RubyGems |
| ๐ Planned |
Cargo (Rust) |
| ๐ Planned |
Troubleshooting
Verify installation:
npx guardian-mcp --version # or which guardian-mcpCheck config file path is absolute:
โ
"args": ["dist/index.js"]โ
"args": ["/Users/you/guardian-mcp/dist/index.js"]
Restart IDE completely (don't just reload window)
Check IDE logs:
Cursor: Open DevTools (Help > Toggle Developer Tools)
VS Code: Output panel > Extension Host
Claude Desktop: View > Developer > Toggle Developer Tools
Test manually:
node /path/to/guardian-mcp/dist/index.js # Should not crash
Verify rules file exists:
cat .cursor/rules.md # or cat .claude/rules.mdCheck rules mention tool name:
Must reference
check_vulnerabilitiesUse
scan_mode="critical-high-only"for auto-scans
Test with keywords:
Try saying "security" or "vulnerability"
Should trigger automatic scan
Check IDE supports rules:
Cursor: โ Built-in support
Claude Desktop: โ Built-in support
VS Code: Depends on extension
Check logs:
docker logs guardian-mcpVerify build succeeded:
docker build -t guardian-mcp:latest .Test manually:
docker run -it guardian-mcp:latestCheck health:
docker ps --filter name=guardian-mcp # Status should be "healthy"
Check internet connection
Verify API is accessible:
curl https://api.osv.dev/v1/queryRate limiting: OSV.dev has rate limits
Wait a few minutes
Reduce scan frequency
Firewall: Ensure outbound HTTPS is allowed
Development
Local Development
Testing Changes
Adding New Ecosystems
Create
checkXXXJson()function insrc/index.tsFollow pattern of
checkPackageJson()orcheckComposerJson()Update
file_typeenum and descriptionsUse appropriate OSV.dev ecosystem name
Contributing
Contributions are welcome! Areas for improvement:
๐ Additional ecosystem support (Python, Go, Rust, etc.)
๐ง Better version range parsing
โก Caching to reduce API calls
๐ฑ IDE-specific optimizations
๐งช Test coverage
๐ Documentation improvements
License
MIT - See LICENSE file
Resources
๐ OSV.dev Database
๐ OSV.dev API Docs
๐ ๏ธ Model Context Protocol
๐ฆ MCP TypeScript SDK
๐ Cursor Documentation
๐ป VS Code MCP Guide
Security Note
GuardianMCP helps identify known vulnerabilities but is not a substitute for:
โ Comprehensive security audits
โ Penetration testing
โ Secure coding practices
โ Regular dependency updates
โ Security training
Always review and test dependency updates before deploying to production.
This server cannot be installed