agent-discover 1.0.3 → 1.0.4

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/dist/ui/app.js CHANGED
@@ -496,8 +496,11 @@
496
496
  } else {
497
497
  el.innerHTML =
498
498
  '<div class="empty-state"><span class="material-symbols-outlined empty-icon">search_off</span><p>No results in MCP registry</p>' +
499
- '<p class="hint">Know the npm package? Install via MCP tool:</p>' +
500
- '<code class="hint-code">registry({ action: "install", name: "my-server", command: "npx", args: ["-y", "@scope/package"] })</code></div>';
499
+ '<p class="hint">Install from npm directly:</p>' +
500
+ '<div class="npm-install-form">' +
501
+ '<input type="text" id="npm-package-input" placeholder="npm package (e.g. @modelcontextprotocol/server-everything)" />' +
502
+ '<button class="btn-install" onclick="window.__installFromNpm()"><span class="material-symbols-outlined" style="font-size:14px">download</span> Install</button>' +
503
+ '</div></div>';
501
504
  }
502
505
  return;
503
506
  }
@@ -645,6 +648,38 @@
645
648
  });
646
649
  };
647
650
 
651
+ window.__installFromNpm = function () {
652
+ var input = document.getElementById('npm-package-input');
653
+ var pkg = (input ? input.value : '').trim();
654
+ if (!pkg) return;
655
+
656
+ var safeName = pkg.replace(/@/g, '').replace(/\//g, '-');
657
+ fetch('/api/servers', {
658
+ method: 'POST',
659
+ headers: { 'Content-Type': 'application/json' },
660
+ body: JSON.stringify({
661
+ name: safeName,
662
+ command: 'npx',
663
+ args: ['-y', pkg],
664
+ description: 'Installed from npm: ' + pkg,
665
+ source: 'registry',
666
+ tags: ['npm'],
667
+ }),
668
+ })
669
+ .then(function (r) {
670
+ if (!r.ok) throw new Error('Install failed');
671
+ return r.json();
672
+ })
673
+ .then(function () {
674
+ showToast('Installed ' + pkg, 'success');
675
+ if (input) input.value = '';
676
+ })
677
+ .catch(function (err) {
678
+ console.error('npm install failed:', err);
679
+ showToast('Install failed: ' + err.message, 'error');
680
+ });
681
+ };
682
+
648
683
  // -------------------------------------------------------------------------
649
684
  // Enterprise feature actions
650
685
  // -------------------------------------------------------------------------
@@ -483,16 +483,31 @@ body {
483
483
  margin-top: 4px;
484
484
  }
485
485
 
486
- .hint-code {
487
- display: block;
488
- margin-top: 8px;
489
- font-family: var(--font-mono);
490
- font-size: 11px;
491
- background: var(--bg-elevated);
492
- padding: 8px 12px;
486
+ .npm-install-form {
487
+ display: flex;
488
+ gap: 8px;
489
+ margin-top: 12px;
490
+ max-width: 500px;
491
+ }
492
+
493
+ .npm-install-form input {
494
+ flex: 1;
495
+ background: var(--bg);
496
+ border: 1px solid var(--border);
493
497
  border-radius: 6px;
494
- color: var(--accent);
495
- word-break: break-all;
498
+ padding: 8px 12px;
499
+ color: var(--text);
500
+ font-family: var(--font-mono);
501
+ font-size: 12px;
502
+ }
503
+
504
+ .npm-install-form input:focus {
505
+ outline: none;
506
+ border-color: var(--accent);
507
+ }
508
+
509
+ .npm-install-form .btn-install {
510
+ flex-shrink: 0;
496
511
  }
497
512
 
498
513
  /* ---------------------------------------------------------------------------
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-discover",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "mcpName": "io.github.keshrath/agent-discover",
5
5
  "description": "MCP server registry and marketplace — discover, install, activate, and manage MCP tools on demand",
6
6
  "type": "module",