@mcp-abap-adt/configurator 0.0.6 → 0.0.7
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 +1 -0
- package/bin/mcp-conf-tui.js +34 -1
- package/docs/CLIENT_INSTALLERS.md +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -28,6 +28,7 @@ mcp-conf tui
|
|
|
28
28
|
`mcp-conf tui` starts an interactive wizard.
|
|
29
29
|
- Step order: `operation` -> `client` -> `scope` (auto-skipped if only one scope is supported).
|
|
30
30
|
- For `add` + `sse/http`: prompts for URL, timeout, and repeatable headers.
|
|
31
|
+
- For `rm`/`enable`/`disable`: server name is selected from existing servers in chosen client/scope.
|
|
31
32
|
- Keyboard: arrow keys + Enter, Ctrl+C to cancel.
|
|
32
33
|
|
|
33
34
|
## Docs
|
package/bin/mcp-conf-tui.js
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
const { Select, Input, Confirm } = require("enquirer");
|
|
4
4
|
const fs = require("node:fs");
|
|
5
|
+
const path = require("node:path");
|
|
6
|
+
const { spawnSync } = require("node:child_process");
|
|
5
7
|
|
|
6
8
|
const CLIENTS = [
|
|
7
9
|
{ name: "cline", message: "Cline" },
|
|
@@ -42,7 +44,13 @@ async function main() {
|
|
|
42
44
|
const scopes = getSupportedScopes(client);
|
|
43
45
|
result.scope = scopes.length === 1 ? scopes[0] : await askSelect("Scope", ["global", "local"]);
|
|
44
46
|
|
|
45
|
-
if (
|
|
47
|
+
if (["rm", "enable", "disable"].includes(result.tuiAction)) {
|
|
48
|
+
const serverNames = listExistingServers(client, result.scope);
|
|
49
|
+
if (serverNames.length === 0) {
|
|
50
|
+
throw new Error(`No existing MCP servers found for ${client} (${result.scope})`);
|
|
51
|
+
}
|
|
52
|
+
result.name = await askSelect("Server name", serverNames);
|
|
53
|
+
} else if (result.tuiAction !== "ls") {
|
|
46
54
|
result.name = await askInput("Server name", "abap");
|
|
47
55
|
} else {
|
|
48
56
|
result.name = null;
|
|
@@ -174,6 +182,31 @@ function getSupportedTransports(clientName) {
|
|
|
174
182
|
return ["stdio", "sse", "http"];
|
|
175
183
|
}
|
|
176
184
|
|
|
185
|
+
function listExistingServers(clientName, scope) {
|
|
186
|
+
const cliPath = path.join(__dirname, "mcp-conf.js");
|
|
187
|
+
const scopeArg = scope === "local" ? "--local" : "--global";
|
|
188
|
+
const run = spawnSync(process.execPath, [cliPath, "ls", "--client", clientName, scopeArg], {
|
|
189
|
+
encoding: "utf8",
|
|
190
|
+
});
|
|
191
|
+
if (run.status !== 0) {
|
|
192
|
+
const stderr = String(run.stderr || "").trim();
|
|
193
|
+
throw new Error(stderr || "Failed to list existing servers for selected client/scope");
|
|
194
|
+
}
|
|
195
|
+
const stdout = String(run.stdout || "");
|
|
196
|
+
const names = [];
|
|
197
|
+
for (const line of stdout.split(/\r?\n/u)) {
|
|
198
|
+
if (!line.startsWith("- ")) {
|
|
199
|
+
continue;
|
|
200
|
+
}
|
|
201
|
+
const name = line.slice(2).trim();
|
|
202
|
+
if (!name || name === "(none)") {
|
|
203
|
+
continue;
|
|
204
|
+
}
|
|
205
|
+
names.push(name);
|
|
206
|
+
}
|
|
207
|
+
return [...new Set(names)].sort((a, b) => a.localeCompare(b));
|
|
208
|
+
}
|
|
209
|
+
|
|
177
210
|
main().catch((error) => {
|
|
178
211
|
if (error === "") {
|
|
179
212
|
process.exit(0);
|
|
@@ -82,6 +82,7 @@ mcp-conf tui
|
|
|
82
82
|
- Flow order: `operation` -> `client` -> `scope`.
|
|
83
83
|
- Scope step is skipped automatically for single-scope clients.
|
|
84
84
|
- For `add` with `sse/http`, the wizard asks URL, timeout, and repeatable headers.
|
|
85
|
+
- For `rm`/`enable`/`disable`, the wizard shows existing server names for selection.
|
|
85
86
|
- Controls: arrow keys + Enter, Ctrl+C to cancel.
|
|
86
87
|
|
|
87
88
|
Options:
|