新增godot mcp github copilot

This commit is contained in:
2026-05-28 21:00:39 +08:00
parent a550a2675e
commit 18e24d40f0
242 changed files with 33640 additions and 45 deletions

View File

@@ -0,0 +1,25 @@
import { z } from "zod";
import { formatErrorForMcp } from "../utils/errors.js";
export function registerProfilingTools(server, godot) {
server.tool("get_performance_monitors", "Get all Godot performance monitors (FPS, memory, draw calls, physics, navigation, etc.)", {
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