Skip to content

Herman940306/Coding_MCP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Enterprise Multi-Model AI Platform

Version: 1.0.0
Status: Production Ready
Project Lead: Herman Swanepoel
License: Proprietary


Overview

The Enterprise Multi-Model AI Platform is a production-ready, full-stack artificial intelligence system designed to provide secure, scalable, and intelligent conversational AI capabilities for enterprise environments.

Key Features:

  • 🤖 Multi-model AI support (12+ models)
  • 🔒 Enterprise-grade security (86.7% security score)
  • ⚡ High performance (27ms average response time)
  • 🌐 Real-time WebSocket updates
  • 🛡️ AI safety features (multi-source verification)
  • 💰 Token optimization (up to 100% savings)
  • 📊 Comprehensive monitoring (Prometheus/Grafana)

Quick Start

Prerequisites

  • Docker 20.10+
  • Docker Compose 2.0+
  • 8GB RAM minimum
  • 20GB disk space

Installation

# Clone repository
git clone https://github.com/Herman940306/Coding_MCP.git
cd Coding_MCP

# Start services
docker-compose up -d

# Verify deployment
curl http://localhost:8001/health

Access

Default Credentials

  • Username: admin
  • Password: admin123

⚠️ Change default credentials immediately in production


System Architecture

┌─────────────────────────────────────────────────────────┐
│                     Nginx (Reverse Proxy)                │
│                    SSL/TLS, Load Balancing               │
└────────────────┬────────────────────────┬────────────────┘
                 │                        │
        ┌────────▼────────┐      ┌───────▼────────┐
        │    Frontend     │      │   Backend API   │
        │  React + TS     │      │    FastAPI      │
        └─────────────────┘      └────────┬────────┘
                                          │
                    ┌─────────────────────┼─────────────────────┐
                    │                     │                     │
           ┌────────▼────────┐   ┌───────▼────────┐   ┌───────▼────────┐
           │   PostgreSQL    │   │     Redis      │   │     Ollama     │
           │    Database     │   │     Cache      │   │   AI Models    │
           └─────────────────┘   └────────────────┘   └────────────────┘

Features

Core Capabilities

User Management:

  • Secure authentication (JWT)
  • Role-based access control
  • Password strength validation
  • Session management

Conversational AI:

  • Multi-turn conversations
  • Real-time message streaming
  • Context-aware responses
  • File attachment support
  • 12+ AI models available

Model Management:

  • Intelligent model routing
  • Health monitoring
  • Performance analytics
  • Automatic model selection
  • Resource optimization

Real-Time Features:

  • WebSocket communication
  • Live model health updates
  • Performance metrics streaming
  • Connection status monitoring
  • Automatic reconnection

Advanced Features

AI Safety:

  • Multi-source verification (GitHub, Stack Overflow, Documentation)
  • Hallucination detection
  • Confidence scoring
  • Evidence collection

Optimization:

  • Token usage optimization (up to 100% savings)
  • Semantic caching (50% hit rate)
  • Context chunking and ranking
  • Cost estimation

Security:

  • 20+ sensitive data pattern detection
  • Automatic redaction
  • XSS protection
  • SQL injection protection
  • Rate limiting (100/min, 1000/hour)

Technology Stack

Backend:

  • FastAPI (Python 3.11)
  • PostgreSQL 15
  • Redis 7
  • Ollama AI Models
  • Prometheus + Grafana

Frontend:

  • React 18 + TypeScript
  • Material-UI
  • React Query
  • WebSocket Client
  • Vite

Infrastructure:

  • Docker + Docker Compose
  • Nginx
  • SSL/TLS (Let's Encrypt ready)

Performance

  • Response Time: 27ms average
  • Throughput: 145 requests/second
  • Concurrent Users: 50+ tested
  • Uptime: 100% (staging)
  • Cache Hit Rate: 50%

Security

  • Security Score: 86.7% (13/15 tests passing)
  • Authentication: JWT with bcrypt
  • Encryption: TLS 1.2/1.3
  • Protection: XSS, SQL injection, CSRF
  • Rate Limiting: IP-based throttling
  • Data Protection: 20+ sensitive patterns detected

Documentation

Quick Links

Documentation Structure

docs/
├── backend/          Backend-specific documentation
├── frontend/         Frontend-specific documentation
├── general/          Project planning and tracking
├── reports/          Phase completion reports
└── deployment/       Deployment guides and scripts

Testing

Run Tests

# Integration tests
python scripts/integration_test.py

# Security audit
python scripts/security_audit.py

# Load testing
python scripts/load_test.py

# Hallucination guard tests
python scripts/test_hallucination_guard.py

Test Results

  • Integration: 80% pass rate (8/10 tests)
  • Security: 86.7% score (13/15 tests)
  • Load: 145 req/sec capacity
  • AI Safety: 100% tests passing

Deployment

Staging Deployment

chmod +x docs/deployment/deploy-staging.sh
./docs/deployment/deploy-staging.sh

Production Deployment

# Configure environment
cp .env.production.example .env.production
# Edit .env.production with secure values

# Deploy
chmod +x docs/deployment/deploy-production.sh
./docs/deployment/deploy-production.sh

See Deployment Guide for detailed instructions.


Monitoring

Grafana Dashboards

  • System Overview
  • API Performance
  • Model Usage
  • Error Tracking

Access: http://localhost:3001 (admin/admin)

Prometheus Metrics

  • Request/response times
  • Error rates
  • Resource utilization
  • Custom business metrics

Access: http://localhost:9090


Development

Setup Development Environment

# Clone repository
git clone https://github.com/Herman940306/Coding_MCP.git
cd Coding_MCP

# Start development environment
docker-compose up -d

# View logs
docker-compose logs -f

Project Structure

.
├── backend/              Backend API (FastAPI)
│   ├── main.py          Main application
│   ├── models.py        Database models
│   ├── auth.py          Authentication
│   ├── websocket_manager.py  WebSocket handling
│   ├── hallucination_guard.py  AI safety
│   └── embedding_optimizer.py  Token optimization
├── frontend/             Frontend (React + TypeScript)
│   ├── src/
│   │   ├── pages/       Application pages
│   │   ├── components/  Reusable components
│   │   ├── services/    API and WebSocket services
│   │   └── hooks/       Custom React hooks
├── scripts/              Utility scripts
│   ├── integration_test.py
│   ├── security_audit.py
│   ├── load_test.py
│   └── test_hallucination_guard.py
├── docs/                 Documentation
│   ├── backend/         Backend docs
│   ├── frontend/        Frontend docs
│   ├── general/         Project docs
│   ├── reports/         Phase reports
│   └── deployment/      Deployment guides
├── docker-compose.yml    Development setup
├── docker-compose.prod.yml  Production setup
└── README.md            This file

API Endpoints

Authentication

  • POST /api/auth/register - User registration
  • POST /api/auth/login - User login
  • POST /api/auth/logout - User logout

Conversations

  • GET /api/conversations - List conversations
  • POST /api/conversations - Create conversation
  • GET /api/conversations/{id} - Get conversation
  • PUT /api/conversations/{id} - Update conversation
  • DELETE /api/conversations/{id} - Delete conversation

Messages

  • POST /api/messages - Send message
  • GET /api/messages/{conversation_id} - Get messages
  • POST /api/messages/stream - Stream message response

Models

  • GET /api/models - List available models
  • GET /api/models/health - Model health status
  • GET /api/models/performance - Performance metrics
  • POST /api/models/recommend - Get model recommendation

WebSocket

  • WS /ws/{user_id} - WebSocket connection
  • GET /api/websocket/stats - Connection statistics

See API Documentation for complete reference.


Configuration

Environment Variables

# Database
POSTGRES_USER=mcp_user
POSTGRES_PASSWORD=your_secure_password
POSTGRES_DB=mcp_database

# Redis
REDIS_PASSWORD=your_redis_password

# Backend
SECRET_KEY=your_secret_key_min_32_chars
JWT_ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_MINUTES=30

# CORS
CORS_ORIGINS=http://localhost:3000,https://your-domain.com

See .env.production.example for complete configuration.


Troubleshooting

Common Issues

Backend won't start:

docker-compose logs backend
docker-compose restart backend

Database connection error:

docker-compose restart postgres
docker exec mcp-postgres psql -U mcp_user -d mcp_database -c "SELECT 1"

Frontend not loading:

docker-compose logs frontend
docker-compose restart frontend

See Deployment Guide for detailed troubleshooting.


Contributing

This is a proprietary project. For internal development:

  1. Create feature branch
  2. Make changes
  3. Run tests
  4. Submit for review
  5. Merge to main

Support

Documentation: See /docs folder
API Docs: http://localhost:8001/api/docs
Issues: Internal tracking system


Roadmap

  • Phase 1: Production MVP (Complete)
  • Phase 2: Real-Time Features (Complete)
  • Phase 3: AI Safety Features (Complete)
  • Phase 4: Advanced Features (Planned)
  • Phase 5: Production Polish (Planned)

Current Progress: 60% (3 of 5 phases complete)

See Enterprise Project Report for detailed roadmap.


License

Proprietary - All Rights Reserved

Copyright © 2025 Herman Swanepoel


Project Information

Project Lead: Herman Swanepoel
Version: 1.0.0
Status: Production Ready (95/100)
Last Updated: November 20, 2025

For detailed information, see ENTERPRISE_PROJECT_REPORT.md

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors