解压缩.me MCP服务器
MCP(模型上下文协议)服务器,提供与 decomp.me API该服务器允许像Claude这样的人工智能助手通过获取划痕、编译代码、分析差异和迭代改进来帮助进行视频游戏反编译项目。
特性
- 抓取划痕:加载所有上下文(源代码、目标程序集、编译器设置、标头)的反编译划痕
- 编译与差异:编译修改后的源代码,并使用匹配分数获得详细的汇编差异
- 搜索:通过高级筛选,按查询、平台或其他条件查找划痕和预设
- 上下文搜索:搜索大量头文件(45k+行)以查找类型定义和结构布局
- 编译器信息:列出不同平台的可用编译器及其配置
安装
先决条件
- Python 3.10或更高版本
- 紫外线 (推荐)或pip
使用紫外线进行安装(推荐)
# Clone or navigate to the repository
cd decomp-mcp-server
# Create a virtual environment and install
uv venv
uv pip install -e .使用pip安装
cd decomp-mcp-server
pip install -e .配置
将MCP服务器添加到您的Claude Desktop或其他MCP客户端配置中。
Claude桌面配置
编辑您的Claude Desktop配置文件:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
视窗: %APPDATA%\Claude\claude_desktop_config.json
添加服务器配置:
{
"mcpServers": {
"decomp": {
"command": "/Users/YOUR_USERNAME/decomp-mcp-server/.venv/bin/python",
"args": [
"-m",
"decomp_mcp.server"
]
}
}
}备注:替换 /Users/YOUR_USERNAME/decomp-mcp-server/.venv/bin/python 虚拟环境中Python解释器的实际路径。
要找到正确的路径,请运行:
cd ~/decomp-mcp-server
source .venv/bin/activate
which python可用工具
1. decomp_get_scratch
通过URL或slug从decomp.me中获取划痕。
参数:
url_or_slug(string,必填):decompo.me scratch URL(例如。,https://decomp.me/scratch/Jwtky)或者仅仅是蛞蝓(例如。,Jwtky)
例子:
Get scratch Jwtky from decomp.me退货:
- 平台和编译器信息
- 当前比赛得分
- 完整的源代码
- 编译器标志和设置
2. decomp_compile
编译源代码并获得一个差异,显示它与目标程序集的匹配程度。
参数:
url_or_slug(字符串,必填):decomp.me抓取URL或slugsource_code(字符串,可选):修改了要编译的源代码。如果没有提供,则从头开始编译现有代码。
例子:
Compile scratch Jwtky with this modified code: [paste code here]退货:
- 比赛得分(当前/最高)
- 显示匹配和不匹配指令的详细装配差异
- 编译错误(如有)
3. decomp_get_compilers
列出一个平台或所有平台的可用编译器。
参数:
platform(字符串,可选):平台ID(例如。,gc_wii,n64,ps1,ps2,switch)
例子:
Show me the available compilers for GameCube/Wii退货:
- 按平台列出的编译器
- 编译器ID和默认标志
4. decomp_search
使用高级过滤功能在decomp.me上搜索划痕和预设。
参数:
query(字符串,可选):搜索查询(搜索函数名称、描述等)platform(字符串,可选):按平台过滤(例如。,gc_wii,n64)only_incomplete(boolean,可选):仅显示不完全匹配的划痕min_match_percent(数字,可选):最小匹配百分比(0-100)max_match_percent(数字,可选):最大匹配百分比(0-100)sort_by(字符串,可选):排序方式match_percent,last_updated,或creation_timelimit(整数,可选):最大结果(默认值:10)
示例:
Search decomp.me for Melee item functionsFind scratches for Super Smash Bros that are between 70-90% matchedShow me the most recent incomplete GameCube scratches退货:
- 项目预设(如果与搜索查询匹配)
- 与URL匹配的划痕列表
- 匹配百分比和分数
- 平台、编译器和所有者信息
5. decomp_search_context
在草稿的上下文(头文件)中搜索类型定义、结构定义、函数声明或其他模式。对于在海量上下文文件中查找类型至关重要。
参数:
url_or_slug(字符串,必填):decomp.me抓取URL或slugpattern(字符串,必填):要搜索的正则表达式模式或文本context_lines(整数,可选):每个匹配项周围的上下文行数(默认值:3)max_results(整数,可选):最大匹配数(默认值:20)
例子:
Search the context of scratch Jwtky for the Item struct definition退货:
- 将线条与周围环境相匹配
- 行号便于参考
- 匹配图案的亮点
使用示例
一旦配置了Claude Desktop或其他MCP客户端,您就可以自然地进行交互:
基本工作流程
- 加载划痕:
Load scratch https://decomp.me/scratch/Jwtky- 分析代码:
What could be improved in this decompilation to get a better match?- 测试更改:
Try compiling this scratch with the temp variables consolidated- 迭代:
The score improved! Now let's try adjusting the cast on line 8高级示例
寻找相关工作:
Search for other Melee item-related scratches on GameCube探索编译器:
What compilers are available for Nintendo 64?分析差异:
Load scratch ABC123 and explain why the assembly doesn't match发展
运行测试
cd decomp-mcp-server
source .venv/bin/activate
python test_server.py项目结构
decomp-mcp-server/
├── src/
│ └── decomp_mcp/
│ ├── __init__.py
│ └── server.py # Main MCP server implementation
├── pyproject.toml # Project dependencies and metadata
├── test_server.py # API integration tests
└── README.md # This file贡献
欢迎投稿!需要改进的地方:
- 添加对通过API创建新刮痕的支持
- 对频繁访问的划痕实施缓存
- 添加更详细的差异分析和建议
- 支持批量操作
- 与本地反编译项目集成
资源
许可证
MIT许可证-有关详细信息,请参阅许可证文件
致谢
- decode.me团队构建了一个令人惊叹的反编译平台
- 电子游戏反编译社区
- 创建模型上下文协议的拟人化
