pycloudmesh_mcp_server

NitheshKG/pycloudmesh_mcp_server

3.1

If you are the rightful owner of pycloudmesh_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.

The PyCloudMesh FinOps Web Application is a modern solution for managing multicloud financial operations through a ChatGPT-like interface, leveraging the PyCloudMesh library via an MCP server backend.

🚀 PyCloudMesh FinOps Web Application

A modern web application that provides a ChatGPT-like interface for multicloud FinOps management using your PyCloudMesh library via an MCP server backend.

✨ Features

  • 🔐 User Authentication: Secure signup, login, and JWT-based authentication
  • ☁️ Multi-Cloud Support: AWS, Azure, and GCP credential management
  • 💬 Chat Interface: ChatGPT-like experience for FinOps queries
  • 📊 Cost Analysis: Real-time cloud cost insights across providers
  • 💰 Budget Management: Create and track cloud budgets
  • ⚡ Optimization: Get cost optimization recommendations
  • 📋 Governance: Generate compliance and governance reports
  • 🔒 Security: Encrypted credential storage and secure API endpoints

🏗️ Architecture

┌─────────────────┐    ┌──────────────────┐    ┌─────────────────┐    ┌─────────────────┐
│   React Frontend│    │   FastAPI Backend│    │   MCP Server    │    │  PyCloudMesh   │
│   (TypeScript)  │◄──►│   (Python)       │◄──►│   (Backend)     │◄──►│   (Your Lib)   │
│                 │    │                  │    │                 │    │                 │
└─────────────────┘    └──────────────────┘    └─────────────────┘    └─────────────────┘
                              │
                              ▼
                       ┌──────────────────┐
                       │   PostgreSQL     │
                       │   Database       │
                       └──────────────────┘

🛠️ Tech Stack

Backend

  • FastAPI: Modern Python web framework
  • PostgreSQL: Primary database
  • Redis: Caching and session management
  • SQLAlchemy: ORM for database operations
  • JWT: Authentication and authorization

MCP Server

  • Python: Core language
  • FastAPI: HTTP server
  • PyCloudMesh: Your FinOps library integration

Frontend

  • React: UI framework
  • TypeScript: Type safety
  • Tailwind CSS: Styling
  • Axios: HTTP client

Infrastructure

  • Docker: Containerization
  • Docker Compose: Local development
  • Nginx: Reverse proxy (production)

🚀 Quick Start

Prerequisites

  • Docker and Docker Compose
  • Python 3.8+ (for local development)
  • Node.js 16+ (for frontend development)
  • Your PyCloudMesh library

1. Clone and Setup

# Clone the repository
git clone <your-repo-url>
cd pycloudmesh-mcp-server

# Copy your PyCloudMesh library to the project
cp -r /path/to/your/pycloudmesh ./pycloudmesh

2. Environment Configuration

# Create environment file
cp .env.example .env

# Edit environment variables
nano .env

Key environment variables:

# Database
DATABASE_URL=postgresql://finops_user:finops_password@localhost:5432/finops

# JWT
SECRET_KEY=your-secret-key-change-in-production

# MCP Server
MCP_SERVER_URL=http://localhost:8001

# Redis
REDIS_URL=redis://localhost:6379

3. Start the Application

# Start all services
docker-compose up -d

# View logs
docker-compose logs -f

# Check service status
docker-compose ps

4. Access the Application

📱 Usage

1. User Registration

  1. Visit http://localhost:3000
  2. Click "Sign Up"
  3. Enter your email, password, and company details
  4. Verify your account

2. Configure Cloud Providers

  1. Go to Settings → Cloud Credentials
  2. Select cloud providers (AWS, Azure, GCP)
  3. Enter your credentials:
AWS
  • Account Name
  • Access Key ID
  • Secret Access Key
  • Region
Azure
  • Account Name
  • Subscription ID
  • Tenant ID
  • Client ID
  • Client Secret
GCP
  • Account Name
  • Project ID
  • Service Account Key (JSON file)

3. Start Chatting

  1. Go to the Chat interface
  2. Ask FinOps questions like:
    • "What are my total cloud costs?"
    • "Show cost trends for last 30 days"
    • "What are my biggest cost drivers?"
    • "Find cost optimization opportunities"
    • "Create a budget alert for $1000/month"

🔧 Development

Backend Development

cd backend

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Run development server
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000

MCP Server Development

cd mcp_server

# Install dependencies
pip install -r requirements.txt

# Run development server
python -m server

Frontend Development

cd frontend

# Install dependencies
npm install

# Run development server
npm start

Database Management

# Connect to database
docker exec -it finops-postgres psql -U finops_user -d finops

# Run migrations
docker exec -it finops-backend alembic upgrade head

# Reset database
docker-compose down -v
docker-compose up -d

🧪 Testing

API Testing

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

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

# Test user signup
curl -X POST http://localhost:8000/api/v1/auth/signup \
  -H "Content-Type: application/json" \
  -d '{"email":"test@example.com","password":"password123","full_name":"Test User"}'

Integration Testing

# Run backend tests
cd backend
python -m pytest

# Run MCP server tests
cd mcp_server
python -m pytest

📊 API Endpoints

Authentication

  • POST /api/v1/auth/signup - User registration
  • POST /api/v1/auth/login - User login
  • GET /api/v1/auth/me - Get current user
  • POST /api/v1/auth/logout - User logout

Cloud Credentials

  • POST /api/v1/credentials/aws - Add AWS credentials
  • POST /api/v1/credentials/azure - Add Azure credentials
  • POST /api/v1/credentials/gcp - Add GCP credentials
  • GET /api/v1/credentials/ - List credentials
  • DELETE /api/v1/credentials/{id} - Delete credentials

Chat

  • POST /api/v1/chat/query - Send chat message
  • GET /api/v1/chat/history - Get chat history
  • DELETE /api/v1/chat/history - Clear chat history
  • GET /api/v1/chat/suggestions - Get chat suggestions

MCP Server

  • POST /mcp/query - MCP protocol queries
  • POST /finops/query - Direct FinOps queries
  • GET /finops/providers - Supported providers
  • GET /finops/operations - Supported operations

🚀 Production Deployment

Docker Production

# Build production images
docker-compose -f docker-compose.prod.yml build

# Deploy to production
docker-compose -f docker-compose.prod.yml up -d

Kubernetes Deployment

# Apply Kubernetes manifests
kubectl apply -f deployment/kubernetes/

# Check deployment status
kubectl get pods -n finops

Environment Variables (Production)

# Security
SECRET_KEY=your-production-secret-key
DATABASE_URL=postgresql://user:pass@prod-db:5432/finops

# Scaling
MAX_WORKERS=10
WORKER_TIMEOUT=30

# Monitoring
LOG_LEVEL=INFO
METRICS_ENABLED=true

🔒 Security

Credential Encryption

  • Cloud provider credentials are encrypted at rest
  • JWT tokens for authentication
  • HTTPS enforcement in production
  • Input validation and sanitization

Access Control

  • User isolation
  • Rate limiting
  • API key management (enterprise)
  • Audit logging

📈 Monitoring & Logging

Health Checks

  • Service health endpoints
  • Database connectivity
  • MCP server status
  • PyCloudMesh integration

Logging

  • Structured JSON logging
  • Log aggregation
  • Error tracking
  • Performance metrics

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

📝 License

This project is licensed under the MIT License - see the file for details.

🆘 Support

Common Issues

Database Connection Error

# Check if PostgreSQL is running
docker-compose ps postgres

# Restart database
docker-compose restart postgres

MCP Server Not Responding

# Check MCP server logs
docker-compose logs mcp-server

# Restart MCP server
docker-compose restart mcp-server

Frontend Build Issues

# Clear node modules
cd frontend
rm -rf node_modules package-lock.json
npm install

Getting Help

  • Documentation: Check the /docs folder
  • Issues: Create a GitHub issue
  • Discussions: Use GitHub Discussions
  • Email: support@yourcompany.com

🎯 Roadmap

Phase 2 (Current)

  • ✅ User authentication and management
  • ✅ Cloud provider credential management
  • ✅ Basic chat interface
  • ✅ MCP server integration
  • ✅ PyCloudMesh backend

Phase 3 (Next)

  • 🔄 Advanced analytics and reporting
  • 🔄 Team collaboration features
  • 🔄 Cost forecasting
  • 🔄 Automated optimization
  • 🔄 Enterprise SSO

Phase 4 (Future)

  • 📊 Advanced dashboards
  • 📊 Machine learning insights
  • 📊 Multi-tenant architecture
  • 📊 API marketplace
  • 📊 Mobile applications

**Built with ❤️ using PyCloudMesh