Skip to main content

Datadog Cost Analyze Agent

MCP server for end-to-end Datadog billable usage and cost analysis.

The server exposes one MCP tool:

  • datadog_generate_full_cost_report

This tool runs the full workflow in one call:

  1. Fetch billable summary from Datadog
  2. Calculate org-level on-demand and committed allocation
  3. Generate CSV reports
  4. Calculate cost report
  5. Return report content as text in the MCP response

Requirements

  • Python 3.10+
  • Datadog credentials with usage_read permission:
    • DD_API_KEY
    • DD_APP_KEY
    • DD_SITE (optional, defaults to datadoghq.eu)

Install

python3 -m venv .venv
.venv/bin/python -m pip install -r requirements.txt

Publish to PyPI

Package metadata is configured in pyproject.toml. Current package/command names:

  • Package: datadog-cost-analyze-agent-mcp
  • CLI entrypoint: datadog-cost-analyze-mcp

1) Build distribution files

.venv/bin/python -m pip install --upgrade build twine
.venv/bin/python -m build

This creates:

  • dist/*.tar.gz (source distribution)
  • dist/*.whl (wheel)

2) Validate package metadata

.venv/bin/python -m twine check dist/*

3) Upload to TestPyPI (recommended first)

.venv/bin/python -m twine upload --repository testpypi dist/*

4) Upload to PyPI

.venv/bin/python -m twine upload dist/*

5) Verify install from PyPI

python3 -m pip install <your-package-name>

Use API tokens for authentication:

  • TWINE_USERNAME=__token__
  • TWINE_PASSWORD=<pypi-token>

Run with uvx

After publishing to PyPI:

uvx --from datadog-cost-analyze-agent-mcp datadog-cost-analyze-mcp

For local testing before publish:

uvx --from . datadog-cost-analyze-mcp

Run MCP Server

.venv/bin/python mcp_server.py

MCP Tool

datadog_generate_full_cost_report

Arguments

  • month (string, required): Month in YYYY-MM format.

Returns

  • ok (boolean): Success status
  • message (string): Execution summary
  • month (string): Month used for the run
  • usage_org_count (number): Organization count in usage payload
  • final_cost_report_text (string): Final cost CSV content
  • detailed_report_text (string): Detailed usage CSV content
  • org_summary_report_text (string): Organization summary CSV content
  • product_summary_report_text (string): Product summary CSV content
  • error (string): Present when ok is false

Generated Files

The workflow also writes default files to .out/:

  • .out/billable_summary.json
  • .out/billable_detailed_report.csv
  • .out/billable_org_summary.csv
  • .out/billable_product_summary.csv
  • .out/datadog_cost_report.csv

Example MCP Client Config

Using uvx (recommended after publish)

{
  "mcpServers": {
    "datadog-cost-analyze": {
      "command": "uvx",
      "args": ["--from", "datadog-cost-analyze-agent-mcp", "datadog-cost-analyze-mcp"],
      "env": {
        "DD_API_KEY": "your_api_key",
        "DD_APP_KEY": "your_app_key",
        "DD_SITE": "datadoghq.eu"
      }
    }
  }
}

Using local Python directly

{
  "mcpServers": {
    "datadog-cost-analyze": {
      "command": "/absolute/path/to/.venv/bin/python",
      "args": ["/absolute/path/to/mcp_server.py"],
      "env": {
        "DD_API_KEY": "your_api_key",
        "DD_APP_KEY": "your_app_key",
        "DD_SITE": "datadoghq.eu"
      }
    }
  }
}

Pricing Source

Cost calculations are based on Datadog pricing:

Release files for datadog-cost-analyze-agent-mcp 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for datadog-cost-analyze-agent-mcp 0.1.2
File Size Uploaded
datadog_cost_analyze_agent_mcp-0.1.2.tar.gz 11.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for datadog-cost-analyze-agent-mcp 0.1.2
File Interpreter ABI Platform
datadog_cost_analyze_agent_mcp-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 25.3 kB

Release files / datadog_cost_analyze_agent_mcp-0.1.2.tar.gz

Download URL datadog_cost_analyze_agent_mcp-0.1.2.tar.gz
Size 11.4 kB
Tags Source
SHA-256 checksum
How to use checksums
1f22159fdcdfcd84e7a57748c31e860a3cafb2de56c45f77dbf946cb3e9cd837
BLAKE2b-256 checksum
How to use checksums
ab50699a07143ace92baea312b12bd022f3b82fd2a8000fec666234591c982df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release files / datadog_cost_analyze_agent_mcp-0.1.2-py3-none-any.whl

Download URL datadog_cost_analyze_agent_mcp-0.1.2-py3-none-any.whl
Size 13.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dc5317bead7dced80d6f5ae4710eb19031dbb2e7960af9204b3fb231cab15363
BLAKE2b-256 checksum
How to use checksums
9e81a4c9e701a4ccd081fec682e1812fd17efce742e4dc40e9fa86aae79996dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page