Skip to content

feat(ui): flexible admin UI sections for embedded contexts#2869

Draft
crivetimihai wants to merge 2 commits intomainfrom
ui-feature-flags
Draft

feat(ui): flexible admin UI sections for embedded contexts#2869
crivetimihai wants to merge 2 commits intomainfrom
ui-feature-flags

Conversation

@crivetimihai
Copy link
Member

@crivetimihai crivetimihai commented Feb 12, 2026

Summary

Closes #2075

Adds flexible Admin UI visibility controls for embedded contexts, allowing specific UI sections and header controls to be hidden without triggering backend data loads. Hidden/
invalid hash navigation is redirected to the first available visible tab.

Configuration

New env vars:

  • MCPGATEWAY_UI_EMBEDDED (bool): Enables embedded UI mode (hides logout + team_selector by default).
  • MCPGATEWAY_UI_HIDE_SECTIONS (CSV/JSON list): Hide UI sections.
    • Valid: servers, gateways, tools, prompts, resources, teams, users, agents, tokens, settings
    • Aliases supported: catalog/virtual_servers -> servers, a2a/a2a-agents/grpc-services -> agents, api_tokens -> tokens, llm-settings -> settings
  • MCPGATEWAY_UI_HIDE_HEADER_ITEMS (CSV/JSON list): Hide header items.
    • Valid: logout, team_selector, user_identity, theme_toggle

Per-request override:

  • GET /admin/?ui_hide=prompts,resources,teams
  • Query override is persisted to a session cookie (mcpgateway_ui_hide_sections); clear by visiting /admin/?ui_hide=.

What Changed

  • mcpgateway/config.py
    • Adds embedded/visibility settings with CSV/JSON parsing, aliasing, validation, and dedupe.
  • mcpgateway/admin.py
    • Computes effective hidden sections/header items/tabs from env + embedded defaults + query param + cookie.
    • Skips service list calls (and team lookups where possible) for hidden sections so hidden UI does not load data.
    • Persists ui_hide overrides in an HttpOnly cookie (honors secure/samesite settings).
  • mcpgateway/templates/admin.html
    • Conditionally renders sidebar links, panels, and header items based on hidden values.
    • Exposes UI_HIDDEN_SECTIONS, UI_HIDDEN_HEADER_ITEMS, UI_HIDDEN_TABS globals for client-side nav.
  • mcpgateway/static/admin.js
    • Hidden-aware tab resolution: redirects hidden/invalid hashes to a visible default tab and blocks navigation to hidden tabs.
    • Prevents duplicate loads from overlapping click/hashchange handlers.
    • Skips tools loading and section reload logic when sections are hidden.
  • Packaging/docs
    • Updates charts/mcp-stack/values.yaml, charts/mcp-stack/values.schema.json, charts/mcp-stack/README.md
    • Updates docker-compose.yml
    • Updates docs/docs/config.schema.json and docs/docs/manage/configuration.md

Add env controls to hide UI sections/header items (including embedded mode defaults).

Support per-request ?ui_hide= overrides persisted via cookie and prevent hidden sections from loading data.

Update Helm values/schema, docker-compose, docs, and add unit + JS tests.

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
@crivetimihai crivetimihai self-assigned this Feb 12, 2026
@crivetimihai crivetimihai added ica ICA related issues ui User Interface labels Feb 12, 2026
Prefer the Overview tab when available and fall back to Gateways for minimal DOM states.

Align JS tab tests with the restored default tab behavior.

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ica ICA related issues ui User Interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE][UI]: Flexible UI sections for embedded contexts

1 participant