NitheshKG/pycloudmesh_mcp_server
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
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- MCP Server: http://localhost:8001
- Database: localhost:5432
- Redis: localhost:6379
π± Usage
1. User Registration
- Visit http://localhost:3000
- Click "Sign Up"
- Enter your email, password, and company details
- Verify your account
2. Configure Cloud Providers
- Go to Settings β Cloud Credentials
- Select cloud providers (AWS, Azure, GCP)
- 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
- Go to the Chat interface
- 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 registrationPOST /api/v1/auth/login
- User loginGET /api/v1/auth/me
- Get current userPOST /api/v1/auth/logout
- User logout
Cloud Credentials
POST /api/v1/credentials/aws
- Add AWS credentialsPOST /api/v1/credentials/azure
- Add Azure credentialsPOST /api/v1/credentials/gcp
- Add GCP credentialsGET /api/v1/credentials/
- List credentialsDELETE /api/v1/credentials/{id}
- Delete credentials
Chat
POST /api/v1/chat/query
- Send chat messageGET /api/v1/chat/history
- Get chat historyDELETE /api/v1/chat/history
- Clear chat historyGET /api/v1/chat/suggestions
- Get chat suggestions
MCP Server
POST /mcp/query
- MCP protocol queriesPOST /finops/query
- Direct FinOps queriesGET /finops/providers
- Supported providersGET /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
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- 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