SOLVE-IT MCP服务器
总结:这个项目是 MCP(模型上下文协议) 该服务器封装了数字取证知识库及其内置库,以便为LLM提供对SOLVE-IT内容的编程访问。相关存储库包括:
- SOLVE-IT:提供数字取证技术的结构化分类,影响证据可靠性的弱点,以及解决这些弱点的缓解措施。此服务器公开了用于查询、导航和搜索该知识库的工具。可以在这里找到: SOLVE-IT
- MCP服务器机箱:此MCP服务器基于MCP服务器机箱项目构建,该项目提供了一个可扩展的通用MCP服务器,旨在易于分叉并用于各种目的。可以在这里找到: MCP服务器机箱
快速开始
1.安装依赖项
选项1:
pip install "mcp>=1.6.0,/solve-it-main"5.运行MCP服务器
备注:如果您的MCP客户端在连接到服务器时运行服务器,则不需要手动运行服务器,例如下面步骤6中的示例。
示例1:
python3 run.py --config config/default.toml示例2:
python -m mcp_chassis6.配置您的MCP客户端
配置您的MCP客户端以连接到MCP服务器。在某些情况下(例如Claude Desktop),客户端也会启动MCP服务器。
克劳德桌面配置示例:
示例文件: claude_desktop_config.json \ 示例路径(macOS): ~/Library/Application Support/Claude/claude_desktop_config.json):
示例配置:
{
"mcpServers": {
"solveit": {
"command": "python3",
"args": ["/path/to/mcp_server/run.py", "--config", "/path/to/mcp_server/config/default.toml"]
}
}
}可用的MCP工具
查找(3个工具)
| 工具 | 说明 |
|---|---|
solveit_get_technique | 按ID检索单一技术的完整详细信息 |
solveit_get_weakness | 按ID检索单个弱点的完整详细信息 |
solveit_get_mitigation | 按ID检索单个缓解措施的完整详细信息 |
摘要列表(3个工具)
| 工具 | 说明 |
|---|---|
solveit_list_techniques | 列出所有带有ID和名称的技术 |
solveit_list_weaknesses | 列出所有带有ID和名称的弱点 |
solveit_list_mitigations | 列出所有缓解措施及其ID和名称 |
目标(2个工具)
| 工具 | 说明 |
|---|---|
solveit_list_objectives | 列出主动映射中定义的所有法医目标 |
solveit_get_techniques_for_objective | 列出根据给定目标分类的技术 |
关系(5个工具)
| 工具 | 说明 |
|---|---|
solveit_get_weaknesses_for_technique | 列出影响给定技术的弱点 |
solveit_get_mitigations_for_weakness | 列出解决给定弱点的缓解措施 |
solveit_get_techniques_for_weakness | 列出受特定弱点影响的技术 |
solveit_get_weaknesses_for_mitigation | 列出给定缓解措施所解决的弱点 |
solveit_get_techniques_for_mitigation | 列出与特定缓解措施相关的技术 |
搜索(1个工具)
| 工具 | 说明 |
|---|---|
solveit_search | 跨技术、弱点和缓解措施的全文搜索 |
扩展信息(1个工具)
| 工具 | 说明 |
|---|---|
solveit_list_loaded_extensions | 列出当前加载的任何SOLVE-IT-X扩展数据集 |
引文(2个工具)
| 工具 | 说明 |
|---|---|
solveit_get_citation | 通过引用的DFCite ID检索引用 |
solveit_list_citations | 列出知识库中的所有引用ID |
状态(1个工具)
| 工具 | 说明 |
|---|---|
solveit_status | 报告数据加载状态、项目计数(包括引用)和活动配置 |
完整详细列表
注: 由于这些工具返回的数据量很大,因此默认情况下禁用这些工具。它们可以在中启用 config/default.toml.
| 工具 | 说明 |
|---|---|
solveit_list_techniques_full_detail | 列出所有技术,并附上完整的现场数据 |
solveit_list_weaknesses_full_detail | 列出所有弱点,并附上完整的现场数据 |
solveit_list_mitigations_full_detail | 列出所有缓解措施,并附上完整的现场数据 |
配置
这 [app] 部分 config/default.toml 控制SOLVE IT特定设置。顶层 [app] 键也可以被环境变量覆盖 MCP_APP_ 前缀(env变量优先于TOML值):
| 环境变量 | 配置键 | 类型 |
|---|---|---|
MCP_APP_SOLVEIT_DATA_PATH | solveit_data_path | 字符串 |
MCP_APP_OBJECTIVE_MAPPING | objective_mapping | 字符串 |
MCP_APP_ENABLE_EXTENSIONS | enable_extensions 布尔 (true/false/1/0/yes/no) | |
MCP_APP_INIT_REQUIRED | init_required bool的。 | |
MCP_APP_ENABLE_FULL_DETAIL_TOOLS | enable_full_detail_tools bool的。 |
[app]
# Path to the SOLVE-IT repository root (absolute or relative to CWD).
solveit_data_path = "/
///solve-it-main"
# Objective mapping file (must exist in the SOLVE-IT data/ directory).
# Default: "solve-it.json" (the standard SOLVE-IT categorization).
# Custom mapping files can be placed in the data/ directory to provide
# alternative categorizations of techniques into objectives.
# See: https://custom-viewer.solveit-df.org
objective_mapping = "solve-it.json"
# Whether to load SOLVE-IT-X extension data.
enable_extensions = true
# If true (default), the server exits immediately when the KB fails to load.
# If false, the server starts in degraded mode with only solveit_status available.
init_required = true
# Enable full-detail listing tools (large payloads, disabled by default).
# WARNING: These tools return the entire dataset for a given type and may
# consume significant LLM context. You may also need to increase
# [security.io_limits] max_response_size when enabling this.
enable_full_detail_tools = false
[app.search]
# Each flag controls whether the corresponding parameter is exposed
# in the solveit_search tool's schema. When disabled, the default
# value is used: item_types=all, substring_match=false, search_logic="AND"
enable_item_types_filter = true
enable_substring_match = true
enable_search_logic = truesolveit_data_path --克隆的SOLVE-IT存储库的路径。服务器启动时,接受绝对路径或相对于工作目录的路径。
objective_mapping --JSON映射的文件名,将技术分类为取证目标。必须存在于SOLVE-IT中 data/ 目录。默认值 solve-it.json 反映了官方的分类。
enable_extensions --何时 true,服务器加载存储库中找到的任何SOLVE-IT-X扩展数据集。
init_required --何时 true (默认设置),如果知识库加载失败,服务器将退出并显示一个明确的错误。当 false,服务器以降级模式启动,仅 solveit_status 可用,报告负载故障。设置为 false 在开发过程中,如果您需要在没有有效KB数据的情况下测试服务器行为。
enable_full_detail_tools --控制是否注册三个完整详细信息列表工具。启用前请参阅以下部分。
搜索参数标志 --三个 [app.search] 标记每个控件对应的参数是否出现在 solveit_search 工具模式。当旗帜 false,参数隐藏,默认值以静默方式应用: item_types 默认为所有类型, substring_match 默认为 false (单词边界匹配),以及 search_logic 默认为 "AND".
启用完整详细信息工具
集 enable_full_detail_tools = true 在 config/default.toml 注册三个完整的详细列表工具。
警告: 这些工具在单个响应中返回整个项目类型的完整数据集。根据SOLVE-IT数据的大小和任何加载的扩展,响应可能非常大,并可能占用LLM上下文窗口的很大一部分。如果启用这些工具,您可能还需要提高响应大小限制:
[security.io_limits]
max_response_size = 20971520 # 20 MB; default is 5 MB安全
安全行为继承自构建此MCP服务器的MCP服务器机箱。每个工具请求都按以下顺序通过中间件管道:
I/O limits → Auth → Rate limit → Sanitize → Validate通过此管道,可以在输入到达工具处理程序之前对其进行消毒尝试。默认安全配置文件为 moderate.
重要:这些保护是默认情况下提供一些安全性的基本尝试。如果您决定在生产环境中使用此服务器,我们建议您仍然执行安全测试并修改此项目的代码,以根据您的威胁环境和风险承受能力实施适当的安全缓解措施。
| 配置文件 | 速率限制 | I/O限制 | 消毒 | 错误详细信息 |
|---|---|---|---|---|
strict | 60 rpm全局,30 rpm/工具 | 需要1 MB,分别为5 MB | 完整(路径遍历、外壳元图、控制字符) | 通用 |
moderate | 120 rpm全局,60 rpm/工具 | 需要5 MB,分别为20 MB | 路径遍历+控制字符 | 详细信息 |
permissive | 禁用 | 50 MB请求/响应 | 仅限空字节 | 详细信息 |
活动配置文件是通过以下方式设置的 [security] profile 在 config/default.toml,其中各个设置可用于覆盖指定配置文件的元素。此外,default.toml中设置的配置文件可以用以下命令覆盖 MCP_SECURITY_PROFILE 环境变量。
测试
python -m pytest tests/ # All tests
python -m pytest tests/unit/ # Unit tests only
python -m pytest tests/integration/ # Integration tests only项目结构
src/mcp_chassis/
server.py — ChassisServer: central orchestrator
config.py — Configuration dataclasses and TOML loading
__main__.py — CLI entry point
extensions/
solveit_init.py — Initializes the SOLVE-IT data loader on startup
tools/
solveit_tools.py — All 21 SOLVE-IT tool registrations and handlers
middleware/
pipeline.py — Security middleware pipeline
security/ — Rate limiting, sanitization, validation, profiles
transport/ — Stdio transport (production)
config/
default.toml — Server and application configuration
tests/
unit/ — Unit tests
integration/ — Integration tests (stdio subprocess)
docs/
ARCHITECTURE.md — Component design and data flow
TROUBLESHOOTING.md — Common issues and fixes与MCP客户端一起使用
该项目包括 run.py 自动处理Python路径设置的启动器。对两者都使用绝对路径 run.py 和 --config 因此,无论客户端的工作目录如何,服务器都能正常工作。
先决条件: Python依赖项必须安装在运行服务器的计算机上:
cd /path/to/mcp_server
pip install "mcp>=1.2.0,<2.0" pydantic pybtex # minimum dependencies在配置客户端之前,请设置 solveit_data_path 在 config/default.toml 到绝对路径:
[app]
solveit_data_path = "/absolute/path/to/solve-it/solve-it-main"克劳德代码
添加到您的项目 .mcp.json:
{
"mcpServers": {
"solveit": {
"type": "stdio",
"command": "python3",
"args": ["/path/to/mcp_server/run.py", "--config", "/path/to/mcp_server/config/default.toml"]
}
}
}克劳德桌面
添加 claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"solveit": {
"command": "python3",
"args": ["/path/to/mcp_server/run.py", "--config", "/path/to/mcp_server/config/default.toml"]
}
}
}替代方案:使用 pip install
如果你不想使用 run.py,安装软件包并使用 -m 直接:
pip install -e .{
"mcpServers": {
"solveit": {
"command": "python3",
"args": ["-m", "mcp_chassis", "--config", "/path/to/mcp_server/config/default.toml"]
}
}
}