[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-9933":3},{"id":4,"name":5,"fullName":6,"owner":5,"repo":5,"description":7,"homepage":8,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":15,"forks30d":15,"starsTrendScore":19,"compositeScore":20,"rankGlobal":9,"rankLanguage":9,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":22,"hasPages":22,"topics":24,"createdAt":9,"pushedAt":9,"updatedAt":36,"readmeContent":37,"aiSummary":38,"trendingCount":15,"starSnapshotCount":15,"syncStatus":16,"lastSyncTime":39,"discoverSource":40},9933,"opencost","opencost\u002Fopencost","Cost monitoring for Kubernetes workloads and cloud costs","http:\u002F\u002Fopencost.io",null,"Go",6584,815,52,126,0,2,21,49,9,39.74,"Apache License 2.0",false,"develop",[25,26,27,28,29,30,31,32,33,34,5,35],"aws","azure","cncf","cost","cost-optimization","finops","gcp","k8s","kubernetes","monitoring","prometheus","2026-06-12 02:02:14","[![License](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-Apache%202.0-blue.svg)](https:\u002F\u002Fopensource.org\u002Flicenses\u002FApache-2.0)\n[![OpenSSF Best Practices](https:\u002F\u002Fwww.bestpractices.dev\u002Fprojects\u002F6219\u002Fbadge)](https:\u002F\u002Fwww.bestpractices.dev\u002Fprojects\u002F6219)\n[![Gurubase](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FGurubase-Ask%20OpenCost%20Guru-006BFF)](https:\u002F\u002Fgurubase.io\u002Fg\u002Fopencost)\n\n![](.\u002Fopencost-header.png)\n\n# OpenCost — your favorite open source cost monitoring tool for Kubernetes and cloud spend\n\nOpenCost give teams visibility into current and historical Kubernetes and cloud spend and resource allocation.\nThese models provide cost transparency in Kubernetes environments that support multiple applications, teams, departments, etc.\nIt also provides visibility into the cloud costs across multiple providers.\n\nOpenCost was originally developed and open sourced by [Kubecost](https:\u002F\u002Fkubecost.com). This project combines a [specification](\u002Fspec\u002F) as well as a Golang implementation of these detailed requirements. The web UI is available in the [opencost\u002Fopencost-ui](http:\u002F\u002Fgithub.com\u002Fopencost\u002Fopencost-ui) repository.\n\n[![OpenCost UI Walkthrough](.\u002Fui\u002Fsrc\u002Fthumbnail.png)](https:\u002F\u002Fyoutu.be\u002FlCP4Ci9Kcdg)\n*OpenCost UI Walkthrough*\n\nTo see the full functionality of OpenCost you can view [OpenCost features](https:\u002F\u002Fopencost.io). Here is a summary of features enabled:\n\n- Real-time cost allocation by Kubernetes cluster, node, namespace, controller kind, controller, service, or pod\n- Multi-cloud cost monitoring for all cloud services on AWS, Azure, GCP\n- Dynamic on-demand k8s asset pricing enabled by integrations with AWS, Azure, and GCP billing APIs\n- Supports on-prem k8s clusters with custom CSV pricing\n- Allocation for in-cluster K8s resources like CPU, GPU, memory, and persistent volumes\n- Easily export pricing data to Prometheus with \u002Fmetrics endpoint ([learn more](https:\u002F\u002Fwww.opencost.io\u002Fdocs\u002Finstallation\u002Fprometheus))\n- Carbon costs for cloud resources\n- MCP support\n- Support for external costs like Datadog through [OpenCost Plugins](https:\u002F\u002Fgithub.com\u002Fopencost\u002Fopencost-plugins)\n- Free and open source distribution ([Apache2 license](LICENSE))\n\n## Getting Started\n\nOpenCost is now installed and managed via the official Helm chart only.\n\nQuick install on any Kubernetes 1.20+ cluster:\n\n```bash\nhelm repo add opencost https:\u002F\u002Fopencost.github.io\u002Fopencost-helm-chart\nhelm repo update\nhelm install opencost opencost\u002Fopencost\n```\n\nNote: The standalone Kubernetes manifest files have been removed. Please use Helm for all installations and upgrades. See the [Helm installation docs](https:\u002F\u002Fwww.opencost.io\u002Fdocs\u002Finstallation\u002Finstall) for details and configuration.\n\n> **Note for sharded Prometheus users:**\n> If you run Prometheus in a sharded (HA) setup, set `PROMETHEUS_SERVER_ENDPOINT` to a global query endpoint (e.g., Thanos Query, Cortex, or Mimir). Pointing to a single Prometheus pod may result in incomplete or intermittent export results. See the [Prometheus integration docs](https:\u002F\u002Fwww.opencost.io\u002Fdocs\u002Finstallation\u002Fprometheus) for details.\n\n## Usage\n\n- [Cost APIs](https:\u002F\u002Fwww.opencost.io\u002Fdocs\u002Fintegrations\u002Fapi)\n- [CLI \u002F kubectl cost](https:\u002F\u002Fwww.opencost.io\u002Fdocs\u002Fintegrations\u002Fkubectl-cost)\n- [Prometheus Metrics](https:\u002F\u002Fwww.opencost.io\u002Fdocs\u002Fintegrations\u002Fprometheus)\n- [User Interface](https:\u002F\u002Fwww.opencost.io\u002Fdocs\u002Finstallation\u002Fui)\n\n## MCP Server\n\nThe OpenCost MCP (Model Context Protocol) server provides AI agents with access to cost allocation and asset data through a standardized interface. The MCP server is **disabled by default** (opt-in) in all OpenCost deployments, runs on port 8081, and is **built into the Helm chart** for easy production deployment. Users have full control to enable it or configure custom ports and settings.\n\n### Features\n\n- **Opt-in by Default**: MCP server is disabled by default to minimize the attack surface and must be explicitly enabled\n- **Full User Control**: Easy to enable or configure port and settings\n- **Allocation Queries**: Retrieve cost allocation data with filtering and aggregation\n- **Asset Queries**: Access detailed asset information including nodes, disks, load balancers, and more\n- **Cloud Cost Queries**: Query cloud cost data with provider, service, and region filtering\n- **HTTP Transport**: Uses HTTP for reliable communication with MCP clients\n- **Simple Configuration**: Easy to enable using standard environment variables\n- **Helm Integration**: Built into the official Helm chart for production deployments\n\n### Quick Start\n\n#### Using Tilt (Development)\n```bash\n# Clone and start OpenCost with MCP server\n# You may also need to clone opencost-ui and opencost-helm-charts repositories\n# Make sure the cloned repositories are in the same parent tree as opencost\n\ngit clone https:\u002F\u002Fgithub.com\u002Fopencost\u002Fopencost.git\ncd opencost\ntilt up\n```\n##### Default Configurations\nThe UI and Prometheus both run on port 9090. You may need to port-forward to a non-default port to access both them at the same time.\n\nTilt configuration notes (cloud costs):\n\nOpenCost's Tilt values (`tilt-values.yaml`) include extra environment variables to enable Cloud Cost ingestion in dev:\n\n```yaml\n# tilt-values.yaml (excerpt)\nopencost:\n  exporter:\n    extraEnv:\n      CLOUD_COST_ENABLED: \"true\"\n      CLOUD_COST_CONFIG_PATH: \"\u002Fvar\u002Fcloud-integration\u002Fcloud-integration.json\"\n```\n\n- Set `CLOUD_COST_ENABLED` to \"true\" to turn on cloud cost ingestion.\n- Point `CLOUD_COST_CONFIG_PATH` to the mounted cloud integration file used by Tilt (e.g., `\u002Fvar\u002Fcloud-integration\u002Fcloud-integration.json`).\n- Adjust other values in `tilt-values.yaml` as needed during development.\n\n#### Using Helm (Production)\n```bash\n# Add the OpenCost Helm repository\nhelm repo add opencost https:\u002F\u002Fopencost.github.io\u002Fopencost-helm-chart\nhelm repo update\n\n# Deploy OpenCost with MCP server enabled (opt-in)\nhelm install opencost opencost\u002Fopencost --set opencost.mcp.enabled=true\n\n# Access MCP server via port forwarding (example)\nkubectl port-forward svc\u002Fopencost 8081:8081\n```\n\nThe MCP server is **disabled by default** in the Helm chart. For custom configuration:\n\n```bash\n# Deploy with MCP server enabled\nhelm install opencost opencost\u002Fopencost \\\n  --set opencost.mcp.enabled=true\n\n# Deploy with custom MCP port\nhelm install opencost opencost\u002Fopencost \\\n  --set opencost.mcp.port=9091\n\n# Deploy with debug logging\nhelm install opencost opencost\u002Fopencost \\\n  --set opencost.mcp.extraEnv.MCP_LOG_LEVEL=debug\n```\n\n#### Configuration Summary\n\n| Configuration | Command | Description |\n|---------------|---------|-------------|\n| **Default** | `helm install opencost opencost\u002Fopencost` | MCP disabled by default |\n| **Enable** | `--set opencost.mcp.enabled=true` | Enable MCP server on port 8081 |\n| **Custom Port** | `--set opencost.mcp.port=9091` | Use different port |\n| **Debug Mode** | `--set opencost.mcp.extraEnv.MCP_LOG_LEVEL=debug` | Enable debug logging |\n\n### MCP Client Configuration\n\nConfigure your MCP client (e.g., Cursor) to connect to the OpenCost MCP server:\n\n**Default configuration (port 8081):**\n```json\n{\n  \"mcpServers\": {\n    \"opencost\": {\n      \"type\": \"http\",\n      \"url\": \"http:\u002F\u002Flocalhost:8081\"\n    }\n  }\n}\n```\n\n**Custom port configuration:**\n```json\n{\n  \"mcpServers\": {\n    \"opencost\": {\n      \"type\": \"http\",\n      \"url\": \"http:\u002F\u002Flocalhost:9091\"\n    }\n  }\n}\n```\n\n**For Kubernetes deployments:**\n```json\n{\n  \"mcpServers\": {\n    \"opencost\": {\n      \"type\": \"http\",\n      \"url\": \"http:\u002F\u002Fopencost.opencost.svc.cluster.local:8081\"\n    }\n  }\n}\n```\n\n**For external access (with LoadBalancer\u002FIngress):**\n```json\n{\n  \"mcpServers\": {\n    \"opencost\": {\n      \"type\": \"http\",\n      \"url\": \"http:\u002F\u002Fyour-opencost-domain.com:8081\"\n    }\n  }\n}\n```\n\n### Available MCP Tools\n\nThe MCP server provides these tools for AI agents:\n\n#### `get_allocation_costs`\nRetrieve cost allocation data with filtering and aggregation.\n\n**Parameters:**\n- `window` (required): Time window (e.g., \"7d\", \"1h\", \"30m\")\n- `aggregate` (optional): Aggregation properties (e.g., \"namespace\", \"pod\", \"node\")\n- `step` (optional): Resolution step size\n- `accumulate` (optional): Whether to accumulate over time\n- `share_idle` (optional): Whether to share idle costs\n- `include_idle` (optional): Whether to include idle resources\n\n#### `get_asset_costs`\nRetrieve asset cost data including nodes, disks, load balancers, and more.\n\n**Parameters:**\n- `window` (required): Time window (e.g., \"7d\", \"1h\", \"30m\")\n\n#### `get_cloud_costs`\nRetrieve cloud cost data with provider, service, and region filtering.\n\n**Parameters:**\n- `window` (required): Time window (e.g., \"7d\", \"1h\", \"30m\")\n- `aggregate` (optional): Aggregation properties (e.g., \"provider\", \"service\", \"region\")\n- `accumulate` (optional): Time accumulation (\"day\", \"week\", \"month\")\n- `provider` (optional): Filter by cloud provider (e.g., \"aws\", \"gcp\", \"azure\")\n- `service` (optional): Filter by service (e.g., \"ec2\", \"compute\", \"s3\")\n- `category` (optional): Filter by category (e.g., \"compute\", \"storage\", \"network\")\n- `region` (optional): Filter by region (e.g., \"us-west-1\", \"us-central1\")\n- `accountID` (optional): Filter by account ID\n\n### Supported Asset Types\n\n- **Node**: Compute instances with CPU, RAM, GPU details\n- **Disk**: Storage volumes with usage and cost breakdown\n- **LoadBalancer**: Load balancer instances with IP and private status\n- **Network**: Network-related costs and usage\n- **Cloud**: Cloud service costs with credit information\n- **ClusterManagement**: Kubernetes cluster management costs\n\n### Example Usage\n\nOnce configured, AI agents can query cost data like:\n\n```javascript\n\u002F\u002F Get cost allocation for the last 7 days\nconst allocation = await mcpClient.callTool('get_allocation_costs', {\n  window: '7d',\n  aggregate: 'namespace,node'\n});\n\n\u002F\u002F Get asset costs for the last 24 hours\nconst assets = await mcpClient.callTool('get_asset_costs', {\n  window: '1d'\n});\n\n\u002F\u002F Get cloud costs for AWS EC2 in us-west-1\nconst cloudCosts = await mcpClient.callTool('get_cloud_costs', {\n  window: '7d',\n  aggregate: 'service',\n  provider: 'aws',\n  service: 'ec2',\n  accumulate: 'day',\n  filter: 'regionID:\"us-west-1\"'\n});\n```\n\nFor detailed setup instructions and advanced configuration, see the [Helm chart documentation](https:\u002F\u002Fgithub.com\u002Fopencost\u002Fopencost-helm-chart\u002Fblob\u002Fmain\u002Fcharts\u002Fopencost\u002FREADME.md#mcp-server).\n\n## Contributing\n\nWe :heart: pull requests! See [`CONTRIBUTING.md`](CONTRIBUTING.md) for information on building the project from source and contributing changes.\n\n## Community\n\nIf you need any support or have any questions on contributing to the project, you can reach us on [CNCF Slack](https:\u002F\u002Fslack.cncf.io\u002F) in the [#opencost](https:\u002F\u002Fcloud-native.slack.com\u002Farchives\u002FC03D56FPD4G) channel or attend the biweekly [OpenCost Working Group community meeting](https:\u002F\u002Fbit.ly\u002Fopencost-meeting) from the [Community Calendar](https:\u002F\u002Fbit.ly\u002Fopencost-calendar) to discuss OpenCost development.\n\n## FAQ\n\nYou can view [OpenCost documentation](https:\u002F\u002Fwww.opencost.io\u002Fdocs\u002FFAQ) for a list of commonly asked questions.\n","OpenCost 是一个用于监控 Kubernetes 工作负载和云成本的开源工具。其核心功能包括实时成本分配、多云成本监控以及动态获取 AWS、Azure 和 GCP 的资产定价，同时支持自定义 CSV 定价以适应本地 Kubernetes 集群的成本计算需求。此外，它还提供了对 K8s 内部资源如 CPU、GPU、内存及持久化存储的详细成本分析，并能够将这些数据轻松导出到 Prometheus 中。OpenCost 适用于需要精细化管理云支出的企业或团队，特别是在多应用、跨部门的 Kubernetes 环境下追求成本透明度与优化时尤为有用。","2026-06-11 03:25:28","top_topic"]