Issue
The project was incurring $185/month in Azure cloud costs for infrastructure—including Kubernetes clusters, AI services, and monitoring—that was entirely unnecessary. All execution occurred locally using a stdio-based transport protocol, rendering the cloud deployment redundant. Unused resources included:
- Kubernetes clusters with high-end virtual machines.
- Azure OpenAI embedding services.
- Networking components and private endpoints.
- Comprehensive monitoring tools.
Culprit
The architectural mismatch stemmed from:
- Protocol Limitations: The MCP protocol primarily relied on local stdio transport for process communication, not cloud-native HTTP/SSE endpoints.
- Development Workflow Assumptions: The local server execution (
poetry run python -m src.server) was the primary mode, making cloud deployment obsolete. - Over-Provisioning: Cloud resources were provisioned without validating actual usage needs.
- Cost Accumulation: A total of 38 cloud resources (application and foundation layers) were deployed but unused.
Solution
Infrastructure Teardown
-
Resource Deletion: Executed a complete removal of all Azure resources using infrastructure-as-code tools, eliminating:
- Kubernetes clusters with associated identities and role assignments.
- Azure AI services and embedding models.
- Virtual networks, private endpoints, and networking components.
- Monitoring stacks (log analytics, application insights).
-
Local Configuration Cleanup: Removed redundant cloud-specific configurations, including:
- Kubernetes context entries.
- Environment variables for cloud API keys.
- Cloud deployment scripts and port-forwarding processes.
Cost Optimization
| Resource Type | Before Cost | After Cost | Savings |
|---|---|---|---|
| Kubernetes Cluster | $120/month | $0 | $120 |
| AI Services | $45/month | $0 | $45 |
| Monitoring Stack | $20/month | $0 | $20 |
| Total | $185 | $0 | $185 |
Verification Process
- Resource Validation: Confirmed all cloud resources were successfully removed.
- Cost Monitoring: Verified zero daily cloud spend post-teardown via billing dashboards.
Preserved Assets
- Infrastructure-as-code templates for potential future redeployment.
- Kubernetes manifests as reference materials.
- Local data storage (e.g., vector databases) and workflows.
Local Stack Components
The local setup retained full functionality:
- Vector databases for embeddings.
- GPU-accelerated local inference.
- Persistent local storage for all data.
The solution eliminated all cloud costs while maintaining performance, with the flexibility to redeploy cloud resources if requirements change in the future.