ODA Canvas - PDB Management MCP Web Interface¶
A modern TypeScript/React web application for managing Kubernetes Pod Disruption Budgets (PDBs) through the MCP (Model Context Protocol) interface.
Features¶
AI Chat Interface: Interact with AI assistants using natural language to manage PDBs
Tool Explorer: Discover and execute MCP tools for PDB management
Policy Manager: Create and manage availability policies with intelligent recommendations
Cluster Analysis: Analyze cluster PDB coverage with interactive dashboards
Multi-AI Provider Support: Works with Claude, OpenAI, Azure OpenAI, and Gemini
Real-time Updates: WebSocket support for live data updates
Responsive Design: Mobile-friendly Material-UI interface
Dark/Light Theme: Toggle between themes with ODA Canvas branding
Tech Stack¶
Frontend: React 18, TypeScript, Material-UI
State Management: Zustand
Data Fetching: React Query (TanStack Query)
Charts: Recharts, MUI X Charts
Build Tool: Vite
Styling: Material-UI with custom ODA Canvas theme
Getting Started¶
Prerequisites¶
Node.js 18+
npm or yarn
Access to MCP server (running on port 8090 by default)
Installation¶
Install dependencies:
npm install
Start the development server:
npm run dev
Open your browser to
http://localhost:3000
Available Scripts¶
npm run dev- Start development servernpm run build- Build for productionnpm run preview- Preview production buildnpm run lint- Run ESLintnpm run type-check- Run TypeScript type checking
Configuration¶
AI Provider Setup¶
The application supports multiple AI providers. Configure them in the AI settings:
Claude (Anthropic)
Model: claude-3-sonnet-20240229 (recommended)
API Key: Optional (can use server-side configuration)
OpenAI
Model: gpt-4-turbo-preview
API Key: Required
Azure OpenAI
Model: gpt-4
Endpoint: Your Azure OpenAI endpoint
API Key: Required
Google Gemini
Model: gemini-pro
API Key: Required
MCP Server Connection¶
The web application connects to the MCP server at /api/mcp (proxied to http://localhost:8090 by default).
Update the Vite configuration in vite.config.ts if your MCP server runs on a different port:
server: {
proxy: {
'/api': {
target: 'http://localhost:YOUR_PORT',
changeOrigin: true,
},
},
},
Project Structure¶
src/
âââ api/ # API clients (MCP, AI)
âââ components/ # React components
â âââ ChatInterface.tsx
â âââ ToolExplorer.tsx
â âââ PolicyManager.tsx
â âââ ClusterAnalysis.tsx
âââ store/ # Zustand state management
âââ types/ # TypeScript type definitions
âââ utils/ # Utility functions
âââ theme.ts # Material-UI theme configuration
âââ App.tsx # Main application component
âââ main.tsx # Application entry point
Features in Detail¶
AI Chat Interface¶
Natural language interaction with AI assistants
Tool execution through MCP protocol
Support for multiple AI providers
Real-time streaming responses
Tool call visualization with parameters and results
Tool Explorer¶
Discover available MCP tools
Interactive parameter forms with validation
Execution history with detailed results
Export execution data for analysis
Policy Manager¶
Step-by-step policy creation wizard
Intelligent recommendations based on cluster analysis
Policy validation and conflict detection
Support for different enforcement modes (strict, advisory, flexible)
Cluster Analysis¶
Real-time cluster metrics dashboard
Namespace-level PDB coverage analysis
Risk assessment with visual indicators
Interactive charts and data tables
Export functionality for reports
API Integration¶
The application integrates with:
MCP Server: For tool execution and cluster management
AI Providers: For natural language processing and assistance
WebSocket: For real-time updates (when available)
Development¶
Code Style¶
The project uses ESLint and TypeScript for code quality:
npm run lint # Check for linting issues
npm run type-check # Verify TypeScript types
Adding New Components¶
Create component in
src/components/Add necessary types in
src/types/Update routing in
App.tsxif neededAdd to navigation menu if applicable
State Management¶
The application uses Zustand for state management:
useAppStore: Global app state (theme, navigation, etc.)useChatStore: Chat messages and AI interaction stateuseToolStore: MCP tool state and execution historyusePolicyFormStore: Policy form stateuseNotificationStore: Toast notifications
Contributing¶
Follow the existing code style and conventions
Add TypeScript types for all new interfaces
Use Material-UI components consistently
Test with multiple AI providers
Ensure responsive design works on mobile devices
License¶
This project is part of the ODA Canvas ecosystem and follows the same licensing terms.
Support¶
For issues and questions related to the PDB Management MCP Web Interface, please refer to the main project documentation or create an issue in the repository.