@mcp-abap-adt/configurator 0.2.0 → 0.2.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.
Files changed (2) hide show
  1. package/bin/mcp-conf.js +62 -4
  2. package/package.json +1 -1
package/bin/mcp-conf.js CHANGED
@@ -434,7 +434,7 @@ for (const client of options.clients) {
434
434
  case "gemini":
435
435
  requireScope("Gemini", ["local"], scope);
436
436
  if (options.list) {
437
- listJsonConfig(getGeminiPath(), "gemini");
437
+ listGeminiConfig(getGeminiPath(), getGeminiEnablementPath(home));
438
438
  } else if (options.show) {
439
439
  showJsonConfig(getGeminiPath(), "gemini", options.name);
440
440
  } else if (options.where) {
@@ -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
- fail(
733
- `${clientType === "cursor" ? "Cursor" : "GitHub Copilot"} enable/disable is not implemented yet.`,
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,
@@ -1235,6 +1268,23 @@ function listJsonConfig(filePath, clientType) {
1235
1268
  outputList(filePath, Object.keys(store));
1236
1269
  }
1237
1270
 
1271
+ function listGeminiConfig(filePath, enablementPath) {
1272
+ const data = readJson(filePath);
1273
+ const store = data.mcpServers || {};
1274
+ const enablement = readJson(enablementPath);
1275
+ const keys = Object.keys(store);
1276
+ const header = `# ${filePath}`;
1277
+ process.stdout.write(`${header}\n`);
1278
+ if (!keys.length) {
1279
+ process.stdout.write("- (none)\n");
1280
+ return;
1281
+ }
1282
+ for (const name of keys.sort()) {
1283
+ const status = enablement[name]?.enabled === false ? " (disabled)" : "";
1284
+ process.stdout.write(`- ${name}${status}\n`);
1285
+ }
1286
+ }
1287
+
1238
1288
  function listCodexConfig(filePath) {
1239
1289
  if (!toml) {
1240
1290
  fail("TOML dependency not available. Install dependencies and retry.");
@@ -1617,6 +1667,11 @@ function inferTransport(clientType, entry, parsedArgs) {
1617
1667
  if (clientType === "antigravity") {
1618
1668
  return entry?.type === "http" ? "http" : "stdio";
1619
1669
  }
1670
+ if (clientType === "gemini") {
1671
+ if (entry?.httpUrl) return "http";
1672
+ if (entry?.url) return "sse";
1673
+ return "stdio";
1674
+ }
1620
1675
  if (clientType === "crush") {
1621
1676
  if (entry?.type === "http") return "http";
1622
1677
  if (entry?.type === "sse") return "sse";
@@ -1645,6 +1700,9 @@ function inferUrl(clientType, entry) {
1645
1700
  if (clientType === "antigravity") {
1646
1701
  return entry?.serverUrl || null;
1647
1702
  }
1703
+ if (clientType === "gemini") {
1704
+ return entry?.httpUrl || entry?.url || null;
1705
+ }
1648
1706
  return entry?.url || null;
1649
1707
  }
1650
1708
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mcp-abap-adt/configurator",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "MCP client configurator for mcp-abap-adt and mcp-abap-adt-proxy",
5
5
  "license": "MIT",
6
6
  "repository": {