mcp-config-manager 1.0.4 → 1.0.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-config-manager",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "Simple CLI and web UI to manage MCP configs across multiple AI clients",
5
5
  "main": "src/cli.js",
6
6
  "bin": {
package/public/index.html CHANGED
@@ -314,12 +314,12 @@
314
314
  </div>
315
315
  </div>
316
316
 
317
- <script type="module" src="js/utils.js"></script>
318
- <script type="module" src="js/api.js"></script>
319
- <script type="module" src="js/modals.js"></script>
320
- <script type="module" src="js/clientView.js"></script>
321
- <script type="module" src="js/kanbanView.js"></script>
322
- <script type="module" src="js/serverView.js"></script>
323
- <script type="module" src="js/main.js"></script>
317
+ <script type="module" src="js/utils.js?v=2"></script>
318
+ <script type="module" src="js/api.js?v=2"></script>
319
+ <script type="module" src="js/modals.js?v=2"></script>
320
+ <script type="module" src="js/clientView.js?v=2"></script>
321
+ <script type="module" src="js/kanbanView.js?v=2"></script>
322
+ <script type="module" src="js/serverView.js?v=2"></script>
323
+ <script type="module" src="js/main.js?v=2"></script>
324
324
  </body>
325
325
  </html>
@@ -1,15 +1,19 @@
1
- import { getClientConfigApi, copyServerApi } from './api.js';
2
- import { showServerModal, editServer, deleteServer, copyToClipboard, exportServer } from './modals.js';
1
+ import { getClientConfigApi, copyServerApi, deleteServerApi } from './api.js';
2
+ import { showServerModal, editServer, copyToClipboard, exportServer } from './modals.js';
3
3
 
4
4
  let clients = []; // This will be passed from main.js
5
5
  let draggedServer = null;
6
6
  let draggedFromClient = null;
7
7
  let loadClientsCallback = null; // Callback to main.js to reload all clients
8
+ let listenersAttached = false; // Track if event listeners have been attached
8
9
 
9
10
  export function initKanbanView(allClients, loadClientsFn) {
10
11
  clients = allClients;
11
12
  loadClientsCallback = loadClientsFn;
12
- attachKanbanViewEventListeners();
13
+ if (!listenersAttached) {
14
+ attachKanbanViewEventListeners();
15
+ listenersAttached = true;
16
+ }
13
17
  }
14
18
 
15
19
  // Simple hash function to generate a consistent color from a string
@@ -199,13 +203,22 @@ export const editServerKanban = (clientId, serverName, event) => {
199
203
  editServer(serverName, renderKanbanBoard, clientId, loadClientsCallback);
200
204
  };
201
205
 
202
- export const deleteServerKanban = (clientId, serverName, event) => {
206
+ export const deleteServerKanban = async (clientId, serverName, event) => {
203
207
  event.stopPropagation();
204
208
  if (!confirm(`Are you sure you want to delete the server "${serverName}" from ${clients.find(c => c.id === clientId).name}?`)) {
205
209
  return;
206
210
  }
207
211
 
208
- deleteServer(serverName, () => window.loadClients(), null, window.loadClients, clientId); // Pass clientId
212
+ try {
213
+ const response = await deleteServerApi(clientId, serverName);
214
+ if (response.success) {
215
+ await window.loadClients();
216
+ } else {
217
+ throw new Error('Failed to delete server');
218
+ }
219
+ } catch (error) {
220
+ alert('Failed to delete server: ' + error.message);
221
+ }
209
222
  };
210
223
 
211
224
  export const exportServerKanban = (clientId, serverName, event) => {