[TESTING][CONFIG]: Airgapped Mode Test Plan
[TESTING] Airgapped Mode Test Plan
Goal
Validate that the MCP Gateway works correctly in airgapped (offline) environments where external CDN resources are unavailable, ensuring the Admin UI and all functionality operate using locally bundled assets.
Why Now?
Many enterprise and government deployments operate in airgapped networks with no internet access. Testing ensures:
- Admin UI loads without external CDN dependencies
- All static assets are served locally
- No external network calls are made
- Functionality is identical to online mode
User Stories
US-1: Administrator Deploys in Airgapped Environment
User Story
As a system administrator I want to deploy the MCP Gateway in an airgapped network So that users can manage MCP servers without internet connectivity
Acceptance Criteria
Feature: Airgapped Deployment
Scenario: Admin UI loads without internet
Given MCPGATEWAY_UI_AIRGAPPED is set to true
And the network has no internet access
When I access the Admin UI
Then the UI should load successfully
And all styles and scripts should render correctly
Scenario: No external requests made
Given airgapped mode is enabled
When I monitor network traffic
And I navigate through the Admin UI
Then no requests should be made to external domains
And all assets should be served from the gateway
Scenario: Feature parity with online mode
Given airgapped mode is enabled
When I use all Admin UI features
Then all features should work identically
And no functionality should be degraded
Technical Requirements
- Local bundling of all CSS, JS, fonts
- No CDN references in HTML templates
- Static file serving from gateway
- Feature flag for toggling modes
US-2: Developer Verifies Airgapped Assets
User Story
As a developer I want to verify all required assets are bundled locally So that airgapped deployments have no missing dependencies
Acceptance Criteria
Feature: Asset Verification
Scenario: CSS frameworks bundled
Given airgapped mode is enabled
When I check the static assets directory
Then Tailwind CSS should be present locally
And all component styles should be included
Scenario: JavaScript libraries bundled
Given airgapped mode is enabled
When I check the static assets directory
Then HTMX should be present locally
And Alpine.js should be present locally
And all custom scripts should be included
Scenario: Fonts bundled locally
Given airgapped mode is enabled
When I check the static assets directory
Then all required fonts should be present
And font-face declarations should use local paths
Technical Requirements
- Static asset manifest
- Font subsetting for smaller bundles
- Minified production assets
- Source maps for debugging
Architecture
┌─────────────────────────────────────────────────────────────────────────────┐
│ Airgapped Mode Architecture │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ Configuration (.env): │
│ ┌───────────────────────────────────────────────────────────────────────┐ │
│ │ # Airgapped mode - serve all UI assets from local files │ │
│ │ # When enabled, the UI will not load any external CDN resources │ │
│ │ # Useful for deployments in networks without internet access │ │
│ │ MCPGATEWAY_UI_AIRGAPPED=false # Default: use CDN for faster loads │ │
│ │ MCPGATEWAY_UI_AIRGAPPED=true # Airgapped: all assets local │ │
│ └───────────────────────────────────────────────────────────────────────┘ │
│ │
│ Online Mode (AIRGAPPED=false): │
│ ┌─────────────┐ ┌──────────────────┐ ┌────────────────┐ │
│ │ Browser │───▶│ MCP Gateway │───▶│ HTML Pages │ │
│ └─────────────┘ └──────────────────┘ └───────┬────────┘ │
│ │ │ │
│ │ ┌─────────────────────────────────┘ │
│ │ ▼ │
│ │ ┌─────────────────┐ │
│ └───▶│ CDN Assets │ (HTMX, Alpine, Tailwind, Fonts) │
│ │ (cdn.jsdelivr) │ │
│ └─────────────────┘ │
│ │
│ Airgapped Mode (AIRGAPPED=true): │
│ ┌─────────────┐ ┌──────────────────┐ ┌────────────────┐ │
│ │ Browser │───▶│ MCP Gateway │───▶│ HTML Pages │ │
│ └─────────────┘ └──────────────────┘ └───────┬────────┘ │
│ │ │ │
│ │ ┌─────────────────────────────────┘ │
│ │ ▼ │
│ │ ┌─────────────────┐ │
│ └───▶│ Local Assets │ /static/vendor/... │
│ │ (Gateway) │ │
│ └─────────────────┘ │
│ │
│ Local Assets Structure: │
│ ├── /static/vendor/htmx.min.js │
│ ├── /static/vendor/alpine.min.js │
│ ├── /static/vendor/tailwind.min.css │
│ ├── /static/fonts/inter/... │
│ └── /static/js/app.js │
│ │
└─────────────────────────────────────────────────────────────────────────────┘
Test Environment Setup
Prerequisites
- MCP Gateway with Admin UI enabled
- Network monitoring tool (browser DevTools)
- Optional: Truly airgapped VM for verification
Environment Variables
# Enable airgapped mode
export MCPGATEWAY_UI_ENABLED=true
export MCPGATEWAY_UI_AIRGAPPED=true
Setup Commands
# Start gateway in airgapped mode
cd /home/cmihai/github/mcp-context-forge
MCPGATEWAY_UI_AIRGAPPED=true make dev
# Verify static assets are present
ls -la mcpgateway/static/vendor/
# Start in online mode for comparison
MCPGATEWAY_UI_AIRGAPPED=false make dev
Manual Test Cases
TC-1: UI Loads in Airgapped Mode
| Step | Action | Expected Result |
|---|---|---|
| 1 | Set MCPGATEWAY_UI_AIRGAPPED=true |
Gateway restarts |
| 2 | Open Admin UI in browser | UI loads completely |
| 3 | Check page styling | CSS renders correctly |
| 4 | Check interactive elements | JS works (dropdowns, modals) |
| 5 | Navigate between pages | All pages render correctly |
Verification Steps
# Check that static assets are being served
curl -s http://localhost:8000/static/vendor/htmx.min.js | head -1
curl -s http://localhost:8000/static/vendor/alpine.min.js | head -1
# Open browser DevTools -> Network tab
# Navigate to http://localhost:8000/
# All requests should go to localhost:8000, none to external domains
TC-2: No External Network Requests
| Step | Action | Expected Result |
|---|---|---|
| 1 | Enable airgapped mode | Gateway starts |
| 2 | Open browser DevTools Network tab | Network monitoring active |
| 3 | Clear network log | Clean slate |
| 4 | Load Admin UI | Requests captured |
| 5 | Inspect request URLs | All requests to localhost |
| 6 | Filter external domains | Zero external requests |
Domains to Check
# These CDN domains should NOT appear in airgapped mode:
- cdn.jsdelivr.net
- cdnjs.cloudflare.com
- unpkg.com
- fonts.googleapis.com
- fonts.gstatic.com
- any other external domain
TC-3: Asset Integrity
| Step | Action | Expected Result |
|---|---|---|
| 1 | Check HTMX presence | htmx.min.js exists |
| 2 | Check Alpine.js presence | alpine.min.js exists |
| 3 | Check Tailwind CSS | tailwind.min.css exists |
| 4 | Check custom styles | app.css exists |
| 5 | Check fonts | Font files present |
| 6 | Verify file sizes | Non-empty files |
Asset Verification
# List vendor assets
find mcpgateway/static -name "*.js" -o -name "*.css" | head -20
# Check file sizes
ls -lh mcpgateway/static/vendor/
# Verify HTMX
head -1 mcpgateway/static/vendor/htmx.min.js
# Verify fonts
ls mcpgateway/static/fonts/
TC-4: Feature Parity
| Step | Action | Expected Result |
|---|---|---|
| 1 | Test login | Authentication works |
| 2 | Test navigation | All pages accessible |
| 3 | Test forms | Form submission works |
| 4 | Test modals | Modals open/close correctly |
| 5 | Test HTMX interactions | Dynamic updates work |
| 6 | Test Alpine.js components | Reactive components work |
TC-5: Simulated Airgapped Environment
| Step | Action | Expected Result |
|---|---|---|
| 1 | Block all external domains | Network rules applied |
| 2 | Enable airgapped mode | Gateway starts |
| 3 | Access Admin UI | UI loads successfully |
| 4 | Perform all operations | All work correctly |
| 5 | Re-enable external access | Network restored |
| 6 | Disable airgapped mode | CDN assets used again |
Network Blocking (Linux)
# Block common CDN domains (as root)
iptables -A OUTPUT -d cdn.jsdelivr.net -j REJECT
iptables -A OUTPUT -d cdnjs.cloudflare.com -j REJECT
iptables -A OUTPUT -d unpkg.com -j REJECT
iptables -A OUTPUT -d fonts.googleapis.com -j REJECT
# Test in airgapped mode - should work
MCPGATEWAY_UI_AIRGAPPED=true make dev
# Test without airgapped mode - should fail to load assets
MCPGATEWAY_UI_AIRGAPPED=false make dev
# Remove rules after testing
iptables -D OUTPUT -d cdn.jsdelivr.net -j REJECT
# ... (repeat for other domains)
Test Matrix
| Asset Type | Online Mode Source | Airgapped Mode Source | Status |
|---|---|---|---|
| HTMX | cdn.jsdelivr.net | /static/vendor/htmx.min.js | 🔲 |
| Alpine.js | cdn.jsdelivr.net | /static/vendor/alpine.min.js | 🔲 |
| Tailwind CSS | cdn.tailwindcss.com | /static/vendor/tailwind.min.css | 🔲 |
| Custom CSS | /static/css/app.css | /static/css/app.css | 🔲 |
| Custom JS | /static/js/app.js | /static/js/app.js | 🔲 |
| Fonts | fonts.googleapis.com | /static/fonts/ | 🔲 |
| Icons | CDN or inline | /static/icons/ | 🔲 |
Success Criteria
- [ ] UI loads completely with airgapped mode enabled
- [ ] Zero network requests to external domains
- [ ] All static assets served from /static/
- [ ] CSS renders correctly (layout, colors, fonts)
- [ ] JavaScript functionality works (HTMX, Alpine.js)
- [ ] All Admin UI features work identically
- [ ] Performance acceptable (no significant degradation)
- [ ] Works in truly airgapped environment (no internet)
Definition of Done
- [ ] All test cases pass in airgapped mode
- [ ] Network monitoring confirms no external requests
- [ ] Tested in simulated airgapped environment
- [ ] Asset manifest documented
- [ ] Deployment guide updated for airgapped installations
Related Files
mcpgateway/static/- Static assets directorymcpgateway/static/vendor/- Bundled third-party librariesmcpgateway/templates/base.html- Template with asset referencesmcpgateway/config.py- MCPGATEWAY_UI_AIRGAPPED setting.env.example- Configuration documentation (line 666)
Related Issues
- #2428 - Admin UI testing
- #2475 - Deployment testing
AdminUI is working correctly overall, but some frontend dependencies are missing. This does not impact functionality.
{"method":"GET","url":"https://mcp.devops.poalim.bank/static/vendor/codemirror/addon/mode/simple.min.js","status":404} {"method":"GET","url":"https://mcp.devops.poalim.bank/static/vendor/codemirror/mode/python/python.min.js","status":404} {"method":"GET","url":"https://mcp.devops.poalim.bank/static/vendor/codemirror/mode/shell/shell.min.js","status":404} {"method":"GET","url":"https://mcp.devops.poalim.bank/static/vendor/codemirror/mode/go/go.min.js","status":404} {"method":"GET","url":"https://mcp.devops.poalim.bank/static/vendor/codemirror/mode/rust/rust.min.js","status":404} {"method":"GET","url":"https://mcp.devops.poalim.bank/static/vendor/marked/marked.min.js","status":404} {"method":"GET","url":"https://mcp.devops.poalim.bank/static/vendor/dompurify/purify.min.js","status":404}
Triage: Validated. Well-structured test plan for airgapped deployments. Needs an assignee. Consider downgrading to SHOULD — this is QA documentation, not a code deliverable blocking release.
Closing — resolved in main.
Airgapped mode is fully documented and testable:
docs/docs/overview/ui.mdhas a dedicated "Air-Gapped Mode" section- Environment variable:
MCPGATEWAY_UI_AIRGAPPED=true - Local development:
scripts/download-cdn-assets.sh+MCPGATEWAY_UI_AIRGAPPED=true make dev - Container builds:
Containerfile.liteautomatically downloads and bundles vendor assets - All vendor library versions and sizes documented
- Referenced from
docs/docs/development/building.md