VPS_Docker_MCP_Server

WeirdSecurity/VPS_Docker_MCP_Server

3.1

If you are the rightful owner of VPS_Docker_MCP_Server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

This is a containerized VPS management system with Ollama integration, SQLite, and MongoDB, featuring a chatbot interface for VPS support using the phi3:mini model with GPU acceleration.

VPS Management System - Docker Setup

This is a containerized VPS management system with Ollama integration, SQLite, and MongoDB. Features a chatbot interface for VPS support using phi3:mini model with GPU acceleration.

Prerequisites

  1. Docker Desktop must be installed and running (Windows/Mac) or Docker Engine (Linux)
  2. Ollama must be installed and running on your host machine
  3. An Ollama model (like llama3) must be pulled

Installation and Setup

1. Install Prerequisites

Install Docker
Install Ollama

2. Install and Configure Ollama

Start Ollama
ollama serve

Note: Keep this terminal session open while using the application

Pull Required Models
ollama pull phi3:mini

Note: The system is configured to use phi3:mini by default. You can also use other models like llama3, mistral, or any other available Ollama model

3. Clone and Set Up the Application

If you haven't already, clone or copy the project to your local machine and navigate to the project directory:

cd /path/to/your/VPS-Docker/VPS

4. Build and Run the Application

Build and Start All Services
docker-compose up --build -d

Note: The -d flag runs containers in detached mode (background)

Alternative: Run in Foreground (to see logs)
docker-compose up --build

5. Verify the Application is Running

Check if all containers are running:

docker-compose ps

You should see all services running:

  • vps_backend (port 8000)
  • vps_frontend (port 3000)
  • vps_mcp (port 8001)
  • vps_mongo (port 27017)

Application Ports and Services

ServicePortPurposeURL
Frontend3000Web interface for VPS managementhttp://localhost:3000
Backend8000Main API server and Swagger UIhttp://localhost:8000
API Documentationhttp://localhost:8000/docs
MCP Server8001Database operations and LLM integrationhttp://localhost:8001
MCP Health Checkhttp://localhost:8001/health
MongoDB27017Database for chat transcripts and datalocalhost:27017 (internal only)

Features

  • AI-Powered Chatbot: Interactive support chatbot using Ollama phi3:mini model with GPU acceleration
  • Hybrid Database Search: Intelligent query system that searches FAQ, client data, and VPS plans before using LLM
  • Automatic dummy data insertion: VPS plans, clients, invoices, FAQs, and troubleshooting guides are created on startup
  • Complete frontend interface: Web-based interface for managing VPS services with integrated chat
  • Backend API: RESTful API with full CRUD operations
  • Database support: Both SQLite and MongoDB for different use cases
  • VPS instance management: Create, start, stop, and manage VPS instances

Usage

Accessing the Application

  1. Web Interface: Visit http://localhost:3000 to access the VPS management dashboard
  2. Chatbot: Use the integrated chat interface on the main page for VPS support questions
  3. API Documentation: Visit http://localhost:8000/docs for the interactive API documentation
  4. API Endpoint: Make API calls to http://localhost:8000 for backend services

Default Credentials

  • Admin User: Username: admin, Password: secret (for backend API)
  • Sample Clients: Created automatically with dummy data

Example API Tests

# Test backend health
curl http://localhost:8000/health

# Test MCP server health  
curl http://localhost:8001/health

# Test chatbot query
curl -X POST http://localhost:8000/query \
  -H "Content-Type: application/json" \
  -d '{"query": "What VPS plans do you offer?"}'

Configuration

Environment Variables

The application uses these environment variables:

  • OLLAMA_HOST: Set to host.docker.internal:11434 for Windows/Docker Desktop
  • OLLAMA_MODEL: AI model to use (default: phi3:mini)
  • MONGODB_URL: MongoDB connection string (mongodb://mongo:27017/vps_mcp_db)
  • MCP_SERVER_URL: URL for the MCP server (http://mcp_server:8001 internally)

Ollama Model Configuration

To use a different Ollama model:

  1. Pull the model: ollama pull <model-name>
  2. Update OLLAMA_MODEL in docker-compose.yml
  3. Restart the application: docker-compose down && docker-compose up --build

Current Model: phi3:mini (optimized for speed and GPU acceleration)

Troubleshooting

Common Issues

Ollama Connection Issues
  • Symptom: MCP server logs show Ollama connection errors
  • Solution: Ensure Ollama is running with ollama serve and the correct model is pulled
Docker Connection Issues
  • Symptom: Cannot access services on specified ports
  • Solution:
    • Check if Docker Desktop is running
    • Run docker-compose ps to verify all services are running
    • Check container logs: docker-compose logs <service-name>
Frontend Not Loading
  • Symptom: Blank page or resources not loading on port 3000
  • Solution: Verify all containers are running and the frontend service is healthy

Useful Commands

View Container Logs
# View all service logs
docker-compose logs

# View specific service logs
docker-compose logs backend
docker-compose logs mcp_server
docker-compose logs frontend
Stop the Application
docker-compose down
Stop and Remove Containers, Networks, and Volumes
docker-compose down -v
Rebuild and Restart
docker-compose down
docker-compose up --build -d
Access Container Shell
# Access backend container
docker-compose exec backend sh

# Access frontend container
docker-compose exec frontend sh

# Access MongoDB container
docker-compose exec mongo bash

Docker Images and Volumes

Images Created

  • vps-backend: Main application backend service
  • vps-mcp_server: MCP server for database and LLM operations
  • nginx:alpine: Frontend web server
  • mongo:6.0: MongoDB database

Volumes

  • mongo_data: Persistent storage for MongoDB data

Development

Running Without Docker Compose (Alternative)

# Start MongoDB separately
docker run --name vps-mongo -p 27017:27017 -d mongo:6.0

# Build and run the app
docker build -t vps-app .
docker run -p 8000:8000 -p 8001:8001 --network=host -e OLLAMA_HOST=host.docker.internal:11434 vps-app

Development Mode

If you're developing and want to mount local files:

  1. Modify docker-compose.yml to add volume mounts for hot reloading
  2. Use docker-compose up without -d to see logs in real-time

Reference Links

Stopping the Application

When you're done using the application:

  1. Stop the services: docker-compose down
  2. If you started Ollama separately, stop it with Ctrl+C in the terminal where it's running