Velociraptor MCP Server
Click on "Deploy 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., "@Velociraptor MCP ServerList all online clients"
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.
Velociraptor MCP Server
A production-ready Model Context Protocol (MCP) server for seamless integration between Velociraptor DFIR and Large Language Models (LLMs).
Why? Combine the power of Velociraptor's comprehensive digital forensics and incident response capabilities with the reasoning capabilities of large language modelsβenabling natural language queries and intelligent analysis of your forensic data.
β¨ Key Features
π Production-ready: Proper package structure, logging, error handling, and configuration management
π Secure: JWT token management with automatic refresh
π HTTP/2 Support: Built on modern async HTTP client with connection pooling
π Comprehensive API: Access Velociraptor artifacts, hunts, collections, and more
ποΈ Configurable: Environment variables, CLI arguments, and fine-grained tool filtering
π¦ Pip installable: Install directly from GitHub releases or source
Related MCP server: Velociraptor MCP Server
Table of Contents
Quick Start
1. Install
From GitHub (Recommended)
python -m venv .venv && source .venv/bin/activate
pip install git+https://github.com/socfortress/velociraptor-mcp-server.gitFrom Release Artifacts
Go to the Releases page
Download the latest
.whlfileInstall with:
pip install velociraptor_mcp_server-*.whlFrom Build Artifacts (Latest Build)
Go to the Actions tab
Click on the latest successful workflow run
Download the
python-package-distributionsartifactExtract and install:
pip install velociraptor_mcp_server-*.whl2. Configure Environment
Create a .env file in your project directory:
# Velociraptor Server Configuration
VELOCIRAPTOR_API_KEY=/path/to/api.config.yaml
VELOCIRAPTOR_SSL_VERIFY=false
VELOCIRAPTOR_TIMEOUT=30
# MCP Server Configuration
MCP_SERVER_HOST=127.0.0.1
MCP_SERVER_PORT=8000
# Logging Configuration
LOG_LEVEL=INFO
# Tool Filtering (optional)
# VELOCIRAPTOR_DISABLED_TOOLS=CollectArtifactTool,RunVQLQueryToolNote: For VELOCIRAPTOR_API_KEY, provide the full path to your Velociraptor api.config.yaml file. You can generate this file from your Velociraptor server using the admin interface or CLI.
3. Run the Server
# Using the CLI command
velociraptor-mcp-server
# Or using the Python module
python -m velociraptor_mcp_server
# Streamable HTTP for networked clients (requires MCP_AUTH_TOKEN)
MCP_AUTH_TOKEN=$(openssl rand -hex 32) velociraptor-mcp-server --transport http --host 0.0.0.0 --port 8000By default the server speaks MCP over stdio, for clients that launch it as a subprocess (.mcp.json).
With --transport http (or MCP_TRANSPORT=http) it serves streamable HTTP at http://<host>:<port>/mcp:
Every request must carry
Authorization: Bearer <MCP_AUTH_TOKEN>. The server refuses to start in HTTP mode without a token.GET /healthzis unauthenticated, for container health checks.
For an AI analyst that should only read existing results, set VELOCIRAPTOR_READ_ONLY=true. RunVQLQueryTool (arbitrary VQL) and CollectArtifactTool are then not registered.
Example from Pydantic AI:
from pydantic_ai.mcp import MCPToolset
velo = MCPToolset("http://velociraptor-mcp:8000/mcp", id="velociraptor", headers={"Authorization": f"Bearer {token}"})
async with velo:
info = await velo.direct_call_tool("GetAgentInfo", {"args": {"hostname": "workstation-01"}})Installation
Requirements
Python 3.11 or higher
Access to a Velociraptor server instance
Network connectivity to your Velociraptor server
Velociraptor API configuration file (api.config.yaml)
Development Installation
git clone https://github.com/socfortress/velociraptor-mcp-server.git
cd velociraptor-mcp-server
# Create virtual environment
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install in development mode
pip install -e ".[dev]"
# Install pre-commit hooks (optional)
pre-commit installConfiguration
Environment Variables
Variable | Description | Default | Required |
| Path to Velociraptor API config file (api.config.yaml) | None | β |
| SSL verification |
| β |
| Query timeout (seconds); the upper bound for any query, including |
| β |
| Row cap for any query, including |
| β |
| Don't register |
| β |
| Comma-separated categories: | None | β |
|
|
| β |
| HTTP bind host |
| β |
| HTTP port |
| β |
| Bearer token for the HTTP transport | None | β
for |
| Logging level |
| β |
| Comma-separated list of disabled tools | None | β |
Untrusted values (hostnames, client and flow IDs, artifact names, collection parameters) are passed to Velociraptor as query variables, never spliced into VQL text. Field lists are validated as identifiers.
Output and errors
Output. Responses are compact JSON, capped at
MCP_MAX_OUTPUT_CHARS(default 32000). When a row result is too large, whole rows are dropped and the response ends with[truncated: showing N of M rows (X characters)]. Usefieldsandlimitto keep results small.Errors. Backend failures and invalid arguments are returned as MCP tool errors (
isError: true). "Not found" answers are normal results.
Docker
docker build -t velociraptor-mcp-server .
docker run --env-file .env -p 127.0.0.1:8000:8000 \
-v ./api.config.yaml:/config/api.config.yaml:ro velociraptor-mcp-server # HTTP on :8000, needs MCP_AUTH_TOKENThe image runs as a non-root user and has a health check on /healthz. It never contains an API config: mount yours read-only (VELOCIRAPTOR_API_KEY defaults to /config/api.config.yaml).
Images are published to ghcr.io/socfortress/velociraptor-mcp-server:
mainandsha-β¦on every push to mainX.Y.ZandX.YforvX.Y.Ztags
See CHANGELOG.md.
CLI Options
velociraptor-mcp-server --helpAvailable options:
--transport:stdioorhttp(default:MCP_TRANSPORT, else stdio)--host: HTTP bind host (default:MCP_SERVER_HOST, else 127.0.0.1)--port: HTTP port (default:MCP_SERVER_PORT, else 8000)--log-level: Logging level (DEBUG, INFO, WARNING, ERROR, CRITICAL)--api-config: Path to Velociraptor API config file (overrides env var)--no-ssl-verify: Disable SSL certificate verification
Usage
Basic Usage
from velociraptor_mcp_server import Config, create_server
# Create server with environment configuration
config = Config.from_env()
server = create_server(config)
# Start the server
server.start()Custom Configuration
from velociraptor_mcp_server.config import VelociraptorConfig, ServerConfig, Config
# Create custom configuration
velociraptor_config = VelociraptorConfig(
api_key="/path/to/api.config.yaml",
ssl_verify=False,
timeout=60
)
server_config = ServerConfig(
host="0.0.0.0",
port=8080,
log_level="DEBUG"
)
config = Config(velociraptor=velociraptor_config, server=server_config)
server = create_server(config)Integration with LangChain
from langchain_mcp_adapters.client import MultiServerMCPClient
from langchain_openai import ChatOpenAI
from langchain.agents import AgentType, initialize_agent
# Initialize LLM
model = ChatOpenAI(model="gpt-4")
# Connect to Velociraptor MCP server
client = MultiServerMCPClient({
"velociraptor-mcp-server": {
"transport": "sse",
"url": "http://127.0.0.1:8000/sse/",
}
})
# Get tools and create agent
tools = await client.get_tools()
agent = initialize_agent(
tools=tools,
llm=model,
agent=AgentType.OPENAI_FUNCTIONS,
verbose=True
)
# Query your Velociraptor data
response = await agent.ainvoke({
"input": "Show me all active Velociraptor clients and their OS information"
})
# Collect artifacts from a specific client
artifact_response = await agent.ainvoke({
"input": "Collect Windows.System.Users artifact from client workstation-01"
})
# Get artifact collection results
results_response = await agent.ainvoke({
"input": "Get the results from flow F.ABC123 for Windows.System.Users artifact"
})Available Tools
The server exposes the following MCP tools for Velociraptor integration:
1. AuthenticateTool
Purpose: Initialize and test connection to Velociraptor server
Parameters: None
Usage: Establishes a gRPC connection using the api.config.yaml file and tests authentication
Example:
{"args": {}}
2. GetAgentInfo
Purpose: Retrieve detailed information about a Velociraptor client by hostname/FQDN or client ID
Parameters (give exactly one):
hostname: Hostname or FQDN of the client (exact match)client_id: Velociraptor client ID, e.g.C.1234abcd
Usage: Searches for a client and returns comprehensive details including client ID, OS information, agent version, and connection status
Example:
{"args": {"hostname": "workstation-01"}} {"args": {"hostname": "server.domain.com"}} {"args": {"client_id": "C.194759cdaf0153c8"}}
3. RunVQLQueryTool
Purpose: Execute VQL (Velociraptor Query Language) queries on the Velociraptor server
Parameters:
vql(required): VQL query string to executemax_rows(optional): Maximum number of rows to returntimeout(optional): Query timeout in seconds
Usage: Allows custom VQL queries to retrieve information about clients, artifacts, hunts, flows, and more
Examples:
{"args": {"vql": "SELECT client_id, os_info.hostname FROM clients() LIMIT 10"}} {"args": {"vql": "SELECT * FROM flows() WHERE client_id = 'C.1234567890'"}} {"args": {"vql": "SELECT name, description FROM artifacts() WHERE name =~ 'Windows'"}}
4. ListLinuxArtifactsTool
Purpose: List available Linux artifacts in Velociraptor
Parameters: None
Usage: Returns a summary of all Linux client artifacts including names, descriptions, and required parameters
Example:
{"args": {}}
5. ListWindowsArtifactsTool
Purpose: List available Windows artifacts in Velociraptor
Parameters: None
Usage: Returns a summary of all Windows client artifacts including names, descriptions, and required parameters. Includes performance notes for NTFS queries (MFT, USN) and path filtering recommendations.
Example:
{"args": {}}
6. CollectArtifactTool
Purpose: Collect a Velociraptor artifact from a client
Parameters:
client_id(required): Velociraptor client ID to target for collectionartifact(required): Name of the Velociraptor artifact to collectparameters(optional): Comma-separated string of key='value' pairs to pass to the artifact
Usage: Initiates artifact collection on a target client and returns a flow_id for tracking
Examples:
{"args": {"client_id": "C.1234567890", "artifact": "Windows.System.Users"}} {"args": {"client_id": "C.0987654321", "artifact": "Linux.System.Uptime", "parameters": "format='seconds'"}}
7. GetCollectionResultsTool
Purpose: Retrieve Velociraptor collection results for a given client, flow ID, and artifact
Parameters:
client_id(required): Velociraptor client ID where the collection was runflow_id(required): Flow ID returned from the initial collectionartifact(required): Name of the artifact collected (e.g., Windows.NTFS.MFT)fields(optional): Comma-separated string of fields to return (default: '*')max_retries(optional): Number of times to retry if the flow hasn't finished (default: 5)retry_delay(optional): Time in seconds to wait between retries (default: 5)wait(optional):falsechecks once and returns at once; use it for existing collections (default:true)limit(optional): Maximum rows per artifact source, capped byVELOCIRAPTOR_MAX_ROWS
Usage: Waits and retries if the flow hasn't finished or if no results are immediately available. Supports partial results for multi-source artifacts. Completion is read from the flow's own state first, so hunt flows (
F.β¦.H) are recognised as finished.Features:
Multi-source support: Handles artifacts with multiple sources (e.g., Linux.Debian.Packages with DebPackages/Snaps)
Partial results: Returns completed sources even if others are still running
Intelligent retry: Automatically waits for collection completion
Examples:
{"args": {"client_id": "C.1234567890", "flow_id": "F.ABC123", "artifact": "Windows.System.Users"}} {"args": {"client_id": "C.0987654321", "flow_id": "F.DEF456", "artifact": "Linux.System.Uptime", "fields": "Uptime,BootTime"}} {"args": {"client_id": "C.1234567890", "flow_id": "F.ABC123", "artifact": "Windows.System.Users", "wait": false, "limit": 50}}
8. CollectArtifactDetailsTool
Purpose: Get detailed information about a specific Velociraptor artifact
Parameters:
artifact_name(required): Name of the artifact to get details for
Usage: Retrieves comprehensive details including description, parameters, source code/VQL, parameter types, and default values. Useful for understanding artifacts before collection or debugging issues.
Examples:
{"args": {"artifact_name": "Windows.System.Users"}} {"args": {"artifact_name": "Linux.Network.Netstat"}} {"args": {"artifact_name": "Windows.NTFS.MFT"}}
9. ListLinuxArtifactNamesTool
Purpose: List only the names of available Linux artifacts in Velociraptor
Parameters: None
Usage: Returns a simple list of artifact names for Linux client artifacts
Example:
{"args": {}}
10. ListWindowsArtifactNamesTool
Purpose: List only the names of available Windows artifacts in Velociraptor
Parameters: None
Usage: Returns a simple list of artifact names for Windows client artifacts
Example:
{"args": {}}
11. FindArtifactDetailsTool
Purpose: Find a Velociraptor artifact's name, description, and parameters by artifact name
Parameters:
artifact_name(required): Name of the artifact to get details for
Usage: Returns a summary for the specified artifact, including its name, description, and parameter list
Example:
{"args": {"artifact_name": "Windows.RemoteDesktop.RDPConnections"}}
12. ListHuntsTool
Purpose: List hunts, newest first, with hunt ID, state, artifacts and client counts (read-only)
Parameters:
limit(optional, default 20)Example:
{"args": {"limit": 10}}
13. GetHuntResultsTool
Purpose: Read the existing results of a hunt for one artifact (read-only; runs nothing on endpoints)
Parameters:
hunt_id(required): e.g.H.D8CNRTTL5AOMMartifact(required): Artifact name. Artifacts with several sources must be given asArtifact/Source.fields(optional): Comma-separated fields (default*)limit(optional): Maximum rows, capped byVELOCIRAPTOR_MAX_ROWS
Example:
{"args": {"hunt_id": "H.D30PRBIDUCKO0", "artifact": "Linux.Execute.RemoteBashScript/ScriptExecution", "fields": "FlowId, Status", "limit": 20}}
Artifact Collection Workflow
The tools work together to provide a complete artifact collection workflow:
Discovery: Use
ListLinuxArtifactsToolorListWindowsArtifactsToolto explore available artifactsInvestigation: Use
CollectArtifactDetailsToolto understand artifact parameters and requirementsClient Identification: Use
GetAgentInfoto find the target client by hostnameCollection: Use
CollectArtifactToolto start artifact collection and get a flow_idResults: Use
GetCollectionResultsToolto monitor progress and retrieve resultsCustom Queries: Use
RunVQLQueryToolfor advanced custom investigations
Development
Setting up Development Environment
git clone https://github.com/socfortress/velociraptor-mcp-server.git
cd velociraptor-mcp-server
# Create virtual environment
python -m venv .venv
source .venv/bin/activate
# Install in development mode with dev dependencies
pip install -e ".[dev]"
# Install pre-commit hooks
pre-commit installRunning Tests
# Run all tests
pytest
# Run with coverage
pytest --cov=velociraptor_mcp_server
# Run specific test file
pytest tests/test_client.py
# Run with verbose output
pytest -vBuilding the Package
# Install build dependencies
pip install build twine
# Build the package
python -m build
# Check the package
twine check dist/*
# Test installation
pip install dist/*.whlContinuous Integration
This project uses GitHub Actions for automated building and testing:
Automatic builds: Every push to
mainanddevelopbranches triggers a buildQuality assurance: Comprehensive testing including linting, type checking, and unit tests
Artifact publishing: Built packages are available as GitHub releases and workflow artifacts
Creating a Release
Create and push a git tag:
git tag v1.0.0 git push origin v1.0.0The GitHub Action will automatically:
Build the package
Run all tests
Create a GitHub release with downloadable artifacts
Installing from CI Artifacts
Visit the Actions page and download the python-package-distributions artifact from any successful build.
Security Considerations
Credentials Management
Never commit credentials: Use environment variables or secrets management
Secure API config: Protect your Velociraptor API configuration file (api.config.yaml)
Certificate security: Ensure proper handling of client certificates and private keys
Network Security
TLS/SSL: Always use SSL/TLS for gRPC connections (
VELOCIRAPTOR_SSL_VERIFY=true)Firewall rules: Restrict access to necessary ports only
VPN/Private networks: Deploy in secured network environments
Access Control
Least privilege: Use Velociraptor API keys with minimal required permissions
Tool filtering: Disable unnecessary tools using
VELOCIRAPTOR_DISABLED_TOOLSClient access: Restrict which clients can be accessed through the API
Monitoring
Logging: Enable appropriate log levels for monitoring
Health checks: Implement monitoring of the MCP server endpoint
Rate limiting: Consider implementing rate limiting for production deployments
Project Structure
velociraptor-mcp-server/
βββ velociraptor_mcp_server/ # Main package
β βββ __init__.py # Package initialization
β βββ __main__.py # CLI entry point
β βββ client.py # Velociraptor API client
β βββ config.py # Configuration management
β βββ server.py # MCP server implementation
β βββ exceptions.py # Custom exceptions
βββ tests/ # Test suite
β βββ conftest.py # Test configuration
β βββ test_client.py # Client tests
β βββ test_config.py # Configuration tests
β βββ test_server.py # Server tests
βββ .github/workflows/ # GitHub Actions
β βββ publish.yml # CI/CD pipeline
βββ requirements.txt # Dependencies
βββ pyproject.toml # Package configuration
βββ .env.example # Environment template
βββ Dockerfile # Docker configuration
βββ README.md # This fileContributing
We welcome contributions! Please follow these steps:
Fork the repository
Create a feature branch (
git checkout -b feature/amazing-feature)Make your changes and add tests
Ensure tests pass:
pytestCheck code quality:
black .,isort .,flake8 .Commit your changes (
git commit -m 'Add amazing feature')Push to your branch (
git push origin feature/amazing-feature)Open a Pull Request
Development Guidelines
Write tests for new functionality
Follow existing code style and patterns
Update documentation for new features
Ensure all CI checks pass
License
This project is licensed under the GNU Affero General Public License v3.0 only (AGPL-3.0-only) - see the LICENSE file for details.
Changelog
v0.1.0 (Latest)
Initial release
Basic MCP server functionality
Velociraptor API integration with gRPC authentication
Complete artifact collection workflow
CLI interface with configuration options
Comprehensive test suite
GitHub Actions CI/CD pipeline
Support for multi-source artifacts with partial results
Support
π Documentation
π Issues
π’ SOCFortress
Made with β€οΈ by SOCFortress
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP server for Pentest-Tools.com: run scans, manage findings and reports via your preffered LLM.
LLM Orchestration Agent (Mcp)
OCR, transcription, file extraction, and image generation for AI agents via MCP.
Security scanner for MCP servers. Detect vulnerabilities, prompt injection, and tool poisoning.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI assistants to interact with the Velociraptor digital forensics and incident response platform for endpoint management and threat hunting. It supports artifact collection, VQL query execution, and automated forensic investigation workflows.353MIT
- AlicenseNot gradedqualityDmaintenanceEnables 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
- FlicenseNot gradedqualityCmaintenanceA proof-of-concept MCP bridge that exposes Velociraptor's forensic triage tools to LLMs, enabling natural language querying of Windows endpoints for artifacts like network connections and suspicious processes.95-
- FlicenseNot gradedqualityDmaintenanceEnables MCP clients to interact with a Velociraptor deployment for DFIR workflows, allowing VQL queries, client management, hunt creation, and artifact collection.-