@satelliteoflove/godot-mcp 0.1.0
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/dist/__tests__/registry.test.d.ts +2 -0
- package/dist/__tests__/registry.test.d.ts.map +1 -0
- package/dist/__tests__/registry.test.js +116 -0
- package/dist/__tests__/registry.test.js.map +1 -0
- package/dist/__tests__/schema.test.d.ts +2 -0
- package/dist/__tests__/schema.test.d.ts.map +1 -0
- package/dist/__tests__/schema.test.js +67 -0
- package/dist/__tests__/schema.test.js.map +1 -0
- package/dist/connection/protocol.d.ts +103 -0
- package/dist/connection/protocol.d.ts.map +1 -0
- package/dist/connection/protocol.js +34 -0
- package/dist/connection/protocol.js.map +1 -0
- package/dist/connection/websocket.d.ts +33 -0
- package/dist/connection/websocket.d.ts.map +1 -0
- package/dist/connection/websocket.js +203 -0
- package/dist/connection/websocket.js.map +1 -0
- package/dist/core/define-resource.d.ts +9 -0
- package/dist/core/define-resource.d.ts.map +1 -0
- package/dist/core/define-resource.js +4 -0
- package/dist/core/define-resource.js.map +1 -0
- package/dist/core/define-tool.d.ts +9 -0
- package/dist/core/define-tool.d.ts.map +1 -0
- package/dist/core/define-tool.js +4 -0
- package/dist/core/define-tool.js.map +1 -0
- package/dist/core/registry.d.ts +28 -0
- package/dist/core/registry.d.ts.map +1 -0
- package/dist/core/registry.js +70 -0
- package/dist/core/registry.js.map +1 -0
- package/dist/core/schema.d.ts +3 -0
- package/dist/core/schema.d.ts.map +1 -0
- package/dist/core/schema.js +10 -0
- package/dist/core/schema.js.map +1 -0
- package/dist/core/types.d.ts +25 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +2 -0
- package/dist/core/types.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +68 -0
- package/dist/index.js.map +1 -0
- package/dist/resources/index.d.ts +4 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/index.js +10 -0
- package/dist/resources/index.js.map +1 -0
- package/dist/resources/scene.d.ts +4 -0
- package/dist/resources/scene.d.ts.map +1 -0
- package/dist/resources/scene.js +32 -0
- package/dist/resources/scene.js.map +1 -0
- package/dist/resources/script.d.ts +3 -0
- package/dist/resources/script.d.ts.map +1 -0
- package/dist/resources/script.js +19 -0
- package/dist/resources/script.js.map +1 -0
- package/dist/tools/editor.d.ts +28 -0
- package/dist/tools/editor.d.ts.map +1 -0
- package/dist/tools/editor.js +83 -0
- package/dist/tools/editor.js.map +1 -0
- package/dist/tools/index.d.ts +7 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +19 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/node.d.ts +54 -0
- package/dist/tools/node.d.ts.map +1 -0
- package/dist/tools/node.js +84 -0
- package/dist/tools/node.js.map +1 -0
- package/dist/tools/project.d.ts +35 -0
- package/dist/tools/project.d.ts.map +1 -0
- package/dist/tools/project.js +78 -0
- package/dist/tools/project.js.map +1 -0
- package/dist/tools/scene.d.ts +32 -0
- package/dist/tools/scene.d.ts.map +1 -0
- package/dist/tools/scene.js +68 -0
- package/dist/tools/scene.js.map +1 -0
- package/dist/tools/script.d.ts +51 -0
- package/dist/tools/script.d.ts.map +1 -0
- package/dist/tools/script.js +86 -0
- package/dist/tools/script.js.map +1 -0
- package/dist/utils/errors.d.ts +16 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +30 -0
- package/dist/utils/errors.js.map +1 -0
- package/package.json +52 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { defineTool } from '../core/define-tool.js';
|
|
3
|
+
export const getNodeProperties = defineTool({
|
|
4
|
+
name: 'get_node_properties',
|
|
5
|
+
description: 'Get all properties of a node at the specified path',
|
|
6
|
+
schema: z.object({
|
|
7
|
+
node_path: z
|
|
8
|
+
.string()
|
|
9
|
+
.describe('Path to the node (e.g., "/root/Main/Player")'),
|
|
10
|
+
}),
|
|
11
|
+
async execute({ node_path }, { godot }) {
|
|
12
|
+
const result = await godot.sendCommand('get_node_properties', { node_path });
|
|
13
|
+
return JSON.stringify(result.properties, null, 2);
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
export const createNode = defineTool({
|
|
17
|
+
name: 'create_node',
|
|
18
|
+
description: 'Create a new node as a child of an existing node',
|
|
19
|
+
schema: z.object({
|
|
20
|
+
parent_path: z.string().describe('Path to the parent node'),
|
|
21
|
+
node_type: z
|
|
22
|
+
.string()
|
|
23
|
+
.describe('Type of node to create (e.g., "Sprite2D", "CharacterBody2D")'),
|
|
24
|
+
node_name: z.string().describe('Name for the new node'),
|
|
25
|
+
properties: z
|
|
26
|
+
.record(z.unknown())
|
|
27
|
+
.optional()
|
|
28
|
+
.describe('Optional properties to set on the node'),
|
|
29
|
+
}),
|
|
30
|
+
async execute({ parent_path, node_type, node_name, properties }, { godot }) {
|
|
31
|
+
const result = await godot.sendCommand('create_node', {
|
|
32
|
+
parent_path,
|
|
33
|
+
node_type,
|
|
34
|
+
node_name,
|
|
35
|
+
properties: properties ?? {},
|
|
36
|
+
});
|
|
37
|
+
return `Created node: ${result.node_path}`;
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
export const updateNode = defineTool({
|
|
41
|
+
name: 'update_node',
|
|
42
|
+
description: 'Update properties of an existing node',
|
|
43
|
+
schema: z.object({
|
|
44
|
+
node_path: z.string().describe('Path to the node to update'),
|
|
45
|
+
properties: z
|
|
46
|
+
.record(z.unknown())
|
|
47
|
+
.describe('Properties to update (key-value pairs)'),
|
|
48
|
+
}),
|
|
49
|
+
async execute({ node_path, properties }, { godot }) {
|
|
50
|
+
await godot.sendCommand('update_node', { node_path, properties });
|
|
51
|
+
return `Updated node: ${node_path}`;
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
export const deleteNode = defineTool({
|
|
55
|
+
name: 'delete_node',
|
|
56
|
+
description: 'Delete a node from the scene',
|
|
57
|
+
schema: z.object({
|
|
58
|
+
node_path: z.string().describe('Path to the node to delete'),
|
|
59
|
+
}),
|
|
60
|
+
async execute({ node_path }, { godot }) {
|
|
61
|
+
await godot.sendCommand('delete_node', { node_path });
|
|
62
|
+
return `Deleted node: ${node_path}`;
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
export const reparentNode = defineTool({
|
|
66
|
+
name: 'reparent_node',
|
|
67
|
+
description: 'Move a node to a new parent',
|
|
68
|
+
schema: z.object({
|
|
69
|
+
node_path: z.string().describe('Path to the node to move'),
|
|
70
|
+
new_parent_path: z.string().describe('Path to the new parent node'),
|
|
71
|
+
}),
|
|
72
|
+
async execute({ node_path, new_parent_path }, { godot }) {
|
|
73
|
+
await godot.sendCommand('reparent_node', { node_path, new_parent_path });
|
|
74
|
+
return `Moved node ${node_path} to ${new_parent_path}`;
|
|
75
|
+
},
|
|
76
|
+
});
|
|
77
|
+
export const nodeTools = [
|
|
78
|
+
getNodeProperties,
|
|
79
|
+
createNode,
|
|
80
|
+
updateNode,
|
|
81
|
+
deleteNode,
|
|
82
|
+
reparentNode,
|
|
83
|
+
];
|
|
84
|
+
//# sourceMappingURL=node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.js","sourceRoot":"","sources":["../../src/tools/node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAGpD,MAAM,CAAC,MAAM,iBAAiB,GAAG,UAAU,CAAC;IAC1C,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,oDAAoD;IACjE,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,SAAS,EAAE,CAAC;aACT,MAAM,EAAE;aACR,QAAQ,CAAC,8CAA8C,CAAC;KAC5D,CAAC;IACF,KAAK,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,KAAK,EA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,EAAE;QACrD,MAAM,KAAK,CAAC,WAAW,CAAC,eAAe,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC,CAAC;QACzE,OAAO,cAAc,SAAS,OAAO,eAAe,EAAE,CAAC;IACzD,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,iBAAiB;IACjB,UAAU;IACV,UAAU;IACV,UAAU;IACV,YAAY;CACU,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { AnyToolDefinition } from '../core/types.js';
|
|
3
|
+
export declare const getProjectInfo: import("../core/types.js").ToolDefinition<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
|
|
4
|
+
export declare const listProjectFiles: import("../core/types.js").ToolDefinition<z.ZodObject<{
|
|
5
|
+
file_type: z.ZodEnum<["scripts", "scenes", "resources", "images", "audio", "all"]>;
|
|
6
|
+
directory: z.ZodOptional<z.ZodString>;
|
|
7
|
+
recursive: z.ZodOptional<z.ZodBoolean>;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
file_type: "scripts" | "scenes" | "resources" | "images" | "audio" | "all";
|
|
10
|
+
directory?: string | undefined;
|
|
11
|
+
recursive?: boolean | undefined;
|
|
12
|
+
}, {
|
|
13
|
+
file_type: "scripts" | "scenes" | "resources" | "images" | "audio" | "all";
|
|
14
|
+
directory?: string | undefined;
|
|
15
|
+
recursive?: boolean | undefined;
|
|
16
|
+
}>>;
|
|
17
|
+
export declare const searchFiles: import("../core/types.js").ToolDefinition<z.ZodObject<{
|
|
18
|
+
pattern: z.ZodString;
|
|
19
|
+
directory: z.ZodOptional<z.ZodString>;
|
|
20
|
+
}, "strip", z.ZodTypeAny, {
|
|
21
|
+
pattern: string;
|
|
22
|
+
directory?: string | undefined;
|
|
23
|
+
}, {
|
|
24
|
+
pattern: string;
|
|
25
|
+
directory?: string | undefined;
|
|
26
|
+
}>>;
|
|
27
|
+
export declare const getProjectSettings: import("../core/types.js").ToolDefinition<z.ZodObject<{
|
|
28
|
+
category: z.ZodOptional<z.ZodString>;
|
|
29
|
+
}, "strip", z.ZodTypeAny, {
|
|
30
|
+
category?: string | undefined;
|
|
31
|
+
}, {
|
|
32
|
+
category?: string | undefined;
|
|
33
|
+
}>>;
|
|
34
|
+
export declare const projectTools: AnyToolDefinition[];
|
|
35
|
+
//# sourceMappingURL=project.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../src/tools/project.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,eAAO,MAAM,cAAc,2FAazB,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;GAgC3B,CAAC;AAEH,eAAO,MAAM,WAAW;;;;;;;;;GAmBtB,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;GAe7B,CAAC;AAEH,eAAO,MAAM,YAAY,EAKpB,iBAAiB,EAAE,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { defineTool } from '../core/define-tool.js';
|
|
3
|
+
export const getProjectInfo = defineTool({
|
|
4
|
+
name: 'get_project_info',
|
|
5
|
+
description: 'Get information about the current Godot project',
|
|
6
|
+
schema: z.object({}),
|
|
7
|
+
async execute(_, { godot }) {
|
|
8
|
+
const result = await godot.sendCommand('get_project_info');
|
|
9
|
+
return JSON.stringify(result, null, 2);
|
|
10
|
+
},
|
|
11
|
+
});
|
|
12
|
+
export const listProjectFiles = defineTool({
|
|
13
|
+
name: 'list_project_files',
|
|
14
|
+
description: 'List files in the project by type',
|
|
15
|
+
schema: z.object({
|
|
16
|
+
file_type: z
|
|
17
|
+
.enum(['scripts', 'scenes', 'resources', 'images', 'audio', 'all'])
|
|
18
|
+
.describe('Type of files to list'),
|
|
19
|
+
directory: z
|
|
20
|
+
.string()
|
|
21
|
+
.optional()
|
|
22
|
+
.describe('Optional directory to search in (defaults to "res://")'),
|
|
23
|
+
recursive: z
|
|
24
|
+
.boolean()
|
|
25
|
+
.optional()
|
|
26
|
+
.describe('Whether to search recursively (defaults to true)'),
|
|
27
|
+
}),
|
|
28
|
+
async execute({ file_type, directory, recursive }, { godot }) {
|
|
29
|
+
const result = await godot.sendCommand('list_project_files', {
|
|
30
|
+
file_type,
|
|
31
|
+
directory: directory ?? 'res://',
|
|
32
|
+
recursive: recursive ?? true,
|
|
33
|
+
});
|
|
34
|
+
if (result.files.length === 0) {
|
|
35
|
+
return `No ${file_type} files found`;
|
|
36
|
+
}
|
|
37
|
+
return `Found ${result.files.length} ${file_type} file(s):\n${result.files.map((f) => ` - ${f}`).join('\n')}`;
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
export const searchFiles = defineTool({
|
|
41
|
+
name: 'search_files',
|
|
42
|
+
description: 'Search for files by name pattern',
|
|
43
|
+
schema: z.object({
|
|
44
|
+
pattern: z.string().describe('Search pattern (supports * wildcard)'),
|
|
45
|
+
directory: z.string().optional().describe('Optional directory to search in'),
|
|
46
|
+
}),
|
|
47
|
+
async execute({ pattern, directory }, { godot }) {
|
|
48
|
+
const result = await godot.sendCommand('search_files', {
|
|
49
|
+
pattern,
|
|
50
|
+
directory: directory ?? 'res://',
|
|
51
|
+
});
|
|
52
|
+
if (result.files.length === 0) {
|
|
53
|
+
return `No files matching "${pattern}" found`;
|
|
54
|
+
}
|
|
55
|
+
return `Found ${result.files.length} file(s) matching "${pattern}":\n${result.files.map((f) => ` - ${f}`).join('\n')}`;
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
export const getProjectSettings = defineTool({
|
|
59
|
+
name: 'get_project_settings',
|
|
60
|
+
description: 'Get project settings',
|
|
61
|
+
schema: z.object({
|
|
62
|
+
category: z
|
|
63
|
+
.string()
|
|
64
|
+
.optional()
|
|
65
|
+
.describe('Optional settings category to filter by'),
|
|
66
|
+
}),
|
|
67
|
+
async execute({ category }, { godot }) {
|
|
68
|
+
const result = await godot.sendCommand('get_project_settings', { category });
|
|
69
|
+
return JSON.stringify(result.settings, null, 2);
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
export const projectTools = [
|
|
73
|
+
getProjectInfo,
|
|
74
|
+
listProjectFiles,
|
|
75
|
+
searchFiles,
|
|
76
|
+
getProjectSettings,
|
|
77
|
+
];
|
|
78
|
+
//# sourceMappingURL=project.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project.js","sourceRoot":"","sources":["../../src/tools/project.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAGpD,MAAM,CAAC,MAAM,cAAc,GAAG,UAAU,CAAC;IACvC,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,iDAAiD;IAC9D,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;IACpB,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE;QACxB,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,WAAW,CAKnC,kBAAkB,CAAC,CAAC;QACvB,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IACzC,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,gBAAgB,GAAG,UAAU,CAAC;IACzC,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,mCAAmC;IAChD,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,SAAS,EAAE,CAAC;aACT,IAAI,CAAC,CAAC,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,CAAC,CAA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js';
|
|
3
|
+
export declare const getSceneTree: import("../core/types.js").ToolDefinition<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
|
|
4
|
+
export declare const openScene: import("../core/types.js").ToolDefinition<z.ZodObject<{
|
|
5
|
+
scene_path: z.ZodString;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
scene_path: string;
|
|
8
|
+
}, {
|
|
9
|
+
scene_path: string;
|
|
10
|
+
}>>;
|
|
11
|
+
export declare const saveScene: import("../core/types.js").ToolDefinition<z.ZodObject<{
|
|
12
|
+
path: z.ZodOptional<z.ZodString>;
|
|
13
|
+
}, "strip", z.ZodTypeAny, {
|
|
14
|
+
path?: string | undefined;
|
|
15
|
+
}, {
|
|
16
|
+
path?: string | undefined;
|
|
17
|
+
}>>;
|
|
18
|
+
export declare const createScene: import("../core/types.js").ToolDefinition<z.ZodObject<{
|
|
19
|
+
root_type: z.ZodString;
|
|
20
|
+
root_name: z.ZodOptional<z.ZodString>;
|
|
21
|
+
scene_path: z.ZodString;
|
|
22
|
+
}, "strip", z.ZodTypeAny, {
|
|
23
|
+
scene_path: string;
|
|
24
|
+
root_type: string;
|
|
25
|
+
root_name?: string | undefined;
|
|
26
|
+
}, {
|
|
27
|
+
scene_path: string;
|
|
28
|
+
root_type: string;
|
|
29
|
+
root_name?: string | undefined;
|
|
30
|
+
}>>;
|
|
31
|
+
export declare const sceneTools: AnyToolDefinition[];
|
|
32
|
+
//# sourceMappingURL=scene.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scene.d.ts","sourceRoot":"","sources":["../../src/tools/scene.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,eAAO,MAAM,YAAY,2FAQvB,CAAC;AAEH,eAAO,MAAM,SAAS;;;;;;GAYpB,CAAC;AAEH,eAAO,MAAM,SAAS;;;;;;GAepB,CAAC;AAEH,eAAO,MAAM,WAAW;;;;;;;;;;;;GAoBtB,CAAC;AAEH,eAAO,MAAM,UAAU,EAKlB,iBAAiB,EAAE,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { defineTool } from '../core/define-tool.js';
|
|
3
|
+
export const getSceneTree = defineTool({
|
|
4
|
+
name: 'get_scene_tree',
|
|
5
|
+
description: 'Get the full hierarchy of nodes in the currently open scene',
|
|
6
|
+
schema: z.object({}),
|
|
7
|
+
async execute(_, { godot }) {
|
|
8
|
+
const result = await godot.sendCommand('get_scene_tree');
|
|
9
|
+
return JSON.stringify(result.tree, null, 2);
|
|
10
|
+
},
|
|
11
|
+
});
|
|
12
|
+
export const openScene = defineTool({
|
|
13
|
+
name: 'open_scene',
|
|
14
|
+
description: 'Open a scene file in the editor',
|
|
15
|
+
schema: z.object({
|
|
16
|
+
scene_path: z
|
|
17
|
+
.string()
|
|
18
|
+
.describe('Path to the scene file (e.g., "res://scenes/main.tscn")'),
|
|
19
|
+
}),
|
|
20
|
+
async execute({ scene_path }, { godot }) {
|
|
21
|
+
await godot.sendCommand('open_scene', { scene_path });
|
|
22
|
+
return `Opened scene: ${scene_path}`;
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
export const saveScene = defineTool({
|
|
26
|
+
name: 'save_scene',
|
|
27
|
+
description: 'Save the currently open scene',
|
|
28
|
+
schema: z.object({
|
|
29
|
+
path: z
|
|
30
|
+
.string()
|
|
31
|
+
.optional()
|
|
32
|
+
.describe('Optional path to save as (defaults to current scene path)'),
|
|
33
|
+
}),
|
|
34
|
+
async execute({ path }, { godot }) {
|
|
35
|
+
const result = await godot.sendCommand('save_scene', {
|
|
36
|
+
path,
|
|
37
|
+
});
|
|
38
|
+
return `Saved scene: ${result.path}`;
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
export const createScene = defineTool({
|
|
42
|
+
name: 'create_scene',
|
|
43
|
+
description: 'Create a new scene with a root node',
|
|
44
|
+
schema: z.object({
|
|
45
|
+
root_type: z
|
|
46
|
+
.string()
|
|
47
|
+
.describe('Type of the root node (e.g., "Node2D", "Node3D", "Control")'),
|
|
48
|
+
root_name: z.string().optional().describe('Name of the root node'),
|
|
49
|
+
scene_path: z
|
|
50
|
+
.string()
|
|
51
|
+
.describe('Path to save the scene (e.g., "res://scenes/new_scene.tscn")'),
|
|
52
|
+
}),
|
|
53
|
+
async execute({ root_type, root_name, scene_path }, { godot }) {
|
|
54
|
+
await godot.sendCommand('create_scene', {
|
|
55
|
+
root_type,
|
|
56
|
+
root_name: root_name ?? root_type,
|
|
57
|
+
scene_path,
|
|
58
|
+
});
|
|
59
|
+
return `Created scene: ${scene_path} with root node type ${root_type}`;
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
export const sceneTools = [
|
|
63
|
+
getSceneTree,
|
|
64
|
+
openScene,
|
|
65
|
+
saveScene,
|
|
66
|
+
createScene,
|
|
67
|
+
];
|
|
68
|
+
//# sourceMappingURL=scene.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scene.js","sourceRoot":"","sources":["../../src/tools/scene.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAGpD,MAAM,CAAC,MAAM,YAAY,GAAG,UAAU,CAAC;IACrC,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,6DAA6D;IAC1E,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;IACpB,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE;QACxB,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,WAAW,CAAoB,gBAAgB,CAAC,CAAC;QAC5E,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,EAAE,IA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AAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,uBAAuB,CAAC;QAClE,UAAU,EAAE,CAAC;aACV,MAAM,EAAE;aACR,QAAQ,CAAC,8DAA8D,CAAC;KAC5E,CAAC;IACF,KAAK,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,EAAE,EAAE,KAAK,EAAE;QAC3D,MAAM,KAAK,CAAC,WAAW,CAAC,cAAc,EAAE;YACtC,SAAS;YACT,SAAS,EAAE,SAAS,IAAI,SAAS;YACjC,UAAU;SACX,CAAC,CAAC;QACH,OAAO,kBAAkB,UAAU,wBAAwB,SAAS,EAAE,CAAC;IACzE,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,YAAY;IACZ,SAAS;IACT,SAAS;IACT,WAAW;CACW,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { AnyToolDefinition } from '../core/types.js';
|
|
3
|
+
export declare const getScript: import("../core/types.js").ToolDefinition<z.ZodObject<{
|
|
4
|
+
script_path: z.ZodString;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
script_path: string;
|
|
7
|
+
}, {
|
|
8
|
+
script_path: string;
|
|
9
|
+
}>>;
|
|
10
|
+
export declare const createScript: import("../core/types.js").ToolDefinition<z.ZodObject<{
|
|
11
|
+
script_path: z.ZodString;
|
|
12
|
+
content: z.ZodString;
|
|
13
|
+
attach_to: z.ZodOptional<z.ZodString>;
|
|
14
|
+
}, "strip", z.ZodTypeAny, {
|
|
15
|
+
script_path: string;
|
|
16
|
+
content: string;
|
|
17
|
+
attach_to?: string | undefined;
|
|
18
|
+
}, {
|
|
19
|
+
script_path: string;
|
|
20
|
+
content: string;
|
|
21
|
+
attach_to?: string | undefined;
|
|
22
|
+
}>>;
|
|
23
|
+
export declare const editScript: import("../core/types.js").ToolDefinition<z.ZodObject<{
|
|
24
|
+
script_path: z.ZodString;
|
|
25
|
+
content: z.ZodString;
|
|
26
|
+
}, "strip", z.ZodTypeAny, {
|
|
27
|
+
script_path: string;
|
|
28
|
+
content: string;
|
|
29
|
+
}, {
|
|
30
|
+
script_path: string;
|
|
31
|
+
content: string;
|
|
32
|
+
}>>;
|
|
33
|
+
export declare const attachScript: import("../core/types.js").ToolDefinition<z.ZodObject<{
|
|
34
|
+
node_path: z.ZodString;
|
|
35
|
+
script_path: z.ZodString;
|
|
36
|
+
}, "strip", z.ZodTypeAny, {
|
|
37
|
+
node_path: string;
|
|
38
|
+
script_path: string;
|
|
39
|
+
}, {
|
|
40
|
+
node_path: string;
|
|
41
|
+
script_path: string;
|
|
42
|
+
}>>;
|
|
43
|
+
export declare const detachScript: import("../core/types.js").ToolDefinition<z.ZodObject<{
|
|
44
|
+
node_path: z.ZodString;
|
|
45
|
+
}, "strip", z.ZodTypeAny, {
|
|
46
|
+
node_path: string;
|
|
47
|
+
}, {
|
|
48
|
+
node_path: string;
|
|
49
|
+
}>>;
|
|
50
|
+
export declare const scriptTools: AnyToolDefinition[];
|
|
51
|
+
//# sourceMappingURL=script.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"script.d.ts","sourceRoot":"","sources":["../../src/tools/script.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,eAAO,MAAM,SAAS;;;;;;GAcpB,CAAC;AAEH,eAAO,MAAM,YAAY;;;;;;;;;;;;GAyBvB,CAAC;AAEH,eAAO,MAAM,UAAU;;;;;;;;;GAWrB,CAAC;AAEH,eAAO,MAAM,YAAY;;;;;;;;;GAWvB,CAAC;AAEH,eAAO,MAAM,YAAY;;;;;;GAUvB,CAAC;AAEH,eAAO,MAAM,WAAW,EAMnB,iBAAiB,EAAE,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { defineTool } from '../core/define-tool.js';
|
|
3
|
+
export const getScript = defineTool({
|
|
4
|
+
name: 'get_script',
|
|
5
|
+
description: 'Get the content of a GDScript file',
|
|
6
|
+
schema: z.object({
|
|
7
|
+
script_path: z
|
|
8
|
+
.string()
|
|
9
|
+
.describe('Path to the script file (e.g., "res://scripts/player.gd")'),
|
|
10
|
+
}),
|
|
11
|
+
async execute({ script_path }, { godot }) {
|
|
12
|
+
const result = await godot.sendCommand('read_script', {
|
|
13
|
+
script_path,
|
|
14
|
+
});
|
|
15
|
+
return `# ${script_path}\n\n\`\`\`gdscript\n${result.content}\n\`\`\``;
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
export const createScript = defineTool({
|
|
19
|
+
name: 'create_script',
|
|
20
|
+
description: 'Create a new GDScript file',
|
|
21
|
+
schema: z.object({
|
|
22
|
+
script_path: z
|
|
23
|
+
.string()
|
|
24
|
+
.describe('Path for the new script (e.g., "res://scripts/enemy.gd")'),
|
|
25
|
+
content: z.string().describe('Content of the script'),
|
|
26
|
+
attach_to: z
|
|
27
|
+
.string()
|
|
28
|
+
.optional()
|
|
29
|
+
.describe('Optional node path to attach the script to'),
|
|
30
|
+
}),
|
|
31
|
+
async execute({ script_path, content, attach_to }, { godot }) {
|
|
32
|
+
await godot.sendCommand('create_script', {
|
|
33
|
+
script_path,
|
|
34
|
+
content,
|
|
35
|
+
attach_to,
|
|
36
|
+
});
|
|
37
|
+
let message = `Created script: ${script_path}`;
|
|
38
|
+
if (attach_to) {
|
|
39
|
+
message += ` (attached to ${attach_to})`;
|
|
40
|
+
}
|
|
41
|
+
return message;
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
export const editScript = defineTool({
|
|
45
|
+
name: 'edit_script',
|
|
46
|
+
description: 'Replace the content of an existing GDScript file',
|
|
47
|
+
schema: z.object({
|
|
48
|
+
script_path: z.string().describe('Path to the script file'),
|
|
49
|
+
content: z.string().describe('New content for the script'),
|
|
50
|
+
}),
|
|
51
|
+
async execute({ script_path, content }, { godot }) {
|
|
52
|
+
await godot.sendCommand('edit_script', { script_path, content });
|
|
53
|
+
return `Updated script: ${script_path}`;
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
export const attachScript = defineTool({
|
|
57
|
+
name: 'attach_script',
|
|
58
|
+
description: 'Attach an existing script to a node',
|
|
59
|
+
schema: z.object({
|
|
60
|
+
node_path: z.string().describe('Path to the node'),
|
|
61
|
+
script_path: z.string().describe('Path to the script file'),
|
|
62
|
+
}),
|
|
63
|
+
async execute({ node_path, script_path }, { godot }) {
|
|
64
|
+
await godot.sendCommand('attach_script', { node_path, script_path });
|
|
65
|
+
return `Attached ${script_path} to ${node_path}`;
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
export const detachScript = defineTool({
|
|
69
|
+
name: 'detach_script',
|
|
70
|
+
description: 'Remove the script from a node',
|
|
71
|
+
schema: z.object({
|
|
72
|
+
node_path: z.string().describe('Path to the node'),
|
|
73
|
+
}),
|
|
74
|
+
async execute({ node_path }, { godot }) {
|
|
75
|
+
await godot.sendCommand('detach_script', { node_path });
|
|
76
|
+
return `Detached script from ${node_path}`;
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
export const scriptTools = [
|
|
80
|
+
getScript,
|
|
81
|
+
createScript,
|
|
82
|
+
editScript,
|
|
83
|
+
attachScript,
|
|
84
|
+
detachScript,
|
|
85
|
+
];
|
|
86
|
+
//# sourceMappingURL=script.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"script.js","sourceRoot":"","sources":["../../src/tools/script.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAGpD,MAAM,CAAC,MAAM,SAAS,GAAG,UAAU,CAAC;IAClC,IAAI,EAAE,YAAY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,MAAM,EAAE,CAAC,QAAQ,CAAC,kBAAkB,CAAC;KACnD,CAAC;IACF,KAAK,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,KAAK,EAAE;QACpC,MAAM,KAAK,CAAC,WAAW,CAAC,eAAe,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC;QACxD,OAAO,wBAAwB,SAAS,EAAE,CAAC;IAC7C,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,SAAS;IACT,YAAY;IACZ,UAAU;IACV,YAAY;IACZ,YAAY;CACU,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare class GodotConnectionError extends Error {
|
|
2
|
+
constructor(message: string);
|
|
3
|
+
}
|
|
4
|
+
export declare class GodotCommandError extends Error {
|
|
5
|
+
readonly code: string;
|
|
6
|
+
constructor(code: string, message: string);
|
|
7
|
+
}
|
|
8
|
+
export declare class GodotTimeoutError extends Error {
|
|
9
|
+
constructor(command: string, timeoutMs: number);
|
|
10
|
+
}
|
|
11
|
+
export interface ErrorResponse {
|
|
12
|
+
code: string;
|
|
13
|
+
message: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function formatError(error: unknown): string;
|
|
16
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/utils/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,oBAAqB,SAAQ,KAAK;gBACjC,OAAO,EAAE,MAAM;CAI5B;AAED,qBAAa,iBAAkB,SAAQ,KAAK;IAC1C,SAAgB,IAAI,EAAE,MAAM,CAAC;gBAEjB,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;CAK1C;AAED,qBAAa,iBAAkB,SAAQ,KAAK;gBAC9B,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;CAI/C;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAQlD"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export class GodotConnectionError extends Error {
|
|
2
|
+
constructor(message) {
|
|
3
|
+
super(message);
|
|
4
|
+
this.name = 'GodotConnectionError';
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
export class GodotCommandError extends Error {
|
|
8
|
+
code;
|
|
9
|
+
constructor(code, message) {
|
|
10
|
+
super(message);
|
|
11
|
+
this.name = 'GodotCommandError';
|
|
12
|
+
this.code = code;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export class GodotTimeoutError extends Error {
|
|
16
|
+
constructor(command, timeoutMs) {
|
|
17
|
+
super(`Command '${command}' timed out after ${timeoutMs}ms`);
|
|
18
|
+
this.name = 'GodotTimeoutError';
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export function formatError(error) {
|
|
22
|
+
if (error instanceof GodotCommandError) {
|
|
23
|
+
return `[${error.code}] ${error.message}`;
|
|
24
|
+
}
|
|
25
|
+
if (error instanceof Error) {
|
|
26
|
+
return error.message;
|
|
27
|
+
}
|
|
28
|
+
return String(error);
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/utils/errors.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IAC7C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACrC,CAAC;CACF;AAED,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IAC1B,IAAI,CAAS;IAE7B,YAAY,IAAY,EAAE,OAAe;QACvC,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;QAChC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AAED,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IAC1C,YAAY,OAAe,EAAE,SAAiB;QAC5C,KAAK,CAAC,YAAY,OAAO,qBAAqB,SAAS,IAAI,CAAC,CAAC;QAC7D,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;IAClC,CAAC;CACF;AAOD,MAAM,UAAU,WAAW,CAAC,KAAc;IACxC,IAAI,KAAK,YAAY,iBAAiB,EAAE,CAAC;QACvC,OAAO,IAAI,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC;IAC5C,CAAC;IACD,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAC3B,OAAO,KAAK,CAAC,OAAO,CAAC;IACvB,CAAC;IACD,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@satelliteoflove/godot-mcp",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "MCP server for Godot Engine integration",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"godot-mcp": "./dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist"
|
|
12
|
+
],
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://github.com/satelliteoflove/godot-mcp.git"
|
|
16
|
+
},
|
|
17
|
+
"bugs": {
|
|
18
|
+
"url": "https://github.com/satelliteoflove/godot-mcp/issues"
|
|
19
|
+
},
|
|
20
|
+
"homepage": "https://github.com/satelliteoflove/godot-mcp#readme",
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "tsc",
|
|
23
|
+
"start": "node dist/index.js",
|
|
24
|
+
"dev": "tsc --watch",
|
|
25
|
+
"test": "vitest run",
|
|
26
|
+
"test:watch": "vitest"
|
|
27
|
+
},
|
|
28
|
+
"keywords": [
|
|
29
|
+
"godot",
|
|
30
|
+
"mcp",
|
|
31
|
+
"model-context-protocol",
|
|
32
|
+
"ai",
|
|
33
|
+
"game-development"
|
|
34
|
+
],
|
|
35
|
+
"author": "",
|
|
36
|
+
"license": "MIT",
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
39
|
+
"ws": "^8.18.0",
|
|
40
|
+
"zod": "^3.23.0",
|
|
41
|
+
"zod-to-json-schema": "^3.23.0"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@types/node": "^22.0.0",
|
|
45
|
+
"@types/ws": "^8.5.0",
|
|
46
|
+
"typescript": "^5.6.0",
|
|
47
|
+
"vitest": "^2.1.0"
|
|
48
|
+
},
|
|
49
|
+
"engines": {
|
|
50
|
+
"node": ">=18.0.0"
|
|
51
|
+
}
|
|
52
|
+
}
|