@mcp-abap-adt/configurator 0.2.0 → 0.2.1
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/bin/mcp-conf.js +44 -3
- package/package.json +1 -1
package/bin/mcp-conf.js
CHANGED
|
@@ -643,6 +643,10 @@ function getGeminiPath() {
|
|
|
643
643
|
return path.join(process.cwd(), ".gemini", "settings.json");
|
|
644
644
|
}
|
|
645
645
|
|
|
646
|
+
function getGeminiEnablementPath(homeDir) {
|
|
647
|
+
return path.join(homeDir, ".gemini", "mcp-server-enablement.json");
|
|
648
|
+
}
|
|
649
|
+
|
|
646
650
|
function getQwenPath(homeDir) {
|
|
647
651
|
return path.join(homeDir, ".qwen", "settings.json");
|
|
648
652
|
}
|
|
@@ -729,9 +733,20 @@ function writeJsonConfig(filePath, serverName, argsArray, clientType) {
|
|
|
729
733
|
}
|
|
730
734
|
if (options.toggle) {
|
|
731
735
|
if (clientType === "cursor" || clientType === "copilot") {
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
736
|
+
const label = clientType === "cursor" ? "Cursor" : "GitHub Copilot";
|
|
737
|
+
fail(`${label} enable/disable is not implemented yet.`);
|
|
738
|
+
}
|
|
739
|
+
if (clientType === "gemini") {
|
|
740
|
+
const store = data.mcpServers || {};
|
|
741
|
+
if (!store[serverName]) {
|
|
742
|
+
fail(`Server "${serverName}" not found in ${filePath}.`);
|
|
743
|
+
}
|
|
744
|
+
const enablementPath = getGeminiEnablementPath(home);
|
|
745
|
+
ensureDir(enablementPath);
|
|
746
|
+
const enablementData = readJson(enablementPath);
|
|
747
|
+
enablementData[serverName] = { enabled: !options.disabled };
|
|
748
|
+
writeFile(enablementPath, JSON.stringify(enablementData, null, 2));
|
|
749
|
+
return;
|
|
735
750
|
}
|
|
736
751
|
const store =
|
|
737
752
|
clientType === "opencode" || clientType === "crush"
|
|
@@ -864,6 +879,24 @@ function writeJsonConfig(filePath, serverName, argsArray, clientType) {
|
|
|
864
879
|
writeFile(filePath, JSON.stringify(data, null, 2));
|
|
865
880
|
return;
|
|
866
881
|
}
|
|
882
|
+
if (clientType === "gemini") {
|
|
883
|
+
if (options.transport === "stdio") {
|
|
884
|
+
store[serverName] = {
|
|
885
|
+
command: options.command,
|
|
886
|
+
args: argsArray,
|
|
887
|
+
};
|
|
888
|
+
} else {
|
|
889
|
+
const entry = {
|
|
890
|
+
httpUrl: options.url,
|
|
891
|
+
};
|
|
892
|
+
if (Object.keys(options.headers).length > 0) {
|
|
893
|
+
entry.headers = options.headers;
|
|
894
|
+
}
|
|
895
|
+
store[serverName] = entry;
|
|
896
|
+
}
|
|
897
|
+
writeFile(filePath, JSON.stringify(data, null, 2));
|
|
898
|
+
return;
|
|
899
|
+
}
|
|
867
900
|
if (options.transport === "stdio") {
|
|
868
901
|
data.mcpServers[serverName] = {
|
|
869
902
|
command: options.command,
|
|
@@ -1617,6 +1650,11 @@ function inferTransport(clientType, entry, parsedArgs) {
|
|
|
1617
1650
|
if (clientType === "antigravity") {
|
|
1618
1651
|
return entry?.type === "http" ? "http" : "stdio";
|
|
1619
1652
|
}
|
|
1653
|
+
if (clientType === "gemini") {
|
|
1654
|
+
if (entry?.httpUrl) return "http";
|
|
1655
|
+
if (entry?.url) return "sse";
|
|
1656
|
+
return "stdio";
|
|
1657
|
+
}
|
|
1620
1658
|
if (clientType === "crush") {
|
|
1621
1659
|
if (entry?.type === "http") return "http";
|
|
1622
1660
|
if (entry?.type === "sse") return "sse";
|
|
@@ -1645,6 +1683,9 @@ function inferUrl(clientType, entry) {
|
|
|
1645
1683
|
if (clientType === "antigravity") {
|
|
1646
1684
|
return entry?.serverUrl || null;
|
|
1647
1685
|
}
|
|
1686
|
+
if (clientType === "gemini") {
|
|
1687
|
+
return entry?.httpUrl || entry?.url || null;
|
|
1688
|
+
}
|
|
1648
1689
|
return entry?.url || null;
|
|
1649
1690
|
}
|
|
1650
1691
|
|