terminator-mcp-agent 0.5.8 → 0.5.12
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 +16 -1
- package/index.js +36 -230
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -43,7 +43,22 @@ You can also use the CLI to configure your app automatically:
|
|
|
43
43
|
npx -y terminator-mcp-agent --add-to-app [app]
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
Replace `[app]` with one of:
|
|
46
|
+
Replace `[app]` with one of:
|
|
47
|
+
|
|
48
|
+
- cursor
|
|
49
|
+
- claude
|
|
50
|
+
- vscode
|
|
51
|
+
- insiders
|
|
52
|
+
- windsurf
|
|
53
|
+
- cline
|
|
54
|
+
- roocode
|
|
55
|
+
- witsy
|
|
56
|
+
- enconvo
|
|
57
|
+
- boltai
|
|
58
|
+
- amazon-bedrock
|
|
59
|
+
- amazonq
|
|
60
|
+
|
|
61
|
+
If you omit `[app]`, the CLI will prompt you to select from all available options.
|
|
47
62
|
|
|
48
63
|
---
|
|
49
64
|
|
package/index.js
CHANGED
|
@@ -5,6 +5,8 @@ const path = require("path");
|
|
|
5
5
|
const fs = require("fs");
|
|
6
6
|
const os = require("os");
|
|
7
7
|
const readline = require("readline");
|
|
8
|
+
const config = require("./config");
|
|
9
|
+
const { supportedClients } = require("./config");
|
|
8
10
|
|
|
9
11
|
function getPlatformInfo() {
|
|
10
12
|
const platform = process.platform;
|
|
@@ -36,209 +38,24 @@ function getPlatformInfo() {
|
|
|
36
38
|
throw new Error(`Unsupported platform: ${platform} ${arch}`);
|
|
37
39
|
}
|
|
38
40
|
|
|
39
|
-
function
|
|
40
|
-
return {
|
|
41
|
-
command: "npx",
|
|
42
|
-
args: ["-y", "terminator-mcp-agent"],
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
function addToCursorConfig() {
|
|
47
|
-
const home = os.homedir();
|
|
48
|
-
const configDir = path.join(home, ".cursor");
|
|
49
|
-
const configFile = path.join(configDir, "mcp.json");
|
|
50
|
-
if (!fs.existsSync(configDir)) {
|
|
51
|
-
fs.mkdirSync(configDir, { recursive: true });
|
|
52
|
-
}
|
|
53
|
-
let config = {};
|
|
54
|
-
if (fs.existsSync(configFile)) {
|
|
55
|
-
try {
|
|
56
|
-
config = JSON.parse(fs.readFileSync(configFile, "utf8"));
|
|
57
|
-
} catch (e) {
|
|
58
|
-
config = {};
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
if (!config.mcpServers || typeof config.mcpServers !== "object") {
|
|
62
|
-
config.mcpServers = {};
|
|
63
|
-
}
|
|
64
|
-
config.mcpServers["terminator-mcp-agent"] = getMcpServerEntry();
|
|
65
|
-
fs.writeFileSync(configFile, JSON.stringify(config, null, 2));
|
|
66
|
-
console.log(`Cursor configuration saved to ${configFile}`);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
function addToClaudeConfig() {
|
|
70
|
-
const platform = process.platform;
|
|
71
|
-
let configDir, configFile;
|
|
72
|
-
if (platform === "win32") {
|
|
73
|
-
const appData =
|
|
74
|
-
process.env.APPDATA || path.join(os.homedir(), "AppData", "Roaming");
|
|
75
|
-
configDir = path.join(appData, "Claude");
|
|
76
|
-
configFile = path.join(configDir, "claude_desktop_config.json");
|
|
77
|
-
} else if (platform === "darwin") {
|
|
78
|
-
configDir = path.join(
|
|
79
|
-
os.homedir(),
|
|
80
|
-
"Library",
|
|
81
|
-
"Application Support",
|
|
82
|
-
"Claude",
|
|
83
|
-
);
|
|
84
|
-
configFile = path.join(configDir, "claude_desktop_config.json");
|
|
85
|
-
} else {
|
|
86
|
-
console.error("Claude desktop is only supported on Windows and macOS.");
|
|
87
|
-
process.exit(1);
|
|
88
|
-
}
|
|
89
|
-
if (!fs.existsSync(configDir)) {
|
|
90
|
-
console.error(
|
|
91
|
-
`Claude desktop config directory does not exist: ${configDir}\nPlease make sure the Claude desktop app is installed for your platform.`,
|
|
92
|
-
);
|
|
93
|
-
process.exit(1);
|
|
94
|
-
}
|
|
95
|
-
let config = {};
|
|
96
|
-
if (fs.existsSync(configFile)) {
|
|
97
|
-
try {
|
|
98
|
-
config = JSON.parse(fs.readFileSync(configFile, "utf8"));
|
|
99
|
-
} catch (e) {
|
|
100
|
-
config = {};
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
if (!config.mcpServers || typeof config.mcpServers !== "object") {
|
|
104
|
-
config.mcpServers = {};
|
|
105
|
-
}
|
|
106
|
-
config.mcpServers["terminator-mcp-agent"] = getMcpServerEntry();
|
|
107
|
-
fs.writeFileSync(configFile, JSON.stringify(config, null, 2));
|
|
108
|
-
console.log(`Claude configuration saved to ${configFile}`);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
function buildVSCodeMcpJsonArg(mcpJson) {
|
|
112
|
-
// VS Code expects: --add-mcp "{\"name\":\"...\",...}"
|
|
113
|
-
return `"${JSON.stringify(mcpJson).replace(/"/g, '\\"')}"`;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
function addToVSCodeConfig() {
|
|
117
|
-
// VS Code CLI-based setup
|
|
118
|
-
console.log("Adding Terminator MCP to VS Code via code CLI...");
|
|
119
|
-
const mcpJson = {
|
|
120
|
-
name: "terminator-mcp-agent",
|
|
121
|
-
command: "npx",
|
|
122
|
-
args: ["-y", "terminator-mcp-agent"],
|
|
123
|
-
};
|
|
124
|
-
const jsonArg = buildVSCodeMcpJsonArg(mcpJson);
|
|
125
|
-
const vscodeCmd = "code";
|
|
126
|
-
try {
|
|
127
|
-
const { spawnSync } = require("child_process");
|
|
128
|
-
const result = spawnSync(`${vscodeCmd} --add-mcp ${jsonArg}`, [], {
|
|
129
|
-
stdio: "inherit",
|
|
130
|
-
shell: true,
|
|
131
|
-
});
|
|
132
|
-
if (result.error) {
|
|
133
|
-
if (result.error.code === "ENOENT") {
|
|
134
|
-
console.error(
|
|
135
|
-
"'code' command not found in PATH. Make sure VS Code CLI is installed and available.",
|
|
136
|
-
);
|
|
137
|
-
} else {
|
|
138
|
-
console.error("Failed to launch VS Code CLI:", result.error.message);
|
|
139
|
-
}
|
|
140
|
-
process.exit(1);
|
|
141
|
-
}
|
|
142
|
-
if (result.status !== 0) {
|
|
143
|
-
console.error(`VS Code CLI exited with code ${result.status}`);
|
|
144
|
-
process.exit(1);
|
|
145
|
-
}
|
|
146
|
-
console.log("Successfully added Terminator MCP to VS Code.");
|
|
147
|
-
} catch (e) {
|
|
148
|
-
console.error("Failed to add MCP to VS Code:", e.message);
|
|
149
|
-
process.exit(1);
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
function addToVSCodeInsidersConfig() {
|
|
154
|
-
// VS Code Insiders CLI-based setup
|
|
155
|
-
console.log(
|
|
156
|
-
"Adding Terminator MCP to VS Code Insiders via code-insiders CLI...",
|
|
157
|
-
);
|
|
158
|
-
const mcpJson = {
|
|
159
|
-
name: "terminator-mcp-agent",
|
|
160
|
-
command: "npx",
|
|
161
|
-
args: ["-y", "terminator-mcp-agent"],
|
|
162
|
-
};
|
|
163
|
-
const jsonArg = buildVSCodeMcpJsonArg(mcpJson);
|
|
164
|
-
const codeInsidersCmd = "code-insiders";
|
|
41
|
+
function addToApp(app) {
|
|
165
42
|
try {
|
|
166
|
-
const
|
|
167
|
-
const
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
} else {
|
|
177
|
-
console.error(
|
|
178
|
-
"Failed to launch VS Code Insiders CLI:",
|
|
179
|
-
result.error.message,
|
|
180
|
-
);
|
|
181
|
-
}
|
|
182
|
-
process.exit(1);
|
|
183
|
-
}
|
|
184
|
-
if (result.status !== 0) {
|
|
185
|
-
console.error(`VS Code Insiders CLI exited with code ${result.status}`);
|
|
186
|
-
process.exit(1);
|
|
187
|
-
}
|
|
188
|
-
console.log("Successfully added Terminator MCP to VS Code Insiders.");
|
|
43
|
+
const client = (app || "").toLowerCase();
|
|
44
|
+
const mcpServer = {
|
|
45
|
+
command: "npx",
|
|
46
|
+
args: ["-y", "terminator-mcp-agent"],
|
|
47
|
+
};
|
|
48
|
+
const currentConfig = config.readConfig(client);
|
|
49
|
+
currentConfig.mcpServers = currentConfig.mcpServers || {};
|
|
50
|
+
currentConfig.mcpServers["terminator-mcp-agent"] = mcpServer;
|
|
51
|
+
config.writeConfig(currentConfig, client);
|
|
52
|
+
console.log(`Configured MCP for ${client}`);
|
|
189
53
|
} catch (e) {
|
|
190
|
-
console.error(
|
|
54
|
+
console.error(`Failed to configure MCP for ${app}:`, e.message);
|
|
191
55
|
process.exit(1);
|
|
192
56
|
}
|
|
193
57
|
}
|
|
194
58
|
|
|
195
|
-
function addToWindsurfConfig() {
|
|
196
|
-
// Windsurf config: %USERPROFILE%/.codeium/windsurf/mcp_config.json
|
|
197
|
-
const home = os.homedir();
|
|
198
|
-
const configDir = path.join(home, ".codeium", "windsurf");
|
|
199
|
-
const configFile = path.join(configDir, "mcp_config.json");
|
|
200
|
-
if (!fs.existsSync(configDir)) {
|
|
201
|
-
fs.mkdirSync(configDir, { recursive: true });
|
|
202
|
-
}
|
|
203
|
-
let config = {};
|
|
204
|
-
if (fs.existsSync(configFile)) {
|
|
205
|
-
try {
|
|
206
|
-
config = JSON.parse(fs.readFileSync(configFile, "utf8"));
|
|
207
|
-
} catch (e) {
|
|
208
|
-
config = {};
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
if (!config.mcpServers || typeof config.mcpServers !== "object") {
|
|
212
|
-
config.mcpServers = {};
|
|
213
|
-
}
|
|
214
|
-
config.mcpServers["terminator-mcp-agent"] = getMcpServerEntry();
|
|
215
|
-
fs.writeFileSync(configFile, JSON.stringify(config, null, 2));
|
|
216
|
-
console.log(`Windsurf configuration saved to ${configFile}`);
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
function addToApp(app) {
|
|
220
|
-
switch ((app || "").toLowerCase()) {
|
|
221
|
-
case "cursor":
|
|
222
|
-
addToCursorConfig();
|
|
223
|
-
break;
|
|
224
|
-
case "claude":
|
|
225
|
-
addToClaudeConfig();
|
|
226
|
-
break;
|
|
227
|
-
case "vscode":
|
|
228
|
-
addToVSCodeConfig();
|
|
229
|
-
break;
|
|
230
|
-
case "insiders":
|
|
231
|
-
addToVSCodeInsidersConfig();
|
|
232
|
-
break;
|
|
233
|
-
case "windsurf":
|
|
234
|
-
addToWindsurfConfig();
|
|
235
|
-
break;
|
|
236
|
-
default:
|
|
237
|
-
console.error("Unknown app: " + app);
|
|
238
|
-
process.exit(1);
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
|
|
242
59
|
const argv = process.argv.slice(2);
|
|
243
60
|
|
|
244
61
|
if (argv.includes("--add-to-app")) {
|
|
@@ -256,39 +73,27 @@ if (argv.includes("--add-to-app")) {
|
|
|
256
73
|
console.log("========== Terminator MCP Setup ==========");
|
|
257
74
|
console.log("Which app do you want to configure Terminator MCP for?");
|
|
258
75
|
console.log("");
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
76
|
+
const pad = (n) =>
|
|
77
|
+
String(n).padStart(String(supportedClients.length).length, " ");
|
|
78
|
+
supportedClients.forEach((client, idx) => {
|
|
79
|
+
console.log(` ${pad(idx + 1)}. ${client.label}`);
|
|
80
|
+
});
|
|
264
81
|
console.log("");
|
|
265
|
-
rl.question(
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
break;
|
|
271
|
-
case "2":
|
|
272
|
-
selectedApp = "claude";
|
|
273
|
-
break;
|
|
274
|
-
case "3":
|
|
275
|
-
selectedApp = "vscode";
|
|
276
|
-
break;
|
|
277
|
-
case "4":
|
|
278
|
-
selectedApp = "insiders";
|
|
279
|
-
break;
|
|
280
|
-
case "5":
|
|
281
|
-
selectedApp = "windsurf";
|
|
282
|
-
break;
|
|
283
|
-
default:
|
|
82
|
+
rl.question(
|
|
83
|
+
`Enter your choice (1-${supportedClients.length}): `,
|
|
84
|
+
(answer) => {
|
|
85
|
+
const idx = parseInt(answer.trim(), 10) - 1;
|
|
86
|
+
if (isNaN(idx) || idx < 0 || idx >= supportedClients.length) {
|
|
284
87
|
console.error("Invalid choice. Skipping app configuration.");
|
|
285
88
|
rl.close();
|
|
286
89
|
process.exit(1);
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
90
|
+
}
|
|
91
|
+
const selectedApp = supportedClients[idx].key;
|
|
92
|
+
rl.close();
|
|
93
|
+
addToApp(selectedApp);
|
|
94
|
+
process.exit(0);
|
|
95
|
+
},
|
|
96
|
+
);
|
|
292
97
|
return;
|
|
293
98
|
} else {
|
|
294
99
|
addToApp(app);
|
|
@@ -308,16 +113,17 @@ if (argv.length === 0 || argv.includes("--start")) {
|
|
|
308
113
|
} else {
|
|
309
114
|
// 2. Try installed npm package
|
|
310
115
|
try {
|
|
311
|
-
|
|
312
|
-
const binDir = path.dirname(pkgPath);
|
|
313
|
-
binary = path.join(binDir, bin);
|
|
116
|
+
binary = require.resolve(pkg);
|
|
314
117
|
} catch (e) {
|
|
315
118
|
console.error(`Failed to find platform binary: ${pkg}`);
|
|
316
119
|
process.exit(1);
|
|
317
120
|
}
|
|
318
121
|
}
|
|
319
122
|
|
|
320
|
-
const child = spawn(binary, [], {
|
|
123
|
+
const child = spawn(binary, [], {
|
|
124
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
125
|
+
shell: true,
|
|
126
|
+
});
|
|
321
127
|
|
|
322
128
|
process.stdin.pipe(child.stdin);
|
|
323
129
|
child.stdout.pipe(process.stdout);
|
package/package.json
CHANGED
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
],
|
|
12
12
|
"name": "terminator-mcp-agent",
|
|
13
13
|
"optionalDependencies": {
|
|
14
|
-
"terminator-mcp-darwin-arm64": "0.5.
|
|
15
|
-
"terminator-mcp-darwin-x64": "0.5.
|
|
16
|
-
"terminator-mcp-linux-x64-gnu": "0.5.
|
|
17
|
-
"terminator-mcp-win32-x64-msvc": "0.5.
|
|
14
|
+
"terminator-mcp-darwin-arm64": "0.5.12",
|
|
15
|
+
"terminator-mcp-darwin-x64": "0.5.12",
|
|
16
|
+
"terminator-mcp-linux-x64-gnu": "0.5.12",
|
|
17
|
+
"terminator-mcp-win32-x64-msvc": "0.5.12"
|
|
18
18
|
},
|
|
19
19
|
"repository": {
|
|
20
20
|
"type": "git",
|
|
@@ -26,5 +26,5 @@
|
|
|
26
26
|
"sync-version": "node ./utils/sync-version.js",
|
|
27
27
|
"update-badges": "node ./utils/update-badges.js"
|
|
28
28
|
},
|
|
29
|
-
"version": "0.5.
|
|
29
|
+
"version": "0.5.12"
|
|
30
30
|
}
|