Skip to content

fix(admin): add missing URL field in server edit modal#4493

Open
ecthelion77 wants to merge 1 commit intoIBM:mainfrom
forterro:fix/admin-edit-server-url-field
Open

fix(admin): add missing URL field in server edit modal#4493
ecthelion77 wants to merge 1 commit intoIBM:mainfrom
forterro:fix/admin-edit-server-url-field

Conversation

@ecthelion77
Copy link
Copy Markdown
Contributor

🐛 Bug-fix PR

Fixes #4492

📌 Summary

The server edit modal is missing the URL input field that servers.js references via safeGetElement('edit-server-url'). The create server modal has the URL field, but the edit modal does not — making it impossible to view or modify a server's URL after creation.

Likely a regression from PR #337 (July 2025) which restructured the server modals.

🔁 Reproduction Steps

  1. Navigate to Virtual MCP Servers in admin UI
  2. Click edit on any server
  3. Edit modal opens without a URL field
  4. No way to view or change the URL

See issue #4492 for details.

🐞 Root Cause

The <input id="edit-server-url"> element was never added to the server-edit-modal form in admin.html. The JavaScript populates it via safeGetElement('edit-server-url') which silently returns null, so the URL is lost on save.

💡 Fix Description

Add the URL input field (type="url", id="edit-server-url") to the server edit modal, between the Name and Description fields, matching the create modal pattern:

<div class="relative">
  <label class="block text-sm font-medium text-gray-700 dark:text-gray-300">URL</label>
  <input type="url" name="url" required id="edit-server-url"
    class="mt-1 px-3 py-2 block w-full rounded-md border border-gray-600 shadow-sm ..." />
  <p data-error-message-for="url" class="...">URL is required.</p>
</div>

Single file change: mcpgateway/templates/admin.html (+14 lines).

🧪 Verification

Check Command Status
Lint suite make lint
Unit tests make test
Manual regression no longer fails Verified in browser

📐 MCP Compliance

  • No impact on MCP protocol
  • No breaking change to MCP clients

✅ Checklist

  • Code formatted
  • No secrets/credentials committed
  • Signed-off-by included in commit

The server edit modal is missing the URL input field that servers.js
references via safeGetElement('edit-server-url'). The create server
modal has the URL field, but the edit modal was missing it since PR IBM#337
(July 2025). This causes the URL to not be editable when editing a
server configuration.

Add the URL input field between the Name and Description fields in
the server-edit-modal form, matching the pattern from the create modal.

Signed-off-by: Olivier Gintrand <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG][UI]: Server edit modal missing URL field — cannot edit server URL

1 participant