This repository provides the necessary Terraform configuration and container deployment artifacts to deploy an AI-powered Cloud Operations Assistant on Oracle Cloud Infrastructure (OCI). The solution combines OCI Generative AI Agents, Model Context Protocol (MCP) tooling, OCI Logging, Streaming, and Retrieval-Augmented Generation (RAG) capabilities to create an intelligent operational assistant for cloud infrastructure management and troubleshooting.
The solution deploys:
- OCI Generative AI Agent
- Knowledge Base with RAG integration
- MCP Server for OCI operational tooling
- Application Server UI
- OCI Logging and Streaming resources
- Test compute infrastructure
- OCI Container Registry repositories
The repository is structured as a Terraform-based deployment project combined with containerized application services.
infra-stack/:kb_file: Sample process document for handling high cpu usage alerts.modules: Reusable Terraform modules.CloudOps_Infra_RMS.zip: Complete Resource Manager stack to deploy solution infrastructure components.main.tf: Main Terraform file that sets up the infrastructure components.output.tf: Output Terraform file to record output variables for other RMS stack.schema.yaml: OCI Resource Manager schema for guided deployment.variable.tf: Configure the OCI variables for the infrastructure components.
container_images/:MCP_Server/:app.py: Application file for the MCP server.Dockerfile: Main docker file to create the application container image:README.md: Sample readme file for isolated instance deployment.requirements.txt: Requirements file for python packages needed for the deployment.
Agent and UI/:app.py: Application file for the frontend server.Dockerfile: Main docker file to create the application container image:README.md: Sample readme file for isolated instance deployment.requirements.txt: Requirements file for python packages needed for the deployment.
README.md: Instructions file to create and store the container images in OCIR created in last deployment step.
container-instances-stack/:modules: Reusable Terraform modules.Container_Instance_RMS.zip: Complete Resource Manager stack to deploy MCP and frontend application container instances.main.tf: Main Terraform file that sets up the container instances.schema.yaml: OCI Resource Manager schema for guided deployment.variable.tf: Configure the OCI variables for the infrastructure components.version.tf: Terraform file that controls the TF provider version for OCI.
The solution works as follows:
- A user interacts with the Application Server UI.
- Requests are sent to the OCI Generative AI Agent.
- The agent determines whether operational tooling is required.
- If needed, the agent invokes MCP tools exposed through the MCP Server.
- The MCP Server interacts with OCI services using OCI SDKs and APIs.
- Results are returned back to the AI Agent.
- The AI Agent generates a contextual response for the user.
The solution is deployed in three steps.
- Deploy the Infrastructure Stack
- Build and Push the MCP Server and Application container images.
- Deploy the Container Instance Stack
Note: The following steps deploy the base OCI infrastructure, AI Agent resources, logging pipeline, and container registry repositories required for the solution.
- Clone the repository from GitHub.
- Use Oracle Resource Manager to create and apply the stack.
- using the hamburger menu, go to Oracle Resource Manager
- choose Stacks
- click Create stack
- select My configuration
- in the configuration section select zip
- upload the cloudops-infra-rms.zip from the repository
- provide a meaningful stack name
- click Next
- choose the target compartment
- provide the required variables:
- VCN and subnet information
- SSH public key
- compartment OCIDs
- region configuration
- click Next
- select Run apply
- click Create
- Wait for the stack deployment to complete successfully.
- After deployment, collect the outputs from the stack:
- MCP OCIR repository path
- Application OCIR repository path
- Agent Endpoint
- Stream OCIDs
The solution uses two container images:
- MCP Server image
- Application Server image
- Docker installed
- Access to OCI Container Registry (OCIR)
- Auth token for OCI registry login
-
Login to OCIR
docker login <region-key>.ocir.ioExample:
docker login iad.ocir.ioUse:
- OCI Username
- OCI auth token
-
Build and Push MCP Server Image
- Navigate to the MCP Server directory:
cd mcp-server - Build and tag the mcp server image
docker build . -t <mcp-repository-path>:latest - Push the mcp server image
docker push <mcp-repository-path>:latest
- Navigate to the MCP Server directory:
-
Build and Push Application Server Image
- Navigate to the Application Server directory:
cd agent-and-ui - Build and tag the mcp server image
docker build . -t 'application-server-repository-path':latest - Push the application server image
docker push 'application-server-repository-path':latest
- Navigate to the Application Server directory:
Once the container images are available in OCIR, deploy the runtime components.
You will need:
- Agent Endpoint from Part 1
- OCIR image paths from Part 2
- OCI subnet configuration
- MCP Server
- Deploy in:
- Private subnet
- Deploy in:
- Application Server
- Deploy in:
- Public subnet
- Expose:
- TCP Port 8080
- Deploy in:
- Use Oracle Resource Manager to create and apply the stack.
- using the hamburger menu, go to Oracle Resource Manager
- choose Stacks
- click Create stack
- select My configuration
- in the configuration section select zip
- upload the container-instance-rms.zip from the repository
- provide a meaningful stack name
- click Next
- choose the target compartment
- provide the required variables:
- Display Name Prefix
- Availability Domain
- MCP Container Image URL from last step
- Application Container Image URL from last step
- RAG Agent Endpoint
- Container Configuration
- Shape
- OCPU
- Memory
- VCN and subnet information
- Regional GenAI Endpoint
- GenAI Model ID
- click Next
- select Run apply
- click Create
- Wait for the stack deployment to complete successfully.
- After deployment, validate the container information
- View Application container instance IP address
- Open a new browser window to the following address
- http://application server public IP:8080
Once the deployment is complete, the AI-powered DevOps Agent can be used for:
- OCI operational troubleshooting
- Infrastructure visibility
- Monitoring and alarm inspection
- Log analysis
- AI-assisted DevOps workflows
- Natural language operational automation
- Navigate to Oracle Resource Manager
- Select the deployed stack
- Click Destroy