MCP server for Datadog billable usage and cost analysis.
Project description
Datadog Cost Analyze Agent
MCP server for end-to-end Datadog billable usage and cost analysis.
The server exposes one MCP tool:
generate_full_cost_report
This tool runs the full workflow in one call:
- Fetch billable summary from Datadog
- Calculate org-level on-demand and committed allocation
- Generate CSV reports
- Calculate cost report
- Return report content as text in the MCP response
Requirements
- Python 3.10+
- Datadog credentials with
usage_readpermission:DD_API_KEYDD_APP_KEYDD_SITE(optional, defaults todatadoghq.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
generate_full_cost_report
Arguments
month(string, required): Month inYYYY-MMformat.
Returns
ok(boolean): Success statusmessage(string): Execution summarymonth(string): Month used for the runusage_org_count(number): Organization count in usage payloadfinal_cost_report_text(string): Final cost CSV contentdetailed_report_text(string): Detailed usage CSV contentorg_summary_report_text(string): Organization summary CSV contentproduct_summary_report_text(string): Product summary CSV contenterror(string): Present whenokisfalse
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:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file datadog_cost_analyze_agent_mcp-0.1.0.tar.gz.
File metadata
- Download URL: datadog_cost_analyze_agent_mcp-0.1.0.tar.gz
- Upload date:
- Size: 11.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1764e9c9b3c7d682b162fc489a1df65ec4cda9058dc57180f903e3db5f3a266a
|
|
| MD5 |
0c0f9cc18a253692e69ca68a44b88343
|
|
| BLAKE2b-256 |
7b97fa300da2b6e449e605ec7c574a527ae88c30bb89787e0a20dd116f45166d
|
File details
Details for the file datadog_cost_analyze_agent_mcp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: datadog_cost_analyze_agent_mcp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d01412a207a672c172645e81e39515c4a23dd56905b56b8067abcde6c355fbbf
|
|
| MD5 |
9188a3126918d94f3d89f445fc761393
|
|
| BLAKE2b-256 |
59d390f0e9ccfe6d85a18dc2cd634304fc41df7f4f64ad5913ccd7cf1a692700
|