Scaleway billing v2beta1: X-Auth-Token auth with SCW_SECRET_KEY, paginated invoice listing with billing-period date filters (and an optional SCW_DEFAULT_ORGANIZATION_ID scope), and pdf downloads that arrive as a JSON std.File wrapper with base64 content. No per-invoice line items (usage lives in the separate consumption API), so get_invoice returns the invoice object. Verified end-to-end against a local mock of the API. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> |
||
|---|---|---|
| src | ||
| .gitignore | ||
| flake.nix | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
cloud-billing-mcp
MCP server for fetching invoices and billing data from cloud providers.
Currently supported: DigitalOcean, OVHcloud, and Scaleway. The
provider layer is pluggable — adding a provider means implementing one
interface in src/providers/.
Tools
| Tool | Description |
|---|---|
list_providers |
Supported providers, whether each is configured, supported formats |
list_invoices |
Invoices with ids, periods, amounts (DO includes a current-invoice preview) |
get_invoice |
Itemized line items for an invoice |
get_invoice_summary |
Totals, taxes, credits, billing address |
download_invoice |
Save an invoice as pdf, csv, json, or html to disk; returns the path |
get_balance |
Account balance and month-to-date usage |
list_billing_history |
Billing events: invoices, payments, credits |
All tools are read-only with respect to the provider account. Formats and
optional capabilities (balance, billing history) vary per provider — check
list_providers: DigitalOcean does pdf/csv/json, OVH does
pdf/html/json, Scaleway does pdf/json. OVH and Scaleway support
date-filtered listing. Scaleway has no per-invoice line items (usage lives
in its separate consumption API), so get_invoice returns the invoice
object itself.
Configuration
Environment variables:
DIGITALOCEAN_ACCESS_TOKEN— DigitalOcean API token; thebilling:readscope is sufficient (create one under API → Tokens in the control panel).OVH_APPLICATION_KEY/OVH_APPLICATION_SECRET/OVH_CONSUMER_KEY— OVH API credentials; create them at https://www.ovh.com/auth/api/createToken with GET rights on/me/bill*.OVH_ENDPOINT— OVH region:ovh-eu(default),ovh-ca, orovh-us.SCW_SECRET_KEY— Scaleway secret key (an IAM API key withBillingReadOnlypermissions).SCW_DEFAULT_ORGANIZATION_ID— optional Scaleway organization filter for invoice listing.CLOUD_BILLING_DOWNLOAD_DIR— wheredownload_invoicesaves files (default~/Downloads).DIGITALOCEAN_API_URL/OVH_API_URL/SCW_API_URL— API base URL overrides, for testing.
Usage
npm install
npm run build
# stdio (default) — for MCP client configs
node dist/index.js
# Streamable HTTP at http://127.0.0.1:8791/mcp
node dist/index.js --http
Claude Code registration:
claude mcp add cloud-billing -e DIGITALOCEAN_ACCESS_TOKEN=dop_v1_... -- node /path/to/cloud-billing-mcp/dist/index.js
Or with Nix: nix run .# (package exposes the cloud-billing-mcp binary).
Adding a provider
- Implement the
Providerinterface fromsrc/providers/types.ts(list/detail/summary/download;getBalanceandlistBillingHistoryare optional capabilities). - Register it in
src/providers/index.ts.
The provider enum on every tool and the list_providers output are derived
from the registry automatically.