A modern, interactive web-based user interface for the High Command MCP Server. This React + TypeScript application provides a chat-like prompt interface for interacting with the High Command strategic management system.
- π¬ Interactive Chat Interface - Send commands and receive real-time responses
- π Campaign Data Display - View war status and campaign statistics
- ποΈ Strategic Prompt - Query the High Command system with natural language
- β‘ Real-time Updates - Live data from the High Command MCP Server
- π¨ Modern UI - Dark theme with military aesthetic
War Status- Get current campaign statusList Planets- View all planets in the campaignShow Factions- Display faction informationGet Biomes- Information about planetary biomesGet Statistics- Global game statistics
src/
βββ components/
β βββ ChatInterface.tsx # Main chat UI component
β βββ ChatInterface.css # Chat styling
β βββ DataDisplay.tsx # Campaign data viewer
β βββ DataDisplay.css # Data display styling
βββ services/
β βββ api.ts # High Command API client
βββ App.tsx # Main application component
βββ App.css # App styling
βββ index.css # Global styles
βββ main.tsx # Entry point
make install # Install dependencies
make dev # Start development server (port 3000)
make build # Build for production
make preview # Preview production build
make clean # Clean build artifacts
make info # Show project info- Install dependencies:
npm install- Start the development server:
npm run devThe application will open at http://localhost:3000
npm run build
npm run previewmake docker-build # Build Docker image
make docker-run # Run production container on port 3000
make docker-stop # Stop and remove container
make docker-clean # Remove Docker image
make docker-dev # Run development container with hot reloadProduction Build:
docker build -t high-command-ui:latest .
docker run -d -p 3000:3000 -e API_URL=http://localhost:3001/api high-command-ui:latestDevelopment with Hot Reload:
docker build -t high-command-ui:dev -f Dockerfile.dev .
docker run -it -v $(pwd):/app -p 3000:3000 -e NODE_ENV=development high-command-ui:dev npm run devProduction Stack:
docker-compose up -dDevelopment Stack:
docker-compose -f docker-compose.dev.yml up- Dockerfile - Multi-stage production build using Alpine Linux
- Dockerfile.dev - Development environment with hot module replacement
- docker-compose.yml - Production compose stack with High Command API
- .dockerignore - Exclude unnecessary files from Docker builds
The application uses environment variables for configuration. Create a .env file in the project root with your settings:
cp .env.example .envVITE_API_URL- High Command API server base URL (default:http://localhost:5000)VITE_MCP_URL- MCP server endpoint (default:http://localhost:8000)
Example .env file:
VITE_API_URL=http://localhost:5000
VITE_MCP_URL=http://localhost:8000For Docker deployments, you can pass environment variables:
docker run -e VITE_API_URL=http://api-server:5000 -p 3000:3000 high-command-ui:latestThe UI communicates with the High Command MCP Server via REST endpoints:
POST /api/command- Execute a strategic commandGET /api/war-status- Fetch current war statusGET /api/campaign- Get campaign informationGET /api/planets- List all planetsGET /api/factions- Get faction dataGET /api/biomes- Get biome informationGET /api/statistics- Get game statisticsGET /api/planets/:index- Get specific planet status
High Command UI includes comprehensive unit and E2E test coverage.
Unit tests are powered by Vitest with React Testing Library for component testing.
Run unit tests:
npm run test # Run all unit tests
npm run test:ui # Open Vitest UI dashboard
npm run test:coverage # Generate coverage reportTest files:
src/test/api.test.ts- High Command API service testssrc/test/claude.test.ts- Claude AI service testssrc/test/ChatInterface.test.tsx- Chat component testssrc/test/DataDisplay.test.tsx- Data display component tests
Test coverage includes:
- β API service methods and error handling
- β Claude service integration and tool management
- β Component rendering and user interactions
- β Message submission and keyboard handling
- β Loading states and error boundaries
- β Data formatting and display
End-to-end tests are powered by Playwright for full browser automation testing.
Run E2E tests:
npm run test:e2e # Run all E2E tests
npx playwright test --ui # Interactive test mode
npx playwright show-report # View HTML test reportTest files:
e2e/chat.spec.ts- Chat interface integration tests
E2E test coverage includes:
- β Welcome message display on load
- β Message sending and response display
- β Quick action button execution
- β Tab navigation (Console, Galactic, News, etc.)
- β Loading state display
- β Keyboard input and Enter key submission
- β Error handling and API unavailability
- β Markdown rendering in responses
- β Multiple sequential messages
- β Rapid message submission handling
- Vitest Config:
vitest.config.ts- Unit test runner configuration - Playwright Config:
playwright.config.ts- E2E test runner configuration - Test Setup:
src/test/setup.ts- Global test setup, mocks, and fixtures
# Run all tests
npm run test && npm run test:e2e
# Generate coverage report
npm run test:coverageTests are configured to run on Chromium, Firefox, and WebKit browsers via Playwright.
- React 18 - UI framework
- TypeScript - Type-safe development
- Vite - Fast build tool and dev server
- CSS3 - Modern styling with animations
- Vitest - Unit test framework
- Playwright - E2E test automation
- React Testing Library - Component testing utilities
High Command UI integrates Claude Haiku 4.5 for advanced natural language processing and tactical decision support. Claude analyzes user queries and leverages MCP (Model Context Protocol) tools to:
- Query Intelligence - Understand complex strategic queries and commands
- Context Awareness - Maintain conversation history for multi-turn interactions
- Tool Integration - Automatically select and execute appropriate MCP tools:
get_war_status- Retrieve current campaign statusget_planets- Query planetary dataget_campaign_info- Fetch campaign detailsget_factions- Get faction informationget_biomes- Retrieve biome dataget_statistics- Obtain game statistics
Configuration:
- Set
VITE_CLAUDE_API_KEYenvironment variable with your Anthropic API key - Claude is automatically enabled when the API key is present
- Falls back to keyword matching if no API key is configured
System Prompt Features:
- β¨ Formatted responses using Markdown (no table pipes)
- π Clear data presentation with headers and bullet points
- π― Tactical decision support for Hell Divers 2 command
- π Optimized for fast inference with Haiku model
Licensed under the Apache License, Version 2.0. See LICENSE for the full text.
Copyright 2026 DataKnifeAI