Files
spellforge/Tools/godot-mcp-pro/server/build/tools/profiling-tools.js
T
joywayerandClaude Opus 4.8 e65066a8fb chore: 重命名 Tools/godot-mcp-pro-v1.15.1 → Tools/godot-mcp-pro,更新 .mcp.json
- 去掉版本号后缀,路径更稳定(后续更新工具不必再改 .mcp.json)
- .mcp.json 指向新路径 server/build/index.js
- server 依赖已 npm install 就绪;node_modules 由 .gitignore 忽略,未入库

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-20 15:37:18 +08:00

25 lines
1.4 KiB
JavaScript

import { z } from "zod";
import { formatErrorForMcp } from "../utils/errors.js";
export function registerProfilingTools(server, godot) {
server.tool("get_performance_monitors", "Get the RUNNING GAME's performance monitors (FPS, memory, draw calls, physics, navigation, etc.). Requires a scene to be playing (play_scene). For editor-process metrics use get_editor_performance.", {
category: z.string().optional().describe("Filter by category prefix: 'fps', 'memory', 'render', 'physics_2d', 'physics_3d', 'navigation'"),
}, async (params) => {
try {
const result = await godot.sendCommand("get_performance_monitors", params);
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
}
catch (e) {
return { content: [{ type: "text", text: formatErrorForMcp(e) }], isError: true };
}
});
server.tool("get_editor_performance", "Get a quick performance summary (FPS, frame time, draw calls, memory usage)", {}, async () => {
try {
const result = await godot.sendCommand("get_editor_performance");
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
}
catch (e) {
return { content: [{ type: "text", text: formatErrorForMcp(e) }], isError: true };
}
});
}
//# sourceMappingURL=profiling-tools.js.map