新增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,36 @@
import { z } from "zod";
import { formatErrorForMcp } from "../utils/errors.js";
export function registerExportTools(server, godot) {
server.tool("list_export_presets", "List all export presets configured in export_presets.cfg", {}, async () => {
try {
const result = await godot.sendCommand("list_export_presets");
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
}
catch (e) {
return { content: [{ type: "text", text: formatErrorForMcp(e) }], isError: true };
}
});
server.tool("export_project", "Get the export command for a preset (direct export from editor is not supported in Godot 4)", {
preset_name: z.string().optional().describe("Export preset name"),
preset_index: z.number().optional().describe("Export preset index (alternative to name)"),
debug: z.boolean().optional().describe("Debug export (default: true)"),
}, async (params) => {
try {
const result = await godot.sendCommand("export_project", 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_export_info", "Get export-related project info (executable path, templates, project path)", {}, async () => {
try {
const result = await godot.sendCommand("get_export_info");
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
}
catch (e) {
return { content: [{ type: "text", text: formatErrorForMcp(e) }], isError: true };
}
});
}
//# sourceMappingURL=export-tools.js.map