AlienSec MCP Server
Allows scanning files and URLs using the VirusTotal API and retrieving existing analysis results, with automatic rate limiting and circuit breaker protection.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@AlienSec MCP ServerScan /tmp/suspicious.exe with VirusTotal"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
AlienSec MCP Server
Production-Ready AlienVault OTX Endpoint Security Scanning MCP Server with VirusTotal Integration
Overview
The AlienSec MCP Server is a production-grade Model Context Protocol (MCP) server that provides comprehensive endpoint security scanning capabilities using AlienVault OTX with optional VirusTotal integration.
This server enables AI agents and applications to perform security scans on various endpoint types (macOS PKG, Windows PowerShell, Debian APT, Redhat RPM) and retrieve threat intelligence from AlienVault OTX and VirusTotal APIs.
Related MCP server: Velociraptor MCP Server
Features
Core Capabilities
Multi-Platform Endpoint Scanning
Scan macOS systems using PKG installer flavor
Scan Windows endpoints via PowerShell
Scan Debian/Ubuntu systems using APT
Scan Redhat/CentOS systems using RPM
VirusTotal Integration
Scan files and URLs using VirusTotal API
Retrieve existing analysis results
Automatic rate limiting and circuit breaker protection
Multiple API key support (respects VirusTotal ToS)
Threat Intelligence
Search AlienVault OTX pulses
Retrieve pulse details and events
Access indicators of compromise (IoCs)
Data Persistence
SQLite database with optional encryption
Scan result storage with timestamps
API request logging
Circuit breaker event tracking
Production-Ready Features
Comprehensive error handling
Structured logging with Pino
Environment variable validation with Zod
Type-safe API schemas
Graceful shutdown handling
Prerequisites
System Requirements
Node.js: >= 18.0.0
npm: >= 8.0.0
Operating System: macOS, Linux, or Windows
Disk Space: Minimum 100MB for dependencies
API Keys Required
AlienVault OTX API Key (Required)
Sign up at https://otx.alienvault.com
Navigate to Settings > API Keys
Generate a new API key
VirusTotal API Key (Optional, for enhanced functionality)
Sign up at https://www.virustotal.com
Navigate to API Console
Generate API key(s)
Note: Free tier allows 500 requests/day, 4 requests/minute
Installation
1. Clone the Repository
git clone https://github.com/aliensec/aliensec-mcp-server.git
cd aliensec-mcp-server2. Install Dependencies
npm installThis will install all production and development dependencies.
3. Configure Environment Variables
Copy the example environment file and update with your API keys:
cp .env.example .envEdit .env with your API keys:
# Server Configuration
NAME=aliensec-mcp-server
VERSION=1.0.0
DEBUG=false
LOG_LEVEL=info
# AlienVault OTX Configuration (Required)
ALIENVAULT_API_KEY=your_alienvault_api_key_here
ALIENVAULT_BASE_URL=https://api.agent.otxb.io
ALIENVAULT_DEFAULT_REGION=us-east-1
# VirusTotal Configuration (Optional)
VIRUSTOTAL_API_KEYS=key1,key2,key3
VIRUSTOTAL_BASE_URL=https://www.virustotal.com/api/v3
VIRUSTOTAL_RATE_LIMIT_PER_MINUTE=4
VIRUSTOTAL_DAILY_LIMIT=500
VIRUSTOTAL_CIRCUIT_BREAKER_TIMEOUT=300
# Database Configuration
DATABASE_PATH=./data/aliensec.db
DATABASE_ENCRYPTION_KEY=your_encryption_key_here
DATABASE_TIMEOUT=5000Note: VirusTotal ToS prohibits using multiple API keys to bypass rate limits. This implementation respects those limits and uses multiple keys for redundancy only.
4. (Optional) Install SQLite Encryption Dependencies
For encrypted database support on Linux/macOS:
# Ubuntu/Debian
sudo apt-get install build-essential
# macOS
xcode-select --installUsage
Development Mode
Run the server in development mode with automatic reloading:
npm run devProduction Mode
Build and run the server:
npm run build
npm startUsing with MCP Clients
The server communicates via stdio (standard input/output). To use it with an MCP client:
# Direct execution
node dist/index.js
# Or using the npm script
npm startExample MCP Client Integration
import { McpClient } from '@modelcontextprotocol/client';
const client = new McpClient({
command: 'node',
args: ['dist/index.js'],
});
// Call a scan tool
const result = await client.invokeTool('scan_macos_pkg', {
target: '192.168.1.100',
useVirusTotal: true,
});
console.log(result);Available Tools
Scan Tools (5)
Tool | Description | Parameters |
| Generic endpoint scanner |
|
| Scan macOS PKG installer |
|
| Scan Windows endpoint |
|
| Scan Debian/APT endpoint |
|
| Scan Redhat/RPM endpoint |
|
VirusTotal Tools (2)
Tool | Description | Parameters |
| Scan resource with VirusTotal |
|
| Get existing VirusTotal analysis |
|
AlienVault OTX Tools (4)
Tool | Description | Parameters |
| Get bootstrap command for flavor |
|
| Get all bootstrap URLs | - |
| Search AlienVault OTX pulses |
|
| Validate AlienVault API key | - |
Database Tools (4)
Tool | Description | Parameters |
| Get scan statistics | - |
| Get recent scans |
|
| Get circuit breaker stats | - |
| Get API statistics | - |
System Tools (1)
Tool | Description | Parameters |
| Get server health status | - |
Bootstrap Commands
The server provides pre-configured bootstrap commands for each endpoint flavor:
macOS PKG Installer
API_KEY=${env:ALIENVAULT_API_KEY} bash -c "$(curl -s https://api.agent.otxb.io/osquery-api-otx/bootstrap?flavor=pkg)"Windows PowerShell
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12; ${env:ALIENVAULT_API_KEY} (new-object Net.WebClient).DownloadString("https://api.agent.otxb.io/osquery-api-otx/bootstrap?flavor=powershell") | iex; install_agent -apikey ${env:ALIENVAULT_API_KEY}Debian APT
API_KEY=${env:ALIENVAULT_API_KEY} bash -c "$(curl -s https://api.agent.otxb.io/osquery-api-otx/bootstrap?flavor=apt)"Redhat RPM
API_KEY=${env:ALIENVAULT_API_KEY} bash -c "$(curl -s https://api.agent.otxb.io/osquery-api-otx/bootstrap?flavor=rpm)"Project Structure
aliensec-mcp-server/
├── src/
│ ├── config/
│ │ └── index.ts # Environment configuration & validation
│ ├── core/
│ │ ├── alienVault.ts # AlienVault OTX API client
│ │ └── virusTotal.ts # VirusTotal API client
│ ├── database/
│ │ └── index.ts # SQLite database with repositories
│ ├── types/
│ │ └── index.ts # TypeScript type definitions
│ └── index.ts # Main MCP server entry point
├── package.json
├── tsconfig.json
├── .env.example
├── .gitignore
├── .eslintrc.json
├── .prettierrc
└── README.mdArchitecture
Layered Design
┌─────────────────────────────────────┐
│ MCP Server Layer │ ← src/index.ts
├─────────────────────────────────────┤
│ Core Service Layer │ ← src/core/
├─────────────────────────────────────┤
│ Data Access Layer │ ← src/database/
├─────────────────────────────────────┤
│ Configuration Layer │ ← src/config/
├─────────────────────────────────────┤
│ Type Definitions │ ← src/types/
└─────────────────────────────────────┘Key Design Patterns
Singleton Pattern: Database, AlienVault client, VirusTotal client
Repository Pattern: ScanRepository, CircuitBreakerRepository, APILogRepository
Circuit Breaker Pattern: Automatic API key rotation on failures
Token Bucket Rate Limiter: Rate limiting for VirusTotal API
Factory Pattern: MCP server creation with dependency injection
Strategy Pattern: Different scan flavors with common interface
Database Schema
The server uses SQLite with the following tables:
scan_records
Stores all scan results with findings, VirusTotal data, and timestamps.
circuit_breaker_events
Tracks circuit breaker state changes for API keys.
api_logs
Logs all API requests with response times, status codes, and errors.
schema_version
Tracks database schema version for migrations.
Error Handling
Custom Error Classes
AlienSecError: Base error class with code and statusCode
AlienVaultAPIError: AlienVault-specific errors
VirusTotalAPIError: VirusTotal-specific errors with rate limit detection
DatabaseError: Database-related errors
ConfigurationError: Configuration validation errors
Error Response Format
All errors return structured responses:
{
"isError": true,
"error": {
"message": "Error description",
"code": "ERROR_CODE",
"context": { ... }
}
}Logging
The server uses Pino for structured logging with the following levels:
error: Critical failures
warn: Warnings and potential issues
info: Normal operations and status updates
debug: Detailed debugging information
trace: Very verbose logging for development
Logs are automatically redacted to prevent sensitive data (API keys) from being logged.
Rate Limiting & Circuit Breaker
VirusTotal Rate Limiting
Token Bucket Algorithm: Smooth rate limiting
Configurable Limits: Set via environment variables
Automatic Wait: Option to wait when rate limited
Circuit Breaker: Automatically blocks API keys that fail repeatedly
Circuit Breaker Configuration
Failure Threshold: 5 consecutive failures
Reset Timeout: 300 seconds (5 minutes)
Half-Open State: Test with 1 request before fully reopening
ToS Compliance
The implementation respects VirusTotal's Terms of Service:
Multiple API keys are for redundancy, not for bypassing limits
Each API key respects individual rate limits
Circuit breaker prevents rapid retries on failures
Daily request counting prevents quota exhaustion
Development
Running Tests
# Run all tests
npm test
# Run tests in watch mode
npm run test:watch
# Run with coverage
npx vitest run --coverageLinting & Formatting
# Run linting
npm run lint
# Auto-fix linting issues
npm run lint:fix
# Format code
npm run formatType Checking
npm run typecheckBuild Verification
# Clean build
npm run clean
npm run build
# Check build output
ls -la dist/Environment Variables
Variable | Required | Default | Description |
| Yes | - | AlienVault OTX API key |
| No |
| AlienVault API base URL |
| No |
| Default region for agents |
| No | `` | Comma-separated VirusTotal API keys |
| No |
| VirusTotal API base URL |
| No |
| Rate limit per minute |
| No |
| Daily request limit |
| No |
| Circuit breaker timeout (seconds) |
| No |
| SQLite database path |
| No | - | Database encryption key |
| No |
| Database connection timeout |
| No |
| Server name |
| No |
| Server version |
| No |
| Enable debug mode |
| No |
| Log level (error, warn, info, debug, trace) |
Security Considerations
Data Protection
Database Encryption: Use
DATABASE_ENCRYPTION_KEYfor encrypting sensitive data at restAPI Key Security: API keys are never logged; use environment variables or secure vaults
Memory Safety: Sensitive strings are hashed (SHA-256) before storage in circuit breaker and API log tables
Network Security
HTTPS Only: All API communication uses HTTPS
Certificate Validation: TLS certificate validation is enabled by default
User-Agent: Custom user agent identifies the server version
Rate Limiting
Client-Side Rate Limiting: Prevents overwhelming external APIs
Circuit Breaker: Prevents cascading failures
Backpressure: Automatic waiting when rate limited
Performance
Optimizations
Connection Pooling: Database connections are reused
Lazy Loading: Repositories are created on-demand
Indexed Queries: Database tables have appropriate indexes
Caching: API key hashes are cached for circuit breaker checks
Async/Await: Non-blocking I/O operations
Benchmarks
Scan Request: ~100-500ms (simulated)
VirusTotal Request: ~200-1000ms (network dependent)
Database Operations: <10ms (local SQLite)
Troubleshooting
Common Issues
Database Connection Failed
Error: Failed to connect to databaseSolution: Ensure the data directory exists and has write permissions:
mkdir -p data
chmod 755 dataMissing ALIENVAULT_API_KEY
Missing required environment variables:
- ALIENVAULT_API_KEYSolution: Set the environment variable:
export ALIENVAULT_API_KEY=your_api_key_here
# or add to .env fileVirusTotal Rate Limit Exceeded
Error: Rate limit exceeded for API key 0Solution:
Wait for the rate limit to reset (default: 4 requests/minute)
Add more API keys (comma-separated in VIRUSTOTAL_API_KEYS)
Use
wait: trueparameter to automatically wait
Circuit Breaker Open
Error: API key 0 is blocked by circuit breakerSolution: Wait for the circuit breaker timeout to expire (default: 5 minutes). The circuit will automatically reopen after the timeout.
Debug Mode
Enable debug logging for detailed troubleshooting:
DEBUG=true LOG_LEVEL=debug npm run devContributing
Pull Requests
Fork the repository
Create a feature branch (
git checkout -b feature/amazing-feature)Commit your changes (
git commit -m 'Add amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
Commit Message Guidelines
Use Conventional Commits format
Prefix with type:
feat:,fix:,docs:,style:,refactor:,test:,chore:Keep subject line under 72 characters
Provide detailed description in body if needed
Code Review
All PRs require approval from at least one maintainer
CI/CD pipeline must pass (lint, typecheck, tests)
Code must follow existing patterns and style
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
Model Context Protocol: https://modelcontextprotocol.io
AlienVault OTX: https://otx.alienvault.com
VirusTotal: https://www.virustotal.com
TypeScript: https://www.typescriptlang.org
better-sqlite3: https://github.com/WiseLibs/better-sqlite3
References
Built with ❤️ for the security community
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityCmaintenanceProvides AI agents with 37 OSINT tools and 12 data sources to perform unified reconnaissance, domain analysis, and attack surface mapping. It enables agents to query, correlate, and reason across platforms like Shodan, VirusTotal, and Censys in parallel.3780341MIT
- Alicense-qualityDmaintenanceEnables AI agents to interface with Velociraptor for digital forensics and incident response tasks, including file/memory scans, remediation actions, and artifact collection across multiple operating systems.1MIT
- AlicenseAqualityAmaintenanceEnables AI agents to scan code for security vulnerabilities using multiple static analysis tools, with support for filtering, deduplication, and CI/CD integration.272MIT
- AlicenseAqualityBmaintenanceEnables assistants to analyze files and URLs for malware by integrating with security services like VirusTotal and ANY.RUN, returning threat reports.20MIT
Related MCP Connectors
Real-time threat intel for AI agents: 890K+ IOCs incl. prompt-injection & AI-skill threats
CVE lookups (NVD) and dependency-manifest audits (OSV) for AI agents. No API keys.
CVE lookups (NVD) and dependency-manifest audits (OSV) for AI agents. No API keys.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/VrilLabs/aliensec-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server