Datadog MCP Server
Provides full CRUD operations across Datadog APIs, including metrics, dashboards, monitors, logs, incidents, SLOs, and more, for managing and monitoring cloud infrastructure and applications.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Datadog MCP Serverlist my monitors"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Datadog MCP Server
A comprehensive Model Context Protocol (MCP) server for Datadog integration, providing full CRUD access to Datadog APIs with modern async patterns. Built with the official Datadog Python SDK and MCP Python SDK.
🚀 Features
🔧 Full CRUD operations - Create, read, update, delete across all supported APIs
⚡ Async operations - Built with AsyncApiClient for optimal performance
🔄 Automatic retries - Rate limiting and error handling with exponential backoff
📊 Comprehensive coverage - 31 tools across all major Datadog APIs
💾 Local caching - Results stored as timestamped JSON files
🔒 Type-safe - Full type hints and Pydantic models
📈 Built-in analysis - Statistical analysis, trend detection, and data summarization
🛡️ Security-first - Environment-based credential management
📋 Prerequisites
Python 3.8+
Valid Datadog API and Application keys
MCP-compatible client (VS Code, Cursor, Claude Desktop, etc.)
Quick Start
# Install dependencies
pip install -r requirements.txt
# Set environment variables
export DATADOG_API_KEY="your_api_key"
export DATADOG_APP_KEY="your_app_key"
export DATADOG_SITE="datadoghq.com" # Optional
# Run the server
python server.pyMCP Client Integration
VS Code with Continue
Install the Continue extension in VS Code
Add to your Continue config (
~/.continue/config.json):
{
"mcpServers": {
"datadog": {
"command": "python",
"args": ["/path/to/datadog-mcp-python/server.py"],
"env": {
"DATADOG_API_KEY": "your_api_key",
"DATADOG_APP_KEY": "your_app_key"
}
}
}
}Cursor
Open Cursor settings
Add MCP server configuration:
{
"mcp.servers": {
"datadog": {
"command": "python",
"args": ["/path/to/datadog-mcp-python/server.py"],
"env": {
"DATADOG_API_KEY": "your_api_key",
"DATADOG_APP_KEY": "your_app_key"
}
}
}
}Amazon Q Developer
Configure in your Q Developer settings:
{
"mcpServers": {
"datadog-mcp": {
"command": "python3",
"args": ["/path/to/datadog-mcp-python/server.py"],
"env": {
"DATADOG_API_KEY": "your_api_key",
"DATADOG_APP_KEY": "your_app_key",
"FASTMCP_LOG_LEVEL": "ERROR"
},
"disabled": false,
"autoApprove": []
}
}
}Claude Desktop
Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"datadog": {
"command": "python",
"args": ["/path/to/datadog-mcp-python/server.py"],
"env": {
"DATADOG_API_KEY": "your_api_key",
"DATADOG_APP_KEY": "your_app_key"
}
}
}
}Gemini CLI
Install Gemini CLI with MCP support
Configure the server:
gemini mcp add datadog python /path/to/datadog-mcp-python/server.py \
--env DATADOG_API_KEY=your_api_key \
--env DATADOG_APP_KEY=your_app_keyGeneric MCP Client
For any MCP-compatible client, use these connection details:
Transport: stdio
Command:
python server.pyWorking Directory:
/path/to/datadog-mcp-python/Environment Variables:
DATADOG_API_KEY,DATADOG_APP_KEY
Available Tools (31 Total)
Metrics & Monitoring (9 tools)
validate_api_key- Test API credentialsget_metrics- Query time series datasearch_metrics- Find metrics by patternget_metric_metadata- Get metric metadataget_monitors- List monitoring alertsget_monitor- Get specific monitor detailscreate_monitor- Create new monitoring alertsupdate_monitor- Update existing monitorsdelete_monitor- Delete monitors
Dashboards & Visualization (5 tools)
get_dashboards- List all dashboardsget_dashboard- Get dashboard detailscreate_dashboard- Create new dashboardsupdate_dashboard- Update existing dashboardsdelete_dashboard- Delete dashboards
Logs & Events (2 tools)
search_logs- Search log entriesget_events- Get system events
Infrastructure & Tags (5 tools)
get_infrastructure- Get host informationget_service_map- Get service dependenciesget_tags- Get host tagsget_downtimes- Get scheduled downtimescreate_downtime- Create scheduled downtimes
Testing & Applications (2 tools)
get_synthetics_tests- Get synthetic testsget_rum_applications- Get RUM applications
Security & Incidents (4 tools)
get_security_rules- Get security monitoring rulesget_incidents- Get incident data (with pagination)get_slos- Get Service Level Objectivesget_notebooks- Get Datadog notebooks
Teams & Users (2 tools)
get_teams- Get teamsget_users- Get users
Utilities (2 tools)
analyze_data- Analyze cached datacleanup_cache- Clean old cache files
Usage Examples
Once connected to an MCP client, you can use natural language to interact with Datadog:
Monitoring Examples
"Show me all monitors that are currently alerting"
"Create a monitor for high CPU usage above 80%"
"Get metrics for system.cpu.user over the last hour"
"Search for all memory-related metrics"
Dashboard Examples
"List all my dashboards"
"Create a new dashboard for system monitoring"
"Show me the widgets in my main dashboard"
Infrastructure Examples
"Show me all hosts and their status"
"Get the service map for my application"
"List all tags for production hosts"
Incident Management
"Show me all active incidents"
"Get the latest security monitoring rules"
"List all SLOs and their current status"
Configuration
The server uses the latest Datadog API client with:
AsyncApiClient for non-blocking operations
Automatic retry on rate limits (429 errors)
3 retry attempts with exponential backoff
Unstable operations enabled for pagination
🏗️ Architecture
Core Components
DatadogMCPServer: Main server class with API client management
DatadogConfig: Pydantic model for configuration validation
Tool Handlers: Individual async functions for each API endpoint
Data Storage: Automatic JSON file caching with timestamps
Analysis Engine: Built-in data analysis capabilities
Data Flow
Request: MCP client calls tool with parameters
API Call: Server makes authenticated request to Datadog API
Storage: Response data is cached to local JSON file
Analysis: Optional built-in analysis of the data
Response: Summary and file path returned to client
📈 Performance
Async Implementation
All API calls are asynchronous
Non-blocking file I/O operations
Efficient memory usage for large datasets
Rate Limiting
Respects Datadog API rate limits
Automatic retry logic with exponential backoff
Efficient batching for bulk operations
Example Code Usage
# Create a monitor
create_monitor(
name="High CPU Usage",
monitor_type="metric alert",
query="avg(last_5m):avg:system.cpu.user{*} > 0.8",
message="CPU usage is high @slack-alerts"
)
# Create a dashboard
create_dashboard(
title="System Overview",
layout_type="ordered",
widgets=[{
"definition": {
"type": "timeseries",
"requests": [{"q": "avg:system.cpu.user{*}"}]
}
}]
)
# Schedule downtime
create_downtime(
scope=["host:web-server-01"],
start=1640995200,
end=1640998800,
message="Scheduled maintenance"
)Security & Features
Full CRUD operations - Complete create, read, update, delete support
Write operations enabled - All mutation tools available
Local data caching - All results stored locally as JSON files
Error handling - Comprehensive exception management
Pagination support - Handle large datasets efficiently
Type safety - Full type hints throughout
Rate limiting - Automatic retry on API limits
Development
Setup
# Install development dependencies
pip install -r requirements.txt
pip install pytest pytest-cov black flake8 mypy
# Format code
black server.py
flake8 server.py --max-line-length=88
# Run tests
cd tests && python -m pytest --cov=../serverAdding New Tools
Add new method to
DatadogMCPServerclassDecorate with
@self.mcp.tool()Implement proper error handling and data storage
Add tests and update documentation
Troubleshooting
Common Issues
Authentication Error: Verify your
DATADOG_API_KEYandDATADOG_APP_KEYare correctConnection Issues: Ensure the server is running and accessible
Permission Errors: Check that your API keys have the necessary permissions
Rate Limiting: The server automatically handles rate limits with retries
Debug Mode
Enable debug logging by setting:
export DATADOG_DEBUG=trueLicense
MIT License - see LICENSE file for details.
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/ppandrangi/datadog-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server