关于 OpenClaw FinOps
OpenClaw FinOps 是面向编码 Agent 的远程 MCP 服务,使用经维护的定价矩阵预测 AWS、GCP 和 Azure 部署成本,并返回逐项费用。它还包含按月用量限制和升级流程。
主要功能
- 01预测 AWS、GCP、Azure 成本
- 02返回逐项费用明细
- 03按请求用量小时计算
- 04API 密钥认证
- 05按月用量限制与升级处理
适用场景
- 01估算云端 API 部署成本
- 02比较计算、数据库与缓存费用
- 03在 Agent 规划基础设施时核对成本
MCP 相关
远程 MCP 服务向客户端提供 forecast_deployment_cost 工具,可按云服务商和预计使用时长返回部署成本预测。
配置
远程服务无需本地安装。选择你使用的客户端,复制配置或使用一键安装。
https://openclaw-finops.marywomack.workers.dev/mcpclaude mcp add --transport http maryadawson-code-openclaw-finops https://openclaw-finops.marywomack.workers.dev/mcp{"mcpServers":{"maryadawson-code-openclaw-finops":{"type":"http","url":"https://openclaw-finops.marywomack.workers.dev/mcp"}}}在 Cursor 中打开{"servers":{"maryadawson-code-openclaw-finops":{"type":"http","url":"https://openclaw-finops.marywomack.workers.dev/mcp"}}}在 VS Code 中打开{"mcpServers":{"maryadawson-code-openclaw-finops":{"type":"http","url":"https://openclaw-finops.marywomack.workers.dev/mcp"}}}{"mcpServers":{"maryadawson-code-openclaw-finops":{"serverUrl":"https://openclaw-finops.marywomack.workers.dev/mcp"}}}命令在终端中运行;JSON 粘贴到对应客户端的 MCP 配置后重启。需要授权的服务会在首次连接时提示登录。
https://openclaw-finops.marywomack.workers.dev/mcp需要授权工具
详细介绍
IntegrityPulse FinOps
阻止 AI Agent 幻觉云成本。在对话中获取真实的价格预测。
这是什么?
IntegrityPulse FinOps 是一个远程 MCP 服务,可为 AI 编码 Agent 提供准确、实时的云部署成本预测。它不会让 Agent 猜测“一个 EC2 实例每月大约需要 50 美元”,而是调用由经过验证的价格矩阵支持的工具,并返回逐项明细。
一个工具。三家云服务商。杜绝幻觉。
User: "What would it cost to run our API on AWS with an m5.large, a managed Postgres, and Redis?"
Agent (via IntegrityPulse FinOps):
| Service | Category | Hours | Est. Cost |
|----------------------------|----------|-------|-----------|
| m5.large | Compute | 730 | $70.08 |
| rds.postgres.db.m5.large | Database | 730 | $204.40 |
| elasticache.redis.t3.micro | Cache | 730 | $11.68 |
Total Estimated Monthly Cost: $286.16
快速开始
Claude Desktop
将以下内容添加到你的 claude_desktop_config.json:
{
"mcpServers": {
"integritypulse": {
"type": "streamable-http",
"url": "https://integritypulse.marywomack.workers.dev/mcp",
"headers": {
"x-api-key": "YOUR_API_KEY"
}
}
}
}
Cursor
添加到你的 .cursor/mcp.json:
{
"mcpServers": {
"integritypulse": {
"type": "streamable-http",
"url": "https://integritypulse.marywomack.workers.dev/mcp",
"headers": {
"x-api-key": "YOUR_API_KEY"
}
}
}
}
cURL
curl -X POST https://integritypulse.marywomack.workers.dev/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "forecast_deployment_cost",
"arguments": {
"provider": "AWS",
"services_to_add": [
{"service_name": "m5.large", "estimated_usage_hours": 730}
]
}
}
}'
工具:forecast_deployment_cost
| 参数 | 类型 | 描述 |
|---|---|---|
provider | "AWS" | "GCP" | "AZURE" | 要查询价格的云服务商 |
services_to_add | Array<{ service_name, estimated_usage_hours }> | 要纳入预测的服务 |
支持的服务:
| AWS | GCP | Azure |
|---|---|---|
| t3.micro, t3.medium, m5.large | e2-micro, e2-medium, n2-standard-2 | B1s, B2s, D2s_v3 |
| rds.postgres.db.t3.micro, rds.postgres.db.m5.large | cloudsql.postgres.db-custom-1-3840, cloudsql.postgres.db-custom-4-15360 | postgresql.flexible.b1ms |
| elasticache.redis.t3.micro | memorystore.redis.1gb | |
| s3.standard.1tb |
存在的原因:面向 Agent 时代的 FinOps
AI Agent 正从“给我写代码”迈向“替我部署”。当 Agent 配置基础设施时,成本准确性不是可有可无的功能,而是一项财务控制措施。
问题: 大模型会产生价格幻觉。它们会信誓旦旦地告诉你,一个 RDS 实例每月只需“15 美元”,而实际金额却是 204 美元。当 Agent 开始自主执行部署时,这些幻觉就会变成真实账单。
解决方案: IntegrityPulse FinOps 是 Agent 可调用的有据可依的定价预言机。价格矩阵经过维护、版本化,且结果确定。不生成、不猜测。
Agent 商务与收入门槛
此服务也是收入门控型 MCP的参考实现——这是一种在不破坏 Agent 体验的前提下,将 MCP 工具变现的模式。
工作方式如下:
- 每个请求都带有
x-api-key标头。 - 服务会在 Supabase 中检查用户的
tier和monthly_usage_count。 - 免费版用户每月可进行 25 次操作。
- 达到限额时,服务不会返回 HTTP 错误,而是返回有效的 MCP 工具结果,并设置
isError: true:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"content": [{
"type": "text",
"text": "IntegrityPulse FinOps Alert: Your free monthly tier (25/25 operations) has been exhausted. To generate this architectural cost forecast, please upgrade to the Pro tier here: https://billing.openclaw.com/upgrade. Once upgraded, ask me to retry."
}],
"isError": true
}
}
为什么使用 isError: true,而不是 HTTP 402/429?
因为调用方是大模型,而不是浏览器。HTTP 错误会被 MCP 传输层吞掉,用户根本看不到。返回带有 isError: true 的工具结果,升级提示就会直接出现在用户正在参与的对话中。Agent 会读取并展示提示,用户可以立即采取行动。这是在用户意图产生时促成交易。
Stripe 集成
用户通过账单链接升级后,Stripe 会向 /api/webhook/stripe 发送 checkout.session.completed webhook。服务会自动:
- 将用户的套餐从
FREE更新为PRO - 将用户的使用次数计数器重置为 0
- 用户接下来的 Agent 请求将顺畅通过
架构
+-----------------+
Claude / Cursor | Cloudflare | +------------+
(MCP Client) -------->| Worker (Hono) |------>| Supabase |
POST | | | (users) |
/mcp | Revenue Gate | +------------+
| MCP Server |
| Stripe Webhook |------> Stripe API
+-----------------+
- 运行时: Cloudflare Workers(边缘运行,冷启动约 0 毫秒)
- 框架: Hono(轻量级,原生支持 Workers)
- MCP SDK: 使用 Streamable HTTP 传输的
@modelcontextprotocol/sdk - 身份验证: 在
x-api-key或Authorization: Bearer标头中提供 API 密钥 - 数据库: Supabase(PostgreSQL)
- 支付: Stripe Checkout + Webhooks
自托管
git clone https://github.com/maryadawson-code/integritypulse.git
cd integritypulse
npm install
# Configure secrets
cp .env.example .env
# Edit .env with your Supabase and Stripe credentials
# Local development
npx wrangler dev
# Deploy to Cloudflare Workers
npx wrangler secret put SUPABASE_URL
npx wrangler secret put SUPABASE_SERVICE_KEY
npx wrangler secret put STRIPE_SECRET_KEY
npx wrangler secret put STRIPE_WEBHOOK_SECRET
npx wrangler deploy
License
MIT
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。