A powerful, enterprise-grade chat application that integrates with Slide backup and disaster recovery systems, powered by Claude AI and built with Flask. Features real-time streaming responses, comprehensive artifact management, advanced session handling, and full MCP integration.
- Claude AI Integration: Powered by Claude Sonnet 4 with streaming responses
- Context-Aware: Maintains conversation history across sessions
- Tool Integration: Seamlessly integrates with Slide MCP tools for real-time data
- Real-time Device Monitoring: Check status of Slide backup devices
- Backup Management: View schedules, status, and health metrics
- Server Virtualization: Manage virtualization and recovery operations
- Comprehensive Reporting: Generate detailed backup and recovery reports
- Hierarchical Data: Navigate Clients β Devices β Agents β Backups β Snapshots
- Multi-format Support: HTML, Markdown, Code, JSON, XML artifacts
- Real-time Rendering: Live preview as artifacts are generated
- Persistent Storage: Automatic saving with unique permalinks
- File Management: Organized artifact directory with metadata
- Language Support: Syntax highlighting for 15+ programming languages
- Stateless MCP Architecture: Secure, isolated per-request tool execution
- API Key Management: Separate Claude and Slide API key handling
- Session Persistence: Maintain chat history across browser sessions
- Environment Security: All sensitive data via environment variables
- Multi-level Logging: API interactions, session events, error tracking
- Debug Endpoints: Real-time log access and session debugging
- File-based Persistence: Organized daily log files with rotation
- Comprehensive Monitoring: Health checks and system status
- Python 3.8 or higher
- Anthropic Claude API key
- Slide API key (for backup system integration)
- Git
-
Clone the repository:
git clone https://github.com/amcchord/slideChat.git cd slideChat -
Install dependencies:
pip install -r requirements.txt
-
Set up environment variables:
cp config.example config.env
Edit
config.envand add your actual API keys:CLAUDE_API_KEY=sk-ant-your_anthropic_api_key_here SECRET_KEY=your_random_secret_key_here FLASK_ENV=production -
Load environment variables:
# Option 1: Source the config file source config.env # Option 2: Create a .env file (automatically loaded) cp config.env .env
-
Run the application:
python app.py
-
Access the application: Navigate to
http://localhost:5000
| Variable | Description | Required | Default |
|---|---|---|---|
CLAUDE_API_KEY |
Your Anthropic Claude API key | β Yes | None |
SECRET_KEY |
Flask secret key for sessions | β Yes | dev-secret-key-change-in-production |
FLASK_ENV |
Flask environment mode | β No | development |
- Sign up at Anthropic Console
- Navigate to API Keys section
- Create a new API key
- Copy the key to your configuration
- Access your Slide management console
- Navigate to API settings
- Generate or copy your API key (format:
tk_...) - Use this key in the chat interface for backup operations
The application uses a stateless MCP server approach for enhanced security:
- Each request spawns a fresh MCP server process
- API keys are passed per-request for isolation
- No persistent server state or sessions
- Better security and resource management
Through MCP integration, you can:
- Device Management: List, monitor, and control backup devices
- Backup Operations: View backup schedules, status, and history
- Agent Monitoring: Track backup agents and their health
- Snapshot Management: Access and manage backup snapshots
- Virtualization Control: Manage server virtualization and recovery
- Reporting: Generate comprehensive backup and recovery reports
- Log Analysis: Review system logs and diagnostics
In the chat interface:
- Click the "API Key" button to configure your Slide API key
- Once configured, ask about your backup infrastructure:
- "Show me my backup devices"
- "What's the status of my recent backups?"
- "Generate a backup report for this week"
- "List all my backup agents"
slideChat/
βββ app.py # Main Flask application (1,177 lines)
βββ mcp_manager.py # MCP server management (233 lines)
βββ wsgi.py # WSGI entry point
βββ templates/
β βββ index.html # Modern chat interface (150 lines)
βββ static/
β βββ css/
β β βββ style.css # Application styles
β β βββ charter.css # Typography
β βββ js/
β β βββ app.js # Frontend JavaScript client
β βββ fonts/ # Web fonts
β βββ images/ # UI assets
βββ artifacts/ # Generated artifact storage
βββ logs/ # Application logs
βββ mcp/ # MCP server binary
βββ config.example # Environment template
βββ requirements.txt # Dependencies
βββ DEPLOYMENT.md # Production deployment guide
βββ LOGGING_README.md # Logging system documentation
βββ TODO.md # Development roadmap
| Endpoint | Method | Description | Parameters |
|---|---|---|---|
/ |
GET | Main chat interface | None |
/chat |
POST | Send chat messages (SSE streaming) | message, session_id, slide_api_key |
/health |
GET | Application health check | None |
/version |
GET | Application version info | None |
| Endpoint | Method | Description | Parameters |
|---|---|---|---|
/artifacts/<filename> |
GET | Serve saved artifacts | filename |
| Endpoint | Method | Description | Parameters |
|---|---|---|---|
/mcp/validate |
POST | Validate Slide API key | api_key |
/mcp/test |
POST | Test specific MCP tool | api_key, tool_name, arguments |
/mcp/status |
GET | MCP server availability | None |
| Endpoint | Method | Description | Parameters |
|---|---|---|---|
/logs/status |
GET | Logging system status | None |
/logs/recent/<log_type> |
GET | Recent log entries | log_type (sessions/api), lines |
/logs/debug/<session_id> |
GET | Session-specific debug logs | session_id |
// Text content
data: {"type": "content", "content": "Chat message text"}
// Artifact updates
data: {"type": "artifacts_update", "content": [{"id": "...", "type": "markdown", ...}]}
// Tool usage
data: {"type": "tool_use", "content": {"tool_name": "...", "result": {...}}}
// Completion
data: {"type": "complete"}
// Errors
data: {"type": "error", "content": "Error message"}- Clean Design: Professional dark theme with excellent readability
- Responsive Layout: Works on desktop, tablet, and mobile devices
- Real-time Indicators: Status indicators for connection and processing
- Typing Animation: Live streaming response rendering
- Syntax Highlighting: Code highlighting for 15+ languages
- Live Preview: Real-time artifact rendering as they're generated
- Download Links: Persistent links to generated artifacts
- Multi-format Support: HTML, Markdown, Code, JSON, XML, and more
- Visual Indicators: Clear status for both Claude and Slide API keys
- Secure Storage: Session-based storage (not persisted to disk)
- Easy Configuration: One-click API key setup modal
- Environment Variables: All sensitive data via environment variables
- No API Key Persistence: Keys stored only in browser session
- Stateless Architecture: No server-side session persistence
- Input Validation: Comprehensive input sanitization
- Error Handling: Graceful error handling without information leakage
See DEPLOYMENT.md for comprehensive production setup including:
- Docker Configuration: Multi-stage Docker builds
- Reverse Proxy Setup: Nginx configuration examples
- SSL/HTTPS Setup: Security best practices
- Environment Management: Production environment configuration
- Monitoring: Health checks and log monitoring
The application includes a comprehensive logging system:
- API Interactions: Detailed API request/response logging
- Session Events: User session tracking and debugging
- Error Tracking: Comprehensive error logging with stack traces
- Debug Files: Per-session debug file generation
For detailed logging information, see LOGGING_README.md.
# Run in development mode
FLASK_ENV=development python app.py
# Access debug logs
curl http://localhost:5000/logs/status
curl http://localhost:5000/logs/recent/sessions- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow PEP 8 style guidelines
- Add comprehensive docstrings
- Include error handling
- Update tests for new features
- Update documentation
API Key Errors
- Ensure your Claude API key starts with
sk-ant- - Ensure your Slide API key starts with
tk_ - Check environment variable loading
MCP Tool Issues
- Verify the
mcp/slide-mcp-serverbinary exists and is executable - Check Slide API key validity with
/mcp/validate - Review MCP server logs in the logs directory
Artifact Not Saving
- Check
artifacts/directory permissions - Review application logs for save errors
- Ensure adequate disk space
For troubleshooting, use these endpoints:
GET /health- Application healthGET /logs/status- Log file statusGET /mcp/status- MCP server statusGET /logs/recent/api- Recent API logs
This project is licensed under the MIT License - see the LICENSE file for details.
- Anthropic Claude - Advanced AI capabilities with Claude Sonnet 4
- Flask - Robust web framework
- Slide - Backup and disaster recovery solutions
- MCP Protocol - Model Context Protocol for tool integration
Built with β€οΈ for enterprise backup and disaster recovery management
For questions, issues, or feature requests, please visit our GitHub Issues page.