Skip to content

[BUG]: Add dependency documentation to fix broken nav #4041

@a-effort

Description

@a-effort

🐞 Bug Summary

Admin UI tab navigation is completely broken on a clean checkout: every hash-based route (#overview, #gateways, #tools, etc.) renders the same content (the overview panel) regardless of which tab is requested.

Root cause: the Vite JS bundle (mcpgateway/static/bundle-*.js) was never built or committed after the modularisation refactor in #3137. With no bundle present the server serves an empty <script src="/static/"> tag (404), window.Admin is never initialised, and no tab-switching JavaScript runs. The overview panel is the only panel rendered without a hidden CSS class in the HTML, so it is all that ever appears.


🧩 Affected Component

Area of the project impacted:

  • mcpgateway - UI (admin panel)
  • CLI, Makefiles, or shell scripts

🔁 Steps to Reproduce

  1. Clone the repository at main (post-feat(ui): modularize admin scope into independent modules #3137).
  2. Follow the documented setup: cp .env.example .env && make install-dev check-env
  3. Start the server: make dev (or make serve)
  4. Open http://localhost:8000/admin/
  5. Click any sidebar tab, or navigate directly to a hash route such as http://localhost:8000/admin/#gateways

🤔 Expected Behavior

Each tab should display its own content panel. Navigating to #gateways should show the MCP Servers table; #overview should show the Overview dashboard, etc.


📓 Logs / Error Output

Browser developer console:
GET http://localhost:8000/static/ 404 (Not Found)
Uncaught ReferenceError: Admin is not defined at admin.html:

Server log:
ERROR    mcpgateway.admin: No bundle-*.js found in .../mcpgateway/static — admin UI will not load

🧠 Environment Info

Key Value
Version or commit main post-#3137 (e0513757b)
Runtime Python 3.11+, any (uvicorn / gunicorn)
Platform / OS Any
Container Reproduces with or without containers

🧩 Additional Context (optional)

Why this happened: PR #3137 replaced the hand-written mcpgateway/static/admin.js with a Vite-bundled equivalent under mcpgateway/admin_ui/. The build step (npm install && npm run vite:build) was not run as part of that PR, so no bundle-*.js was committed and the .vite/manifest.json the server reads to locate the file was also absent.

Fix (branch fix/4041-dependency-documentation):

  • Commits the compiled bundle (bundle-CB59m_Zy.js) and Vite manifest so the
    UI works on a clean checkout.
  • Documents the required npm install && npm run vite:build step in README.md,
    docs/docs/development/building.md, and CLAUDE.md (AGENTS.md).

Workaround (until the fix is merged):

npm install
npm run vite:build

Re-run after any change to files under mcpgateway/admin_ui/.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdocumentationImprovements or additions to documentationfrontendFrontend development (HTML, CSS, JavaScript)regressionHigh priority regression

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions