Skip to main content

Memory Scanner MCP

基于 pymem 的内存扫描与修改 MCP 服务器。

通过 MCP 协议将内存读写、扫描、特征码搜索等能力暴露给 AI Agent,实现自然语言驱动的内存修改。

功能

工具 说明
list_processes 列出运行中的进程
attach_process 附加到目标进程
detach_process 断开进程连接
get_process_info 获取进程详细信息和模块列表
read_memory 读取指定地址的值
write_memory 写入值到指定地址
scan_memory_first 首次扫描(全内存搜索)
scan_memory_next 再次扫描(缩小范围)
scan_memory_filter 条件过滤(大于/小于等)
write_scan_results 批量写入扫描结果
get_scan_results 查看扫描结果及当前值
scan_pattern AOB/特征码扫描(支持通配符)
get_module_base 获取模块基地址
read_pointer_chain 多级指针链读取
write_pointer_chain 多级指针链写入
dump_memory 内存转储(Hex + ASCII)
freeze_address 冻结地址值
unfreeze_address 解除冻结
apply_frozen 执行冻结写入
list_frozen 列出冻结列表

支持的数据类型

int8 int16 int32 int64 uint8 uint16 uint32 uint64 float double string bytes

安装

从源码安装(推荐开发使用)

git clone https://github.com/miloira/MemoryScaner.git
cd MemoryScaner
pip install -e .

直接安装

pip install memory-scanner-mcp

需要 Python 3.10+,仅支持 Windows。

使用方式

作为命令行工具运行

memory-scanner-mcp

作为 Python 模块运行

python -m memory_scanner

MCP 客户端配置

推荐使用 uvx(无需手动安装):

{
  "mcpServers": {
    "memory-scanner": {
      "command": "uvx",
      "args": ["memory-scanner-mcp"]
    }
  }
}

也可以先 pip install 后直接使用命令:

{
  "mcpServers": {
    "memory-scanner": {
      "command": "memory-scanner-mcp"
    }
  }
}

或者使用 Python 模块方式:

{
  "mcpServers": {
    "memory-scanner": {
      "command": "python",
      "args": ["-m", "memory_scanner"]
    }
  }
}

项目结构

MemoryScaner/
├── pyproject.toml          # 项目配置与依赖管理
├── README.md
├── LICENSE
└── src/
    └── memory_scanner/
        ├── __init__.py     # 包初始化与版本号
        ├── __main__.py     # python -m memory_scanner 入口
        └── server.py       # MCP 服务器实现(所有工具定义)

使用示例

典型的内存修改流程(以游戏修改为例):

  1. 附加进程: "附加到 game.exe"
  2. 首次扫描: "搜索 int32 类型的值 100"(当前血量为100)
  3. 改变值: 在游戏中让血量变化
  4. 再次扫描: "搜索新的值 95"(血量变为95)
  5. 重复缩小: 直到结果只剩1-2个
  6. 修改值: "把找到的地址写入 9999"
  7. 冻结: "冻结这个地址为 9999"

开发

# 克隆项目
git clone https://github.com/miloira/MemoryScaner.git
cd MemoryScaner

# 创建虚拟环境
python -m venv .venv
.venv\Scripts\activate

# 安装开发依赖(可编辑模式)
pip install -e .

注意事项

  • 必须以 管理员权限 运行才能读写其他进程的内存
  • 部分进程有保护机制,可能无法正常读写
  • 冻结功能需要客户端定期调用 apply_frozen 来维持
  • 扫描大量内存时可能需要较长时间

许可证

MIT

Release files for memory-scanner-mcp 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for memory-scanner-mcp 0.0.3
File Size Uploaded
memory_scanner_mcp-0.0.3.tar.gz 16.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for memory-scanner-mcp 0.0.3
File Interpreter ABI Platform
memory_scanner_mcp-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 31.6 kB

Release files / memory_scanner_mcp-0.0.3.tar.gz

Download URL memory_scanner_mcp-0.0.3.tar.gz
Size 16.1 kB
Tags Source
SHA-256 checksum
How to use checksums
e4f465865026e48d14b1f98cfb3d3cdcd3632ee4db1c83796344385ff3f20712
BLAKE2b-256 checksum
How to use checksums
96ab503fc4c19fb2cdbcb1a4003b68f8d4f58356ea2bc3a6cee7eec23d6e51df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.30 {"installer":{"name":"uv","version":"0.11.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / memory_scanner_mcp-0.0.3-py3-none-any.whl

Download URL memory_scanner_mcp-0.0.3-py3-none-any.whl
Size 15.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7d1c8f6c25d44e0a09fd27dec73b7a2e77149d548481aca7d581abbfde4dd341
BLAKE2b-256 checksum
How to use checksums
7b30f9ca58cca57e0d1d3929638250419c82a521e8010d293eb1f46adff9ce30
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.30 {"installer":{"name":"uv","version":"0.11.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page