Forensics MCP Server
自组装取证 MCP 服务器(FastMCP / Python)
一个基于 Python 和 FastMCP(mcp>=2.0.0)构建的模块化数字取证与事件响应(DFIR)模型上下文协议(MCP) 服务器。
它在启动时动态发现主机和容器取证工具,并自动自组装功能性工具、资源和分类提示,供本地大语言模型和 AI 代理(Ollama、Claude、Cursor、Antigravity 等)使用。
🌟 特性
🔍 动态能力发现:探测主机环境路径、已安装的二进制文件(
exiftool、strings、volatility3、binwalk、tshark、objdump、gdb、yara)以及 Docker 运行时。缺失的工具会被优雅地报告而不会导致崩溃。🧩 自组装工具原语:仅自动注册主机环境中可用的工具。
🛡️ 隔离与离线就绪:内置离线威胁情报数据库,包含已知样本签名(EICAR、WannaCry、Mimikatz),用于安全、零数据泄露的事件响应。
📋 防篡改监管链:每次工具执行、检查的工件、SHA-256 校验和以及操作参数都会经过密码学哈希处理,并记录到仅可追加的分类账中(
evidence/chain_of_custody.jsonl)。🩺 自报告健康与资源:实时能力矩阵(
forensics://capabilities)、监管日志(forensics://custody)和系统健康状态(forensics://health)。⚡ 双传输方式:支持原生 MCP 客户端(Cursor、Claude、Antigravity)的标准 STDIO,以及 Web 大语言模型代理(Ollama、Open WebUI)的 SSE/HTTP。
Related MCP server: findevil-agent
🚀 快速开始
1. 前置要求
Python 3.10+(或 uv)
2. 运行服务器
选项 A:原生 STDIO 传输(适用于本地代理 / Cursor / Claude)
cd /home/b47m4n/Projects/forensics-mcp-framework
uv run src/server.py选项 B:SSE / HTTP 传输(适用于 Web / 远程大语言模型)
cd /home/b47m4n/Projects/forensics-mcp-framework
uv run src/server.py --transport sse --port 8000🔌 连接到本地大语言模型和代理
1. Antigravity / Claude / Cursor(claude_desktop_config.json / mcp.json)
{
"mcpServers": {
"forensic-analyzer": {
"command": "uv",
"args": [
"--directory",
"/home/b47m4n/Projects/forensics-mcp-framework",
"run",
"src/server.py"
]
}
}
}2. 通过 Ollama + MCP 连接本地大语言模型
通过 SSE 端点连接您的本地模型(例如 llama3.1、qwen2.5-coder):
http://localhost:8000/sse
🛠️ 已发现的工具目录
工具 | 类别 | 动态条件 | 描述 |
| 元数据与文件 | 始终可用 | 计算哈希(MD5/SHA256)、EXIF 标签,并检测 MIME 不匹配 |
| 静态分析 | 始终可用 | 提取可打印的 ASCII 和 Unicode 字符串 |
| 威胁检测 | 始终可用 | 扫描 C2 URL、IP 地址、Base64 块、命令执行 |
| 威胁情报 | 始终可用 | 根据离线签名和可选的实时 API 检查哈希 |
| 诊断 | 始终可用 | 健康状态、存储检查和工具就绪性 |
| 内存取证 |
| Volatility 3 |
| 内存取证 |
| Volatility 3 |
| 内存取证 |
| Volatility 3 |
| 内存取证 |
| Volatility 3 |
| 内存取证 |
| Volatility 3 |
| 文件提取 |
| 固件签名和文件系统提取 |
| 网络取证 |
| 解析 PCAP 网络数据包捕获 |
| 逆向工程 |
| 反汇编二进制机器指令 |
| 调试 |
| 自动化批量调试检查 |
| 签名匹配 |
| 根据 YARA 规则文件扫描证据 |
📂 项目架构
forensics-mcp-framework/
├── pyproject.toml
├── .env.example
├── README.md
├── evidence/ # Evidence locker & chain of custody ledger
│ ├── suspect_photo.jpg
│ ├── eicar_test.com
│ └── chain_of_custody.jsonl
└── src/
├── server.py # Master FastMCP bootstrap & dynamic assembler
├── core/
│ ├── discovery.py # Host & container capability scanner
│ ├── custody.py # Tamper-evident append-only chain of custody
│ └── health.py # System diagnostics & health reporter
├── tools/
│ ├── metadata.py # ExifTool & MIME mismatch detector
│ ├── strings_ioc.py # String & IOC scanner (IP, URL, Base64, shell)
│ ├── threat_intel.py # Offline/online threat intelligence
│ ├── memory_vol.py # Volatility 3 memory analysis engine
│ └── dynamic_cli.py # CLI wrappers (binwalk, tshark, objdump, gdb)
├── resources/
│ └── system_resources.py# MCP Resources
└── prompts/
└── triage_prompts.py # Structured DFIR workflowsAvailable Tools
5 toolscheck_threat_intelB
Queries threat intelligence databases (with safe offline fixture fallback) for a file hash.
| Name | Required | Description | Default |
|---|---|---|---|
| case_id | No | CASE-DEFAULT | |
| file_hash | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It discloses a safe offline fixture fallback, implying reliability. However, it does not mention if the tool is read-only, whether it may hit external APIs, or any latency implications.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is one clear sentence, front-loading the primary action and key detail about fallback. No wasted words. Could slightly improve by adding context about parameters.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool invokes an external database query with fallback, has 2 parameters (one unexplained), and an output schema exists, the description is adequate but incomplete. It should clarify the return value (the output schema may help, but it's not referenced).
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, meaning the schema provides no descriptions. The description only mentions 'file_hash' implicitly (says 'for a file hash') but fails to explain the purpose of 'case_id' or its default value. This is a significant gap.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool queries threat intelligence databases for a file hash, and mentions a safe offline fixture fallback. The verb 'queries' and resource 'threat intelligence databases' are specific. However, it does not differentiate from the sibling 'scan_iocs', which may also query threat intel.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives like 'scan_iocs'. The description does not state prerequisites, context (e.g., only for certain hash types), or when to avoid it.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
extract_metadataB
Extracts file metadata, computes cryptographic hashes (MD5, SHA-1, SHA-256, SHA-512), and detects MIME-type masquerading.
| Name | Required | Description | Default |
|---|---|---|---|
| case_id | No | CASE-DEFAULT | |
| file_path | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must fully disclose behavioral traits. It correctly indicates that the tool computes multiple hash types and detects MIME-type masquerading—both are non-obvious and valuable. However, it does not mention whether the tool modifies the file, requires network access, or what happens if the file is missing. The absence of annotations means the bar is higher, and this description just meets the minimum by covering key side effects.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, information-dense sentence that front-loads the core action ('Extracts file metadata') and then lists specific capabilities (hash types, masquerading detection). No extraneous words or redundancy exist. Every phrase adds value.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (multiple hash computations, masquerading detection) and that an output schema exists, the description provides an overview but omits important details like whether hashes are returned as hex strings, what MIME-type detection criteria are used, or the behavior for invalid paths. With no annotations, the description carries more burden and is only partially complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema coverage is 0%, meaning neither parameter has a description in the schema. The tool description mentions 'file_path' indirectly by specifying 'Extracts file metadata', but it does not explain the 'case_id' parameter at all. Two out of two parameters lack documentation, and the description adds no value for 'case_id'. The baseline expectation is higher given zero schema coverage, so this is insufficient.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly identifies the tool's purpose: extracting file metadata and computing cryptographic hashes. It specifies the resources (file metadata, hashes) and the action (extracts), and the mention of MIME-type masquerading detection adds a distinguishing feature. However, it lacks explicit differentiation from sibling tools like 'extract_strings', which might also work on files, leaving some ambiguity.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives like 'extract_strings' or 'scan_iocs'. It does not mention prerequisites (e.g., file must exist on disk), error scenarios (e.g., unsupported file types), or when it is inappropriate to use. The context signals include sibling names, but the description itself fails to help the agent choose correctly.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
extract_stringsC
Extracts printable ASCII & Unicode strings from an evidence artifact.
| Name | Required | Description | Default |
|---|---|---|---|
| case_id | No | CASE-DEFAULT | |
| file_path | Yes | ||
| min_length | No | ||
| max_results | No | ||
| pattern_filter | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries full burden for behavioral disclosure. It only states the basic extraction function but omits critical details such as whether the operation is read-only, how results are returned, edge cases like missing files, or any performance implications.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise (10 words, single sentence), but this conciseness sacrifices essential information. It lacks structure and reads as a fragment, failing to earn its place when more detail is needed.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has 5 parameters, no schema descriptions, and an available but unused output schema, the description is woefully incomplete. It does not address parameter roles, return value format, or how to interpret results, leaving the agent with insufficient context to use the tool effectively.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The description adds no information about any of the 5 parameters (case_id, file_path, min_length, max_results, pattern_filter). Since schema description coverage is 0%, the description fails to compensate, leaving the agent without any semantic understanding of required or optional inputs.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action (extracts), the resource (printable ASCII & Unicode strings), and the source (evidence artifact). It effectively distinguishes from sibling tools like extract_metadata and scan_iocs.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives. There is no mention of appropriate contexts, prerequisites, or exclusions, which is critical for an agent to decide between extract_strings and siblings like extract_metadata.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
scan_iocsC
Scans an evidence artifact for Indicators of Compromise: IPs, C2 URLs, email addresses, suspicious commands, and Base64 payloads.
| Name | Required | Description | Default |
|---|---|---|---|
| case_id | No | CASE-DEFAULT | |
| file_path | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden. It lists the types of IOCs scanned but does not disclose whether scanning is read-only, destructive, or has side effects. No mention of permissions, runtime characteristics, or error behavior.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single sentence, 22 words, front-loads the action and lists IOC categories. No wasted text; every part contributes to understanding the tool's core function.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
While an output schema exists, the description omits essential context: file format support, size limits, relationship to case_id (e.g., required if multiple cases), and how results are structured. Incomplete for an agent to use confidently.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, so the description must compensate. It adds zero explanation for either parameter (file_path, case_id). The agent cannot infer what case_id is for or what format file_path expects.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it scans an evidence artifact for Indicators of Compromise and lists specific IOC types (IPs, C2 URLs, emails, commands, Base64). This differentiates it from siblings like extract_metadata and check_threat_intel, though it does not explicitly contrast them.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus the siblings. It does not specify prerequisites, contexts, or limitations (e.g., file types, size, or that it should be used before checking threat intel).
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
system_health_checkA
Inspects real-time host forensic capability readiness, storage, and chain-of-custody status.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description bears full responsibility. It explicitly says 'inspects' (not modifies or deletes), and outlines three specific areas (capability readiness, storage, chain-of-custody). This is transparent about the non-destructive, read-only nature of the tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence with 13 words, front-loading the key verb 'inspects' and then listing the three areas. There is no waste; every word contributes to the purpose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description covers the tool's purpose and scope sufficiently for a zero-parameter, read-only health check tool. The output schema exists but the description doesn't need to explain return values. It could mention that the output schema details the health status, but overall it's complete for the tool's simplicity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, and there are zero parameters. The description doesn't need to elaborate on parameters since there are none, but it does explain what the tool inspects, adding value beyond the empty schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it inspects 'real-time host forensic capability readiness, storage, and chain-of-custody status'. This provides a specific verb ('inspects') and a noun ('host forensic capability') that distinguishes it from sibling tools like scan_iocs or extract_metadata.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies this is a diagnostic/readiness check for forensic hosts, distinct from sibling tools that deal with extracted data or IOCs. It doesn't explicitly state when not to use it, but given its clear purpose and the zero-parameter input, the context is well-understood.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
5 tool updates
v0.1.0- First observed
check_threat_intel - First observed
extract_metadata - First observed
extract_strings - First observed
scan_iocs - First observed
system_health_check
TDQS
Scored across 5 tools
Each tool targets a distinct forensic task: system readiness, metadata extraction, string extraction, IOC scanning, and threat intel lookup. There is no functional overlap, and the descriptions clearly delineate their purposes.
All tool names follow a consistent verb_noun pattern (e.g., system_health_check, extract_metadata, scan_iocs), using snake_case throughout. The naming is predictable and aligns with forensic terminology.
Five tools is appropriate for a forensic server covering host readiness, file analysis, and threat detection. Each tool serves a necessary function without redundancy or gaps in the core workflow.
The toolset covers essential forensic steps: health check, metadata extraction, string extraction, IOC scanning, and threat intel. A minor gap is the absence of a tool for parsing specific artifact types (e.g., registry hives or logs), but the set is sufficient for basic evidence triage.
Maintenance
Related MCP Connectors
Discover, invoke, and trustlessly verify ForceDream AI agents with cryptographic proofs. 17 tools.
Persistent memory and knowledge management for AI agents with semantic search and 50+ tools.
Hyperion — MCP tool marketplace for AI agents: web, OSINT, security, research via one key.
A registry of AI agent tools — MCP servers, APIs, CLIs, SDKs — kept current by automated ingestion.
Related MCP Servers
- 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
- AlicenseNot gradedqualityBmaintenanceEnables autonomous digital forensics and incident response through 21 typed forensic tools covering disk, memory, registry, network, timeline, carving, and patterns, integrated with AI-driven reasoning and self-correction.MIT
- AlicenseNot gradedqualityBmaintenanceEnables autonomous digital forensics and incident response by wrapping SIFT Workstation tools as MCP tools and orchestrating a multi-agent AI pipeline for evidence analysis and remediation planning.2MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to conduct evidence-grounded forensic triage of compromised hosts, with architectural safeguards against evidence spoliation and hallucinated findings, supporting self-correction and chain of custody.MIT