Customizing the Admin UI
The Admin experience is shipped as a Jinja template (mcpgateway/templates/admin.html)
with supporting assets in mcpgateway/static/. It uses HTMX for
request/response swaps, Alpine.js for light-weight reactivity, and the
Tailwind CDN for styling. There are no environment-variable knobs for colors or
layout—the way to customise it is to edit those files (or layer overrides during
deployment).
Technology Stack
| Library |
Version |
Purpose |
| HTMX |
1.9.10 |
AJAX interactions, HTML-over-HTTP |
| Alpine.js |
3.x |
Lightweight reactive components |
| Tailwind CSS |
CDN |
Utility-first styling |
| CodeMirror |
5.65.18 |
Syntax-highlighted code editing |
| Chart.js |
- |
Data visualization |
| Marked.js |
- |
Markdown rendering |
| DOMPurify |
- |
XSS sanitization |
| Font Awesome |
- |
Icons |
All vendor libraries are bundled locally in mcpgateway/static/vendor/ for air-gapped deployments. Enable with MCPGATEWAY_UI_AIRGAPPED=true. See Air-Gapped Mode.
Feature Flags to Enable the UI
Ensure the Admin interface is turned on before making changes:
MCPGATEWAY_UI_ENABLED=true
MCPGATEWAY_ADMIN_API_ENABLED=true
Other UI-related settings:
MCPGATEWAY_UI_AIRGAPPED (boolean, default: false) – Load CSS/JS from local vendor files instead of CDNs
MCPGATEWAY_UI_TOOL_TEST_TIMEOUT (milliseconds) – Timeout for the "Test Tool" action in the Tools catalog
Every other visual/behaviour change is code-driven.
Recommended Editing Workflow
Copy .env.example to .env, then set:
DEV_MODE=true
RELOAD=true
This enables template + static reloads while you work.
Start the dev server: make dev (serves the UI at http://localhost:8000).
Edit any of the following and refresh your browser:
mcpgateway/templates/admin.html
mcpgateway/static/admin.css
mcpgateway/static/admin.js
- Additional assets under
mcpgateway/static/
Commit the customised files or prepare overrides for your deployment target
(see Deploying Overrides).
Tip: keep your changes on a dedicated branch so that rebase/merge with upstream
remains manageable.
File Layout Reference
| Path |
Description |
mcpgateway/templates/admin.html |
Single-page admin template containing header, navigation, tables, modals, metrics, etc. |
mcpgateway/static/admin.css |
Tailwind-friendly overrides (spinners, tooltips, table tweaks). |
mcpgateway/static/admin.js |
Behaviour helpers (form toggles, request utilities, validation). |
mcpgateway/static/images/ |
Default logo, favicon, and imagery used in the UI. |
All static assets are served from /static/ and respect ROOT_PATH when the
app is mounted behind a proxy.
Branding Essentials
Document Title & Header
Update the <title> element and the main <h1> block near the top of
admin.html with your organisation's name.
The secondary copy and links (Docs, GitHub star) live in the same header
section—edit or remove them as needed.
Logo & Favicon
Replace the default files in mcpgateway/static/ (or add your own under
static/images/).
Update the <link rel="icon"> and <img src="..."> references in
admin.html to point to your assets, e.g.
<link rel="icon" href="{{ root_path }}/static/images/company-favicon.ico" />
<img src="{{ root_path }}/static/images/company-logo.svg" class="h-8" alt="Company" />
Colors & Tailwind
Tailwind is initialised in admin.html via https://cdn.tailwindcss.com with
darkMode: "class".
Add a custom config block to extend colours/fonts and swap utility classes, for example:
<script>
tailwind.config = {
darkMode: "class",
theme: {
extend: {
colors: { brand: "#1d4ed8", accent: "#f97316" },
fontFamily: { display: ['"IBM Plex Sans"', 'sans-serif'] },
},
},
};
</script>
For bespoke CSS (animations, overrides), append to admin.css or include a
new stylesheet in the <head>:
<link rel="stylesheet" href="{{ root_path }}/static/css/custom.css" />
Theme Toggle
Behaviour Customisation
admin.js powers form helpers (e.g. locking the Tool URL field when MCP is
selected) and general UX‐polish. Append your scripts there or include a new JS
file at the end of admin.html.
Use HTMX hooks (htmx:beforeSwap, htmx:afterSwap, etc.) if you need to
intercept requests.
Alpine components live on each panel (look for x-data="tabs", etc.)—extend
them by adding properties/methods in the x-data object.
Avoid writing raw innerHTML with user data to preserve the UI's XSS
protections; prefer textContent.
Lazy-loaded sections (bulk import, A2A, teams, etc.) are clearly marked in the
template—remove panels you don't need.
Key Template Anchors
Search for these comments in admin.html when hunting for specific areas:
<!-- Navigation Tabs --> – top-level tab buttons.
<!-- Status Cards --> – summary cards for totals.
<!-- Servers Table -->, <!-- Tools Table -->, <!-- Resources Table -->, etc. – per-resource CRUD grids.
<!-- Bulk Import Modal -->, <!-- Team Modal --> – modal dialogs.
id="metadata-tracking", id="a2a-agents", id="team-management" – advanced sections you can prune or reorder.
Make your edits and refresh the browser to confirm behaviour.
Deploying Overrides
When packaging the gateway:
Bake into the image – copy customised templates/static files during the
container build.
Mount at runtime – overlay files via volumes:
docker run \
-v $(pwd)/overrides/admin.html:/app/mcpgateway/templates/admin.html:ro \
-v $(pwd)/overrides/static:/app/mcpgateway/static/custom:ro \
ghcr.io/ibm/mcp-context-forge:1.0.0-RC-1
Then update template references to point at static/custom/....
Fork + rebase – maintain a thin fork that carries your branding patches.
In Kubernetes, place customised assets in a ConfigMap/Secret and mount over the
default paths (/app/mcpgateway/templates/admin.html, /app/mcpgateway/static/).
Roll the deployment after changes so the pod picks up the new files.
Testing Checklist
make dev – confirm the UI renders, tabs switch, and tables load as expected.
Optional: pytest tests/playwright/ -k admin – run UI smoke tests if you
altered interaction logic.
Verify in a staging/production-like environment that:
- Static assets resolve behind your proxy (
ROOT_PATH/APP_DOMAIN).
- Authentication flows still succeed (basic + JWT).
- Any branding assets load quickly (serve them via CDN if heavy).
Document your customisations internally so future upgrades know which sections
were changed.
1---2name: customizing-the-admin-ui3description: The Admin experience is shipped as a Jinja template (mcpgateway/templates/admin.html) with supporting assets in mcpgateway/static/.4---5# Customizing the Admin UI67The Admin experience is shipped as a Jinja template (`mcpgateway/templates/admin.html`)8with supporting assets in `mcpgateway/static/`. It uses **HTMX** for9request/response swaps, **Alpine.js** for light-weight reactivity, and the10Tailwind CDN for styling. There are no environment-variable knobs for colors or11layout—the way to customise it is to edit those files (or layer overrides during12deployment).1314### Technology Stack1516| Library | Version | Purpose |17|---------|---------|---------|18| HTMX | 1.9.10 | AJAX interactions, HTML-over-HTTP |19| Alpine.js | 3.x | Lightweight reactive components |20| Tailwind CSS | CDN | Utility-first styling |21| CodeMirror | 5.65.18 | Syntax-highlighted code editing |22| Chart.js | - | Data visualization |23| Marked.js | - | Markdown rendering |24| DOMPurify | - | XSS sanitization |25| Font Awesome | - | Icons |2627All vendor libraries are bundled locally in `mcpgateway/static/vendor/` for air-gapped deployments. Enable with `MCPGATEWAY_UI_AIRGAPPED=true`. See [Air-Gapped Mode](../overview/ui.md#air-gapped-mode).2829---3031## Feature Flags to Enable the UI3233Ensure the Admin interface is turned on before making changes:3435```bash36MCPGATEWAY_UI_ENABLED=true37MCPGATEWAY_ADMIN_API_ENABLED=true38```3940Other UI-related settings:4142- `MCPGATEWAY_UI_AIRGAPPED` (boolean, default: `false`) – Load CSS/JS from local vendor files instead of CDNs43- `MCPGATEWAY_UI_TOOL_TEST_TIMEOUT` (milliseconds) – Timeout for the "Test Tool" action in the Tools catalog4445Every other visual/behaviour change is code-driven.4647---4849## Recommended Editing Workflow50511. Copy `.env.example` to `.env`, then set:52 ```bash53 DEV_MODE=true54 RELOAD=true55 ```56 This enables template + static reloads while you work.57582. Start the dev server: `make dev` (serves the UI at http://localhost:8000).593. Edit any of the following and refresh your browser:6061 - `mcpgateway/templates/admin.html`62 - `mcpgateway/static/admin.css`63 - `mcpgateway/static/admin.js`64 - Additional assets under `mcpgateway/static/`65664. Commit the customised files or prepare overrides for your deployment target67 (see [Deploying Overrides](#deploying-overrides)).6869Tip: keep your changes on a dedicated branch so that rebase/merge with upstream70remains manageable.7172---7374## File Layout Reference7576| Path | Description |77| --- | --- |78| `mcpgateway/templates/admin.html` | Single-page admin template containing header, navigation, tables, modals, metrics, etc. |79| `mcpgateway/static/admin.css` | Tailwind-friendly overrides (spinners, tooltips, table tweaks). |80| `mcpgateway/static/admin.js` | Behaviour helpers (form toggles, request utilities, validation). |81| `mcpgateway/static/images/` | Default logo, favicon, and imagery used in the UI. |8283All static assets are served from `/static/` and respect `ROOT_PATH` when the84app is mounted behind a proxy.8586---8788## Branding Essentials8990### Document Title & Header91- Update the `<title>` element and the main `<h1>` block near the top of92 `admin.html` with your organisation's name.9394- The secondary copy and links (Docs, GitHub star) live in the same header95 section—edit or remove them as needed.9697### Logo & Favicon98- Replace the default files in `mcpgateway/static/` (or add your own under99 `static/images/`).100101- Update the `<link rel="icon">` and `<img src="...">` references in102 `admin.html` to point to your assets, e.g.103 ```html104 <link rel="icon" href="{{ root_path }}/static/images/company-favicon.ico" />105 <img src="{{ root_path }}/static/images/company-logo.svg" class="h-8" alt="Company" />106 ```107108### Colors & Tailwind109- Tailwind is initialised in `admin.html` via `https://cdn.tailwindcss.com` with110 `darkMode: "class"`.111112- Add a custom config block to extend colours/fonts and swap utility classes, for example:113 ```html114 <script>115 tailwind.config = {116 darkMode: "class",117 theme: {118 extend: {119 colors: { brand: "#1d4ed8", accent: "#f97316" },120 fontFamily: { display: ['"IBM Plex Sans"', 'sans-serif'] },121 },122 },123 };124 </script>125 ```126- For bespoke CSS (animations, overrides), append to `admin.css` or include a127 new stylesheet in the `<head>`:128 ```html129 <link rel="stylesheet" href="{{ root_path }}/static/css/custom.css" />130 ```131132### Theme Toggle133- The dark/light toggle persists a `darkMode` value in `localStorage`. Change the134 default by altering the `x-data` initialiser in the `<html>` tag if you want to135 default to dark:136 ```html137 x-data="{ darkMode: JSON.parse(localStorage.getItem('darkMode') || 'true') }"138 ```139140---141142## Behaviour Customisation143144- `admin.js` powers form helpers (e.g. locking the Tool URL field when MCP is145 selected) and general UX‐polish. Append your scripts there or include a new JS146 file at the end of `admin.html`.147148- Use HTMX hooks (`htmx:beforeSwap`, `htmx:afterSwap`, etc.) if you need to149 intercept requests.150151- Alpine components live on each panel (look for `x-data="tabs"`, etc.)—extend152 them by adding properties/methods in the `x-data` object.153154- Avoid writing raw `innerHTML` with user data to preserve the UI's XSS155 protections; prefer `textContent`.156157- Lazy-loaded sections (bulk import, A2A, teams, etc.) are clearly marked in the158 template—remove panels you don't need.159160---161162## Key Template Anchors163164Search for these comments in `admin.html` when hunting for specific areas:165166- `<!-- Navigation Tabs -->` – top-level tab buttons.167- `<!-- Status Cards -->` – summary cards for totals.168- `<!-- Servers Table -->`, `<!-- Tools Table -->`, `<!-- Resources Table -->`, etc. – per-resource CRUD grids.169- `<!-- Bulk Import Modal -->`, `<!-- Team Modal -->` – modal dialogs.170- `id="metadata-tracking"`, `id="a2a-agents"`, `id="team-management"` – advanced sections you can prune or reorder.171172Make your edits and refresh the browser to confirm behaviour.173174---175176## Deploying Overrides177178When packaging the gateway:179180- **Bake into the image** – copy customised templates/static files during the181 container build.182183- **Mount at runtime** – overlay files via volumes:184 ```bash185 docker run \186 -v $(pwd)/overrides/admin.html:/app/mcpgateway/templates/admin.html:ro \187 -v $(pwd)/overrides/static:/app/mcpgateway/static/custom:ro \188 ghcr.io/ibm/mcp-context-forge:1.0.0-RC-1189 ```190 Then update template references to point at `static/custom/...`.191192- **Fork + rebase** – maintain a thin fork that carries your branding patches.193194In Kubernetes, place customised assets in a ConfigMap/Secret and mount over the195default paths (`/app/mcpgateway/templates/admin.html`, `/app/mcpgateway/static/`).196Roll the deployment after changes so the pod picks up the new files.197198---199200## Testing Checklist2012021. `make dev` – confirm the UI renders, tabs switch, and tables load as expected.2032. Optional: `pytest tests/playwright/ -k admin` – run UI smoke tests if you204 altered interaction logic.2052063. Verify in a staging/production-like environment that:207208 - Static assets resolve behind your proxy (`ROOT_PATH`/`APP_DOMAIN`).209 - Authentication flows still succeed (basic + JWT).210 - Any branding assets load quickly (serve them via CDN if heavy).2112124. Document your customisations internally so future upgrades know which sections213 were changed.