cheatengine 5.8.10 → 5.8.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/README_CN.md +1 -1
- package/bin/cheatengine +25 -3
- package/ce_mcp_server.py +8 -9
- package/package.json +1 -1
package/README.md
CHANGED
package/README_CN.md
CHANGED
package/bin/cheatengine
CHANGED
|
@@ -1,15 +1,37 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Cheat Engine MCP Server - NPX wrapper
|
|
4
4
|
* 调用Python运行ce_mcp_server.py
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
const { spawn } = require('child_process');
|
|
8
8
|
const path = require('path');
|
|
9
|
+
const fs = require('fs');
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
// 找到包根目录(兼容 npx/npm install 各种情况)
|
|
12
|
+
function findPackageRoot() {
|
|
13
|
+
// 方法1: 通过 package.json 定位
|
|
14
|
+
try {
|
|
15
|
+
const pkgPath = require.resolve('cheatengine/package.json');
|
|
16
|
+
return path.dirname(pkgPath);
|
|
17
|
+
} catch (e) {
|
|
18
|
+
// 方法2: 通过当前文件相对路径
|
|
19
|
+
return path.join(__dirname, '..');
|
|
20
|
+
}
|
|
21
|
+
}
|
|
11
22
|
|
|
12
|
-
|
|
23
|
+
const packageRoot = findPackageRoot();
|
|
24
|
+
const pythonScript = path.join(packageRoot, 'ce_mcp_server.py');
|
|
25
|
+
|
|
26
|
+
// 验证Python脚本存在
|
|
27
|
+
if (!fs.existsSync(pythonScript)) {
|
|
28
|
+
console.error('[cheatengine] 错误: 找不到 ce_mcp_server.py');
|
|
29
|
+
console.error('查找路径:', pythonScript);
|
|
30
|
+
console.error('包根目录:', packageRoot);
|
|
31
|
+
process.exit(1);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// 检测Python命令
|
|
13
35
|
const pythonCmd = process.platform === 'win32' ? 'python' : 'python3';
|
|
14
36
|
|
|
15
37
|
const proc = spawn(pythonCmd, [pythonScript], {
|
package/ce_mcp_server.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
2
|
# -*- coding: utf-8 -*-
|
|
3
|
-
"""
|
|
3
|
+
"""Cheat Engine MCP Server - Named pipe bridge to Cheat Engine"""
|
|
4
4
|
|
|
5
5
|
import concurrent.futures
|
|
6
6
|
import io
|
|
@@ -274,7 +274,6 @@ class MetricsCollector:
|
|
|
274
274
|
|
|
275
275
|
# ============ Config ============
|
|
276
276
|
class Config:
|
|
277
|
-
VERSION = "5.8.4"
|
|
278
277
|
PIPE_NAME = r"\\.\pipe\{}".format(
|
|
279
278
|
os.environ.get("CE_MCP_PIPE_NAME", "ce_mcp_bridge")
|
|
280
279
|
)
|
|
@@ -296,7 +295,7 @@ class Logger:
|
|
|
296
295
|
def log(msg: str, level: str = "INFO"):
|
|
297
296
|
if level == "DEBUG" and not Config.DEBUG:
|
|
298
297
|
return
|
|
299
|
-
sys.stderr.write(f"[
|
|
298
|
+
sys.stderr.write(f"[CheatEngine-MCP-{level}] {msg}\n")
|
|
300
299
|
sys.stderr.flush()
|
|
301
300
|
|
|
302
301
|
@staticmethod
|
|
@@ -447,7 +446,7 @@ class PipeClient:
|
|
|
447
446
|
"""Get user-friendly error message based on Windows error code"""
|
|
448
447
|
messages = {
|
|
449
448
|
winerror.ERROR_FILE_NOT_FOUND: (
|
|
450
|
-
"
|
|
449
|
+
"Cheat Engine MCP Bridge not running. "
|
|
451
450
|
"Load 'ce_mcp_bridge.lua' in CE (Table -> Show Cheat Table Lua Script -> Execute)"
|
|
452
451
|
),
|
|
453
452
|
winerror.ERROR_PIPE_BUSY: "Pipe busy - another client may be connected",
|
|
@@ -724,7 +723,7 @@ class ToolRegistry:
|
|
|
724
723
|
self._register(
|
|
725
724
|
Tool(
|
|
726
725
|
"ce_get_logs",
|
|
727
|
-
"Get log entries from the
|
|
726
|
+
"Get log entries from the Cheat Engine MCP Bridge Lua side. "
|
|
728
727
|
"Returns: {entries: [{timestamp, level, category, message, data}], count}. "
|
|
729
728
|
"Useful for debugging and monitoring bridge operations.",
|
|
730
729
|
"get_logs",
|
|
@@ -2197,7 +2196,7 @@ class CEMCPServer:
|
|
|
2197
2196
|
"1. Open Cheat Engine",
|
|
2198
2197
|
"2. Table -> Show Cheat Table Lua Script",
|
|
2199
2198
|
"3. Paste ce_mcp_bridge.lua content and Execute",
|
|
2200
|
-
"4. Look for '[
|
|
2199
|
+
"4. Look for '[CheatEngine-MCP] Bridge started' message",
|
|
2201
2200
|
]
|
|
2202
2201
|
)
|
|
2203
2202
|
elif e.winerror == winerror.ERROR_PIPE_BUSY:
|
|
@@ -2357,9 +2356,9 @@ class CEMCPServer:
|
|
|
2357
2356
|
"result": {
|
|
2358
2357
|
"protocolVersion": "2024-11-05",
|
|
2359
2358
|
"capabilities": {"tools": {}},
|
|
2360
|
-
"serverInfo": {"name": "
|
|
2359
|
+
"serverInfo": {"name": "cheatengine-mcp-bridge"},
|
|
2361
2360
|
"instructions": (
|
|
2362
|
-
"#
|
|
2361
|
+
"# Cheat Engine MCP - AI Usage Guide\n\n"
|
|
2363
2362
|
"## Tool Selection Decision Tree\n\n"
|
|
2364
2363
|
"### Q: Do I know the address?\n"
|
|
2365
2364
|
"- NO, but can observe value changes -> ce_scan_new workflow (value hunting)\n"
|
|
@@ -2469,7 +2468,7 @@ class CEMCPServer:
|
|
|
2469
2468
|
|
|
2470
2469
|
def run(self):
|
|
2471
2470
|
"""Main server loop"""
|
|
2472
|
-
log.info(f"
|
|
2471
|
+
log.info(f"Cheat Engine MCP Bridge Started. Waiting for input...")
|
|
2473
2472
|
log.info(f"Python version: {sys.version}")
|
|
2474
2473
|
|
|
2475
2474
|
try:
|