funplay-godot-mcp 0.9.0 → 0.9.2
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 +5 -4
- package/bin/funplay-godot-mcp.js +22 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,13 +15,13 @@ npm link
|
|
|
15
15
|
Then run:
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
|
-
funplay-godot-mcp --url http://127.0.0.1:8765/
|
|
18
|
+
funplay-godot-mcp --url http://127.0.0.1:8765/ --token <token>
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
You can also configure the endpoint through
|
|
21
|
+
You can also configure the endpoint and local auth token through environment variables:
|
|
22
22
|
|
|
23
23
|
```bash
|
|
24
|
-
FUNPLAY_GODOT_MCP_URL=http://127.0.0.1:8765/ funplay-godot-mcp
|
|
24
|
+
FUNPLAY_GODOT_MCP_URL=http://127.0.0.1:8765/ FUNPLAY_GODOT_MCP_TOKEN=<token> funplay-godot-mcp
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
## MCP client config
|
|
@@ -32,7 +32,8 @@ FUNPLAY_GODOT_MCP_URL=http://127.0.0.1:8765/ funplay-godot-mcp
|
|
|
32
32
|
"funplay": {
|
|
33
33
|
"command": "funplay-godot-mcp",
|
|
34
34
|
"env": {
|
|
35
|
-
"FUNPLAY_GODOT_MCP_URL": "http://127.0.0.1:8765/"
|
|
35
|
+
"FUNPLAY_GODOT_MCP_URL": "http://127.0.0.1:8765/",
|
|
36
|
+
"FUNPLAY_GODOT_MCP_TOKEN": "<token from Funplay MCP dock>"
|
|
36
37
|
}
|
|
37
38
|
}
|
|
38
39
|
}
|
package/bin/funplay-godot-mcp.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { argv, env, exit, stderr, stdin, stdout } from "node:process";
|
|
4
4
|
|
|
5
|
-
const VERSION = "0.9.
|
|
5
|
+
const VERSION = "0.9.2";
|
|
6
6
|
const DEFAULT_URL = "http://127.0.0.1:8765/";
|
|
7
7
|
|
|
8
8
|
const options = parseArgs(argv.slice(2));
|
|
@@ -18,6 +18,9 @@ if (options.version) {
|
|
|
18
18
|
const endpoint = normalizeEndpoint(
|
|
19
19
|
options.url || env.FUNPLAY_GODOT_MCP_URL || env.GODOT_MCP_URL || DEFAULT_URL,
|
|
20
20
|
);
|
|
21
|
+
const authToken = String(
|
|
22
|
+
options.token || env.FUNPLAY_GODOT_MCP_TOKEN || env.GODOT_MCP_TOKEN || "",
|
|
23
|
+
).trim();
|
|
21
24
|
|
|
22
25
|
let buffer = "";
|
|
23
26
|
let queue = Promise.resolve();
|
|
@@ -104,12 +107,17 @@ async function handleLine(line) {
|
|
|
104
107
|
|
|
105
108
|
async function forwardMessage(message) {
|
|
106
109
|
try {
|
|
110
|
+
const headers = {
|
|
111
|
+
"accept": "application/json",
|
|
112
|
+
"content-type": "application/json",
|
|
113
|
+
};
|
|
114
|
+
if (authToken !== "") {
|
|
115
|
+
headers["x-funplay-mcp-token"] = authToken;
|
|
116
|
+
}
|
|
117
|
+
|
|
107
118
|
const response = await fetch(endpoint, {
|
|
108
119
|
method: "POST",
|
|
109
|
-
headers
|
|
110
|
-
"accept": "application/json",
|
|
111
|
-
"content-type": "application/json",
|
|
112
|
-
},
|
|
120
|
+
headers,
|
|
113
121
|
body: JSON.stringify(message),
|
|
114
122
|
});
|
|
115
123
|
|
|
@@ -173,6 +181,7 @@ function parseArgs(args) {
|
|
|
173
181
|
help: false,
|
|
174
182
|
version: false,
|
|
175
183
|
url: "",
|
|
184
|
+
token: "",
|
|
176
185
|
};
|
|
177
186
|
|
|
178
187
|
for (let i = 0; i < args.length; i += 1) {
|
|
@@ -186,6 +195,11 @@ function parseArgs(args) {
|
|
|
186
195
|
i += 1;
|
|
187
196
|
} else if (arg.startsWith("--url=")) {
|
|
188
197
|
parsed.url = arg.slice("--url=".length);
|
|
198
|
+
} else if (arg === "--token") {
|
|
199
|
+
parsed.token = args[i + 1] || "";
|
|
200
|
+
i += 1;
|
|
201
|
+
} else if (arg.startsWith("--token=")) {
|
|
202
|
+
parsed.token = arg.slice("--token=".length);
|
|
189
203
|
} else {
|
|
190
204
|
stderr.write(`[funplay-godot-mcp] Unknown argument ignored: ${arg}\n`);
|
|
191
205
|
}
|
|
@@ -198,11 +212,13 @@ function buildHelp() {
|
|
|
198
212
|
return `Funplay MCP for Godot stdio bridge ${VERSION}
|
|
199
213
|
|
|
200
214
|
Usage:
|
|
201
|
-
funplay-godot-mcp [--url http://127.0.0.1:8765/]
|
|
215
|
+
funplay-godot-mcp [--url http://127.0.0.1:8765/] [--token TOKEN]
|
|
202
216
|
|
|
203
217
|
Environment:
|
|
204
218
|
FUNPLAY_GODOT_MCP_URL Godot MCP HTTP endpoint
|
|
205
219
|
GODOT_MCP_URL Compatibility endpoint fallback
|
|
220
|
+
FUNPLAY_GODOT_MCP_TOKEN Godot MCP local auth token
|
|
221
|
+
GODOT_MCP_TOKEN Compatibility token fallback
|
|
206
222
|
|
|
207
223
|
The Godot editor addon must be enabled and its MCP server must be running.
|
|
208
224
|
`;
|