# Generate a FOCUS-Compliant Cost Report

## Overview

If you want to see exactly what you are being charged for and export it in a format that works with any cost analysis tool, this tutorial shows you how.

Use the <code class="expression">space.vars.ionos\_cloud</code> MCP Server with Claude Desktop to retrieve your billing data, map it to the [<mark style="color:blue;">FOCUS v1.3</mark>](https://focus.finops.org/) standard schema, and generate a FinOps-ready cost report—all without writing a single script.

FinOps Open Cost and Usage Specification (FOCUS) is the open standard for cloud billing interoperability published by the [<mark style="color:blue;">FinOps Foundation</mark>](https://focus.finops.org/). A FOCUS-compliant dataset uses standardized column names across providers, so it loads directly into tools such as Apptio Cloudability, CloudHealth, Finout, or a custom dashboard alongside AWS and Azure data, with no provider-specific transformations.

```mermaid
flowchart LR
    CD["Claude Desktop\nAI assistant"]
    MCP["IONOS CLOUD\nMCP Server\nlocal binary"]
    API["IONOS CLOUD APIs\nBilling endpoints"]
    RPT["FOCUS v1.3 report\ncost attribution\ncharge categories"]

    CD <-->|"MCP / JSON-RPC"| MCP
    MCP <-->|"HTTPS"| API
    CD -->|"artifact"| RPT
```

The billing tools covered in this tutorial are:

| Tool                              | What it returns                                                                                                 | Key FOCUS fields                                                            |
| --------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
| `get_billing_focus_spec`          | Full FOCUS v1.3 column specification and <code class="expression">space.vars.ionos\_cloud</code>→FOCUS mappings | Reference for all mappings                                                  |
| `list_billing_invoices`           | All invoices with IDs, dates, and amounts                                                                       | `BilledCost`, `BillingCurrency`, `ChargePeriodStart/End`                    |
| `list_billing_invoices_by_period` | Invoices for a specific month (YYYY-MM)                                                                         | `BilledCost`, `ChargeCategory`, `ChargePeriodStart/End`                     |
| `get_billing_invoice`             | Line-item breakdown for a specific invoice                                                                      | `ChargeCategory`, `ChargeDescription`, `BilledCost`                         |
| `list_billing_usage`              | Aggregated resource usage for the current period, grouped by datacenter                                         | `ConsumedQuantity`, `ConsumedUnit`, `ResourceId` (datacenter-level)         |
| `get_billing_usage_by_datacenter` | Usage scoped to a single datacenter (VDC UUID)                                                                  | `ConsumedQuantity`, `ConsumedUnit`, `ResourceId`                            |
| `list_billing_traffic`            | Per-datacenter network traffic for the current month                                                            | `ConsumedQuantity` (bytes), `ConsumedUnit` (`Byte`)                         |
| `list_billing_traffic_by_period`  | Network traffic for a specific month (YYYY-MM)                                                                  | `ConsumedQuantity`, `ChargePeriodStart/End`                                 |
| `list_billing_evn`                | Per-resource provisioning intervals for the current period                                                      | `ResourceId` (resource-level), `ChargeDescription`, `ChargePeriodStart/End` |
| `list_billing_products`           | Product and pricing catalog entries                                                                             | `SkuId`, `ListUnitPrice`, `PricingUnit`                                     |

{% hint style="info" %}
**Note:** The MCP Server is read-only. It retrieves billing data but cannot modify invoices, change contract settings, or trigger payments.
{% endhint %}

{% hint style="info" %}
**Note:** `list_billing_usage` aggregates at the datacenter level, so `ResourceId` maps to a datacenter (VDC) ID, not an individual resource. Use `list_billing_evn` for per-resource granularity; it returns provisioning intervals with individual resource IDs for a true FOCUS `ResourceId` mapping.
{% endhint %}

## Target audience

This tutorial is for FinOps practitioners, cloud finance teams, platform engineers, and IONOS account holders who want a structured view of their billing data and want to export it in a standards-compliant format for integration with FinOps tools or custom cost dashboards.

A basic familiarity with the following is helpful:

* <code class="expression">space.vars.ionos\_cloud</code> billing concepts (invoices, usage metering, contract number). Your contract number is your IONOS account number, visible in the DCD under your account profile or on any invoice.
* FOCUS v1.3 column families (ChargeCategory, BilledCost, ConsumedQuantity). Familiarity is helpful but not required; the MCP Server provides the full specification on request.
* Claude Desktop or any MCP-compatible AI client.

## What you will learn

* How to configure the <code class="expression">space.vars.ionos\_cloud</code> MCP Server with billing credentials.
* How to retrieve the FOCUS v1.3 column specification from the MCP Server.
* How to map IONOS invoice and usage data to FOCUS fields using natural language prompts.
* How to generate a cost attribution report grouped by region, service, and charge category.
* How to export the report as a FOCUS-compliant dataset.

## Before you begin

Ensure you have the following:

| Requirement                                                     | Details                                                                                                                                                                                                                                                                                 |
| --------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <code class="expression">space.vars.ionos\_cloud</code> account | At least one billing period with usage data.                                                                                                                                                                                                                                            |
| Contract number                                                 | Your IONOS contract number. Find it in the DCD under your account profile or on any invoice.                                                                                                                                                                                            |
| API token                                                       | Generate one in the [<mark style="color:blue;">DCD</mark>](https://dcd.ionos.com/) under **Management** > **Token Management**.                                                                                                                                                         |
| MCP Server binary                                               | Download the latest release for your platform from [<mark style="color:blue;">ionoscloud-mcp releases on GitHub</mark>](https://github.com/ionos-cloud/ionoscloud-mcp/releases) and place it at `/usr/local/bin/ionoscloud-mcp` (macOS/Linux) or `C:\bin\ionoscloud-mcp.exe` (Windows). |
| Claude Desktop                                                  | Installed from [<mark style="color:blue;">claude.ai/download</mark>](https://claude.ai/download).                                                                                                                                                                                       |

## Cost considerations

This tutorial makes read-only API calls to the IONOS Cloud Billing API. No additional charges apply beyond your existing contract usage.

## Procedure

{% stepper %}
{% step %}

### Configure the MCP Server

Open the Claude Desktop configuration file:

* **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
* **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`

{% hint style="info" %}
**Note:** To open the hidden Library folder in Finder, press **Cmd+Shift+G** and paste the path. If the file does not exist yet, create it as an empty JSON file containing `{}`.
{% endhint %}

Add the following entry to the `mcpServers` object:

```json
{
  "mcpServers": {
    "ionoscloud": {
      "command": "/usr/local/bin/ionoscloud-mcp",
      "env": {
        "IONOS_TOKEN": "your-api-token"
      }
    }
  }
}
```

Replace `your-api-token` with your API token. On Windows, change `command` to `C:\bin\ionoscloud-mcp.exe`. By default, the MCP server registers all tools at startup, so the billing tools are immediately available without any additional configuration.

{% hint style="warning" %}
**Warning:** Keep credentials secure. Never commit this file to version control.

* **Note:** On macOS/Linux: Restrict file permissions: `chmod 600 ~/Library/Application\ Support/Claude/claude_desktop_config.json`
* **Note:** On Windows: Right-click the file, select **Properties** > **Security**, and restrict access to your user account only.
  {% endhint %}

Quit and reopen Claude Desktop. A hammer icon in the input bar confirms the MCP Server is connected.
{% endstep %}

{% step %}

### Load the FOCUS v1.3 specification

In a new Claude Desktop conversation, enter:

> Call get\_billing\_focus\_spec and show me the IONOS tool to FOCUS v1.3 field mappings as a table.

Claude calls `get_billing_focus_spec` and returns the full FOCUS v1.3 column specification and the mapping of each IONOS billing tool to its corresponding FOCUS fields. This step primes the conversation context so all subsequent prompts produce correctly mapped output.

{% hint style="success" %}
**Result:** A table showing FOCUS column families (Account, Billing & Cost, Charge, Resource, Service, Location, Pricing) alongside the IONOS tools and fields that populate them. If you see a "tool not found" error instead, confirm Claude Desktop is connected to the MCP server (look for the hammer icon in the input bar after restarting) and that your `IONOS_TOKEN` has read access to Billing. Billing tools register at startup regardless of `IONOS_MCP_LOAD_MODE`, so the load mode is not the cause.
{% endhint %}

{% hint style="info" %}
**Note:** The FOCUS specification tool loads the full column mapping into the conversation context. Without it, Claude maps fields based on general knowledge of FOCUS rather than the exact IONOS→FOCUS mappings, which can produce inconsistent column names.
{% endhint %}
{% endstep %}

{% step %}

### Retrieve and map billing data

Enter the following prompt to retrieve your current billing usage and map it to FOCUS:

> List my billing usage for the current month. Map each record to FOCUS v1.3 fields using the mapping you just loaded. Present the result as a table with these columns: ChargePeriodStart, ChargePeriodEnd, RegionId, ResourceId, ResourceType, ServiceCategory, ServiceName, ConsumedQuantity, ConsumedUnit, BilledCost, BillingCurrency, ChargeCategory.

Claude calls `list_billing_usage` and maps the response to FOCUS v1.3 fields, returning a table similar to:

| ChargePeriodStart | ChargePeriodEnd | RegionId     | ResourceId | ServiceCategory | ConsumedQuantity | ConsumedUnit | BilledCost | BillingCurrency | ChargeCategory |
| ----------------- | --------------- | ------------ | ---------- | --------------- | ---------------- | ------------ | ---------- | --------------- | -------------- |
| 2026-06-01        | 2026-06-04      | eu-central-3 | dc-abc123  | Compute         | 96               | Hours        | null       | EUR             | Usage          |
| 2026-06-01        | 2026-06-04      | eu-central-1 | dc-def456  | Storage         | 69               | GB-Hours     | null       | EUR             | Usage          |
| 2026-06-01        | 2026-06-04      | eu-central-3 | dc-abc123  | Networking      | 22               | Hours        | null       | EUR             | Usage          |

{% hint style="warning" %}
**Warning:** BilledCost is null from usage data. The `list_billing_usage` returns metered quantities only; it has no rate or cost data. `BilledCost` is a mandatory FOCUS v1.3 field. To populate it, run the enrichment prompt below to cross-join against your latest invoice.
{% endhint %}

{% hint style="info" %}
**Note:** ResourceId is datacenter-level. The `list_billing_usage` aggregates by datacenter, so `ResourceId` resolves to the VDC UUID. `RegionId` returns the region code (for example, `eu-central-3`). For individual resource IDs, use `list_billing_evn` which returns per-resource provisioning intervals.
{% endhint %}

{% hint style="info" %}
\*\*Note:\*\*ChargePeriodStart/End reflect the billing observation window returned by the tool (for example, `2026-06-01` to the current date for a partial month), not per-meter timestamps; consistent with the FOCUS definition.
{% endhint %}

{% hint style="success" %}
**Result:** A FOCUS-mapped usage table with `BilledCost = null`. If the table is empty, confirm your API token has Billing read access and that the current billing period has usage data.
{% endhint %}

To enrich the dataset with cost estimates, enter:

> List my invoices to find the most recent closed one, then get its full line-item breakdown. For each usage row from the previous step, match by meter or product ID and use the ListUnitPrice from the matching invoice line item as the unit rate. Compute BilledCost as ConsumedQuantity × ListUnitPrice and label it as a prorated estimate. Leave BilledCost as null for any row with no matching invoice line item.

Claude calls `list_billing_invoices` and `get_billing_invoice`, joins the unit rates against the current-month usage rows, and returns an enriched table.

{% hint style="warning" %}
**Warning:** BilledCost is an estimate, not an invoice figure. The current billing month has no invoice until it closes. The enrichment uses the most recent closed invoice as a rate table and computes `BilledCost = ConsumedQuantity × prior-period unit rate`. This is a prorated approximation; suitable for in-month cost tracking, but not the authoritative billed amount. When the current month's invoice is posted, replace these estimates with the actual invoiced values by running the invoice reconciliation prompt in the [<mark style="color:blue;">example prompts</mark>](#example-prompts-for-recurring-finops-workflows) section.

Some rows may remain `null` if a meter has no matching rate in the prior invoice (for example, meters billed at a zero rate, or new meters with no billing history).
{% endhint %}
{% endstep %}

{% step %}

### Generate a cost attribution report

Enter the following prompt to produce a grouped cost attribution summary:

> Using the enriched FOCUS dataset from the previous step, produce a cost attribution report. Group costs by: (1) RegionId, (2) ServiceCategory, and (3) ChargeCategory. For each group show the total BilledCost and percentage of total spend. Then add a summary of the top 5 most expensive data centers by ResourceId (VDC UUID) with their ServiceCategory and BilledCost.

Claude makes multiple tool calls, aggregates the results, and returns a structured attribution report. Then ask it to generate a report artifact:

> Create a polished HTML cost attribution report from these findings. Include: a total monthly spend summary with BilledCost from the enriched dataset, a cost breakdown table grouped by region and service category, a top 5 resources section, and a FOCUS compliance note confirming the data conforms to FOCUS v1.3. Use a dark theme consistent with FinOps dashboard conventions.

Claude generates the report as an HTML artifact. Select the artifact panel to preview it in the conversation.

The report includes a KPI summary, cost breakdown by region and service category, a top data centers table, and a FOCUS v1.3 compliance note with estimation caveats. Here is an example of the output:

<a href="https://github.com/ionos-cloud/twt-tutorials-documentation/blob/main/.gitbook/assets/mcp-focus-cost-attribution-example.html" class="button secondary" data-icon="file">Open example cost attribution report (HTML)</a>

![Example FOCUS cost attribution report showing KPI cards, region breakdown, and service category matrix](/files/iEkUw0PsqTwUAJbc5sRm)
{% endstep %}

{% step %}

### Export the report

To export the FOCUS dataset retrieved in this conversation as a CSV:

> Export the enriched FOCUS billing dataset from this conversation as a CSV with FOCUS v1.3 column headers. Include all rows with their BilledCost values — estimated where enriched from the invoice, null where unmatched.

Claude outputs the CSV content as an artifact. Then:

1. Select the artifact panel.
2. Select **Copy** to copy the content to your clipboard.
3. Paste into a new file and save as `ionos-focus-export-YYYY-MM.csv`.
4. Load into your FinOps tool (Apptio, CloudHealth, Finout, or a custom dashboard).

{% hint style="info" %}
**Note:** The report export covers usage data. To include traffic and invoice data in a single export, first run the traffic and invoice prompts from the [<mark style="color:blue;">example prompts</mark>](#example-prompts-for-recurring-finops-workflows) section, then ask Claude to export all data from the conversation.
{% endhint %}

To export the HTML cost report instead:

1. Select the HTML artifact panel.
2. Select **Copy** and save as `ionos-cost-report-YYYY-MM.html`.
3. Open in a browser or email it to your finance contact.

{% hint style="warning" %}
**Warning:** The exported CSV may contain personal data (contract identifiers, resource names) subject to GDPR if you are an EU customer. Store the file in a location available only to authorised personnel and delete it when no longer needed.
{% endhint %}
{% endstep %}
{% endstepper %}

## Final result

After completing the procedure, you have:

* The FOCUS v1.3 column mapping for all IONOS billing tools loaded and verified.
* A FOCUS-compliant billing dataset for the current month with `ConsumedQuantity` and `ConsumedUnit` populated from live usage data.
* `BilledCost` populated as a prorated estimate (current-month quantity × prior invoice unit rate); accurate for in-month cost tracking, replaced by actual figures when the month closes.
* A cost attribution report grouped by region and service category.
* A CSV export ready to load into any FOCUS-compatible FinOps tool.
* An HTML cost report ready to share with finance or management teams.

## Example prompts for recurring FinOps workflows

{% hint style="info" %}
**Note:** Billing data included in conversation prompts is processed by Claude (Anthropic's AI service) and is subject to [<mark style="color:blue;">Anthropic's usage policies</mark>](https://www.anthropic.com/legal/aup). Review these terms before including sensitive contract or cost data in prompts.
{% endhint %}

### Month-over-month comparison

> Use list\_billing\_invoices\_by\_period to get the last two closed billing months. For each month, get the full invoice line-item breakdown and map to FOCUS v1.3. Show a month-over-month comparison table with the delta in BilledCost per ServiceCategory. Highlight any service where cost increased by more than 20%.

### Invoice reconciliation

> List my last three invoices. For each one, get the line-item breakdown and map to FOCUS ChargeCategory (Usage, Tax, Credit, or Adjustment). Show total BilledCost per category per invoice and flag any month where Tax or Adjustment charges exceeded 5% of total spend.

### Network traffic cost

> Get my network traffic data for the current billing month. Map to FOCUS fields and show per-datacenter inbound and outbound traffic in GB. Identify the datacenter with the highest outbound traffic. Then look up the traffic unit rate from the most recent invoice and compute the estimated cost per data center as traffic volume × rate.

### Cost anomaly detection

> Use list\_billing\_invoices\_by\_period to get the last three closed billing months. For each month, get the full invoice line-item breakdown and calculate total BilledCost per ServiceCategory. Flag any category where the most recent month's cost is more than 1.5× the three-month average. For flagged categories, cross-reference the current month's usage data to identify which meters are driving the increase.

### Pricing catalog lookup

> Search the IONOS CLOUD product catalog for Compute Engine products. Show the SkuId, ListUnitPrice, and PricingUnit in FOCUS format for each result.

## Troubleshooting

| Symptom                                 | Resolution                                                                                                                                                                                                                                            |
| --------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Hammer icon not visible after restart   | Verify the binary path in `claude_desktop_config.json` is correct. On macOS/Linux, confirm the binary is executable: `chmod +x /usr/local/bin/ionoscloud-mcp`.                                                                                        |
| `get_billing_focus_spec` not found      | Confirm Claude Desktop is connected to the MCP server (hammer icon visible after restart) and your `IONOS_TOKEN` has Billing read access. Billing tools register at startup in both `eager` and `lazy` load modes, so the load mode is not the cause. |
| Empty usage data                        | Confirm your API token has Billing read access. Verify the current billing period has usage; new accounts or periods with no resources provisioned return empty results.                                                                              |
| Multi-month request rejected            | `list_billing_invoices_by_period` and `list_billing_traffic_by_period` process one month per call. For multi-month ranges, Claude asks for confirmation before making multiple sequential calls.                                                      |
| FOCUS columns missing or misnamed       | Start the conversation by calling `get_billing_focus_spec` first. Without the specification in context, Claude uses general FOCUS knowledge which may not match the exact IONOS field mappings.                                                       |
| `BilledCost` is null for all rows       | Expected from `list_billing_usage`; it returns quantities only. Run the enrichment prompt in Step 3 to populate `BilledCost` using the prior invoice as a rate table.                                                                                 |
| Some rows still `null` after enrichment | The meter has no matching rate in the prior invoice; either it is billed at zero or it is a new meter with no billing history. This is expected and FOCUS-valid; leave `BilledCost = null` for those rows.                                            |

## Conclusion

You have used the <code class="expression">space.vars.ionos\_cloud</code> MCP Server and Claude Desktop to retrieve your billing data, map it to FOCUS v1.3, and generate a standards-compliant cost report, through natural language prompts, without writing scripts or using the billing UI.

## Next steps

Expand your FinOps workflow across more data sources:

* Add invoice reconciliation to your monthly finance review using the [<mark style="color:blue;">FinOps and FOCUS Billing use case guide</mark>](https://docs.ionos.com/cloud/ai/mcp-server/use-cases/finops-focus-billing).
* Identify cost anomalies across the last three months: use `list_billing_invoices_by_period` to compare BilledCost per ServiceCategory and flag services with unexpected growth.
* Combine billing and infrastructure data: get usage by datacenter with `list_billing_usage`, then drill into the highest-cost datacenter using `get_billing_usage_by_datacenter` and Compute Engine tools, all in one conversation.
* Schedule recurring FOCUS exports using Claude Code with a project-scoped `.mcp.json`; no interactive setup required.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ionos.com/cloud/tutorials/ai/mcp-server/focus-billing-finops.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
