alephnan/MCP-VirusTotal
If you are the rightful owner of MCP-VirusTotal and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
The MCP VirusTotal Server is a Model Context Protocol server designed to provide secure and deterministic access to VirusTotal data for LLM agents.
MCP VirusTotal Server
This project implements a Model Context Protocol (MCP) server that exposes a curated toolkit for querying VirusTotal. The service offers lookups for hashes, URLs, IPs, and domains plus optional submission flows. It is designed for safe use by LLM agents that need deterministic, reproducible access to VirusTotal data.
Features
- Strictly typed tool definitions for common VirusTotal lookups.
- Pydantic-based validation and normalization of inputs.
- Tenacity-powered retries with jitter and respect for VirusTotal rate limits.
- Pluggable caching layer (in-memory or Redis) to avoid redundant requests.
- Structured JSON logging with correlation IDs and redaction of secrets.
- Dockerized deployment with optional Redis sidecar and GitHub Actions CI.
MCP Tools
| Tool | Purpose | Input model | Output model |
|---|---|---|---|
get_hash_report | Summarize file analysis stats by SHA-256 | HashReportRequest | HashReportResponse |
get_url_report | Retrieve VT verdicts for a URL | URLReportRequest | URLReportResponse |
get_ip_report | Fetch IP intelligence data | IPReportRequest | IPReportResponse |
get_domain_report | Fetch domain reputation and categories | DomainReportRequest | DomainReportResponse |
submit_url | Queue a fresh URL scan | SubmitURLRequest | SubmitURLResponse |
submit_file | Upload a file for analysis (guarded by config) | SubmitFileRequest | SubmitFileResponse |
get_analysis_status | Track submission progress | AnalysisStatusRequest | AnalysisStatusResponse |
Each tool enforces strict validation and returns compact JSON responses suitable for downstream LLM consumption.
Configuration
All settings are environment-driven; refer to .env.example for defaults. Key options include:
VT_API_KEY– required VirusTotal API key.ALLOW_FILE_SUBMISSION– toggle file upload support (defaultfalse).CACHE_BACKEND–memoryorredis.CACHE_TTL_SECONDS– cache freshness window; set0to disable caching.MAX_FILE_SIZE_MB– safety limit for file submissions.
The server loads variables from a local .env file when present and can be safely configured via Docker/Compose secrets.
Getting Started
-
Create a Python virtual environment and install dependencies:
python -m venv .venv source .venv/bin/activate pip install -U pip pip install -e .[dev] -
Provide configuration via environment variables or a
.envfile. See.env.examplefor required values. -
Launch the MCP server:
VT_API_KEY=... python -m mcp_vt.serverThe server communicates via MCP's stdio transport and exposes the tools listed above.
Running Tests
-
Unit tests (mocked VirusTotal):
pytest -m unit -
Integration tests (real VirusTotal, requires
VT_API_KEY):VT_API_KEY=... pytest -m integration
Integration tests are automatically skipped when no API key is available.
Claude Configuration
Add the server to your Claude MCP config.json (usually at ~/.config/claude/config.json). Example entry:
{
"mcpServers": [
{
"name": "virustotal",
"command": "python",
"args": ["-m", "mcp_vt.server"],
"env": {
"VT_API_KEY": "${VT_API_KEY}"
}
}
]
}
Replace ${VT_API_KEY} with a secure reference (env var, secret manager, etc.). Restart Claude after updating the configuration so the new server is detected.
Docker Usage
Build and run the container locally with Docker Compose:
docker compose up --build
The compose stack provisions the MCP server alongside an optional Redis cache (listening on an internal network). The server container runs as an unprivileged user with a read-only filesystem and ephemeral /tmp.
Run without Redis
If you prefer the in-memory cache only, build and run the image directly without starting Redis:
docker build -t mcp-vt-memory .
docker build -t mcp-vt-memory . && docker run --rm --env-file .env -e CACHE_BACKEND=memory mcp-vt-memory
The server still communicates over stdio, so keep the container attached (no daemon mode) while an MCP client is connected.
Continuous Integration
GitHub Actions workflow .github/workflows/ci.yml installs the project, runs the unit suite for Python 3.11 and 3.12, and conditionally executes integration tests when the VT_API_KEY secret is present.
Licensing
Released under the .