datadog mcp
The Datadog MCP Server enables programmatic access to Datadog's API for managing and querying monitoring data:
Monitoring: Access and filter monitor data by status or tags
Dashboards: List all dashboards and retrieve specific dashboard definitions
Metrics: Query available metrics and retrieve detailed metadata
Events: Search for events within specified time ranges
Logs: Search logs with advanced filtering and perform analytical aggregations
Incidents: List and filter incidents from the incident management system
API Integration: Direct integration with Datadog's v1 and v2 APIs with comprehensive error handling
Service-Specific Endpoints: Support for different endpoints for logs and metrics
Provides access to Datadog's monitoring, dashboard, metrics, events, logs, and incident management features through direct API integration. Enables querying monitors, viewing dashboards, retrieving metrics metadata, searching logs with advanced filtering, and managing incidents.
Required as a runtime environment (version 16 or higher) for running the Datadog MCP server, enabling server-side JavaScript execution for API interactions.
Used for package installation and management of the Datadog MCP server, allowing easy global installation via the npm registry.
Click on "Deploy 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 show me the top 5 monitors by alert status"
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 Model Context Protocol (MCP) server for interacting with the Datadog API.
Features
Monitoring: Access monitor data and configurations
Dashboards: Retrieve and view dashboard definitions
Metrics: Query available metrics and their metadata
Events: Search and retrieve events within timeframes
Logs: Search logs with advanced filtering and sorting options
Incidents: Access incident management data
API Integration: Direct integration with Datadog's v1 and v2 APIs
Comprehensive Error Handling: Clear error messages for API and authentication issues
Service-Specific Endpoints: Support for different endpoints for logs and metrics
Related MCP server: ClickHouse Trace-Activity MCP Server
Prerequisites
Node.js (version 16 or higher)
Datadog account with:
API key - Found in Organization Settings > API Keys
Application key - Found in Organization Settings > Application Keys
Application Key Scopes
For improved security, you can scope your Application Key to grant only the minimum permissions required by this MCP server. By default, Application Keys inherit all permissions from the user who created them, but scoped Application Keys allow you to follow the principle of least privilege.
Required Scopes
The following scopes are required for the corresponding features:
Tool(s) | Required Scope | Description |
|
| Read access to monitor configurations and states |
|
| Read access to dashboard definitions |
|
| Read access to metrics list and metadata |
|
| Read access to events from the event stream |
|
| Read access to log data for search and aggregation |
|
| Read access to incident management data |
Creating a Scoped Application Key
Go to Organization Settings > Application Keys
Click New Key
Enter a name (e.g., "MCP Server - Read Only")
Under Scopes, select only the permissions you need:
For full functionality:
monitors_read,dashboards_read,metrics_read,events_read,logs_read_data,incident_readFor logs only:
logs_read_dataFor monitoring only:
monitors_read,dashboards_read,metrics_read
Click Create Key
Note: If you don't specify any scopes when creating an Application Key, it will have full access with all permissions of the creating user. For production use, we recommend always specifying explicit scopes.
Installation
Via npm (recommended)
npm install -g datadog-mcp-serverFrom Source
Clone this repository
Install dependencies:
npm installBuild the project:
npm run build
Configuration
You can configure the Datadog MCP server using either environment variables or command-line arguments.
Environment Variables
Create a .env file with your Datadog credentials:
DD_API_KEY=your_api_key_here
DD_APP_KEY=your_app_key_here
DD_SITE=datadoghq.com
DD_LOGS_SITE=datadoghq.com
DD_METRICS_SITE=datadoghq.comNote: DD_LOGS_SITE and DD_METRICS_SITE are optional and will default to the value of DD_SITE if not specified.
Command-line Arguments
Basic usage with global site setting:
datadog-mcp-server --apiKey=your_api_key --appKey=your_app_key --site=datadoghq.euAdvanced usage with service-specific endpoints:
datadog-mcp-server --apiKey=your_api_key --appKey=your_app_key --site=datadoghq.com --logsSite=logs.datadoghq.com --metricsSite=metrics.datadoghq.comNote: Site arguments don't need https:// - it will be added automatically.
Regional Endpoints
Different Datadog regions have different endpoints:
US (Default):
datadoghq.comEU:
datadoghq.euUS3 (GovCloud):
ddog-gov.comUS5:
us5.datadoghq.comAP1:
ap1.datadoghq.com
Usage with Claude Desktop
Add this to your claude_desktop_config.json:
{
"mcpServers": {
"datadog": {
"command": "npx",
"args": [
"datadog-mcp-server",
"--apiKey",
"<YOUR_API_KEY>",
"--appKey",
"<YOUR_APP_KEY>",
"--site",
"<YOUR_DD_SITE>(e.g us5.datadoghq.com)"
]
}
}
}For more advanced configurations with separate endpoints for logs and metrics:
{
"mcpServers": {
"datadog": {
"command": "npx",
"args": [
"datadog-mcp-server",
"--apiKey",
"<YOUR_API_KEY>",
"--appKey",
"<YOUR_APP_KEY>",
"--site",
"<YOUR_DD_SITE>",
"--logsSite",
"<YOUR_LOGS_SITE>",
"--metricsSite",
"<YOUR_METRICS_SITE>"
]
}
}
}Locations for the Claude Desktop config file:
MacOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%/Claude/claude_desktop_config.json
Usage with MCP Inspector
To use with the MCP Inspector tool:
npx @modelcontextprotocol/inspector datadog-mcp-server --apiKey=your_api_key --appKey=your_app_keyAvailable Tools
The server provides these MCP tools:
get-monitors: Fetch monitors with optional filtering
get-monitor: Get details of a specific monitor by ID
get-dashboards: List all dashboards
get-dashboard: Get a specific dashboard by ID
get-metrics: List available metrics
get-metric-metadata: Get metadata for a specific metric
get-events: Fetch events within a time range
get-incidents: List incidents with optional filtering
search-logs: Search logs with advanced query filtering
aggregate-logs: Perform analytics and aggregations on log data
Examples
Example: Get Monitors
{
"method": "tools/call",
"params": {
"name": "get-monitors",
"arguments": {
"groupStates": ["alert", "warn"],
"limit": 5
}
}
}Example: Get a Dashboard
{
"method": "tools/call",
"params": {
"name": "get-dashboard",
"arguments": {
"dashboardId": "abc-def-123"
}
}
}Example: Search Logs
{
"method": "tools/call",
"params": {
"name": "search-logs",
"arguments": {
"filter": {
"query": "service:web-app status:error",
"from": "now-15m",
"to": "now"
},
"sort": "-timestamp",
"limit": 20
}
}
}Example: Aggregate Logs
{
"method": "tools/call",
"params": {
"name": "aggregate-logs",
"arguments": {
"filter": {
"query": "service:web-app",
"from": "now-1h",
"to": "now"
},
"compute": [
{
"aggregation": "count"
}
],
"groupBy": [
{
"facet": "status",
"limit": 10,
"sort": {
"aggregation": "count",
"order": "desc"
}
}
]
}
}
}Example: Get Incidents
{
"method": "tools/call",
"params": {
"name": "get-incidents",
"arguments": {
"includeArchived": false,
"query": "state:active",
"pageSize": 10
}
}
}Troubleshooting
If you encounter a 403 Forbidden error, verify that:
Your API key and Application key are correct
The keys have the necessary permissions to access the requested resources
Your account has access to the requested data
You're using the correct endpoint for your region (e.g.,
datadoghq.eufor EU customers)
Debugging
If you encounter issues, check Claude Desktop's MCP logs:
# On macOS
tail -n 20 -f ~/Library/Logs/Claude/mcp*.log
# On Windows
Get-Content -Path "$env:APPDATA\Claude\Logs\mcp*.log" -Tail 20 -WaitCommon issues:
403 Forbidden: Authentication issue with Datadog API keys
API key or App key format invalid: Ensure you're using the full key strings
Site configuration errors: Make sure you're using the correct Datadog domain
Endpoint mismatches: Verify that service-specific endpoints are correctly set if you're using separate domains for logs and metrics
License
MIT
Available Tools
10 toolsaggregate-logsB
Perform analytical queries and aggregations on log data. Essential for calculating metrics (count, avg, sum, etc.), grouping data by fields, and creating statistical summaries from logs. Use this when you need to analyze patterns or extract metrics from log data.
Inputs: filter, compute, groupBy, options.
get-dashboardA
Get the complete definition of a specific Datadog dashboard by its ID. Returns all widgets, layout, and configuration details.
Inputs: dashboardId (required).
get-dashboardsC
Retrieve a list of all dashboards from Datadog. Useful for discovering available dashboards and their IDs for further exploration.
Inputs: filterConfigured, limit.
get-eventsC
Search for events in Datadog within a specified time range. Events include deployments, alerts, comments, and other activities. Useful for correlating system behaviors with specific events.
Inputs: start (required), end (required), priority, sources, +4 more.
get-incidentsC
List incidents from Datadog's incident management system. Can filter by active/archived status and use query strings to find specific incidents. Helpful for reviewing current or past incidents.
Inputs: includeArchived, pageSize, pageOffset, query, +1 more.
get-metric-metadataB
Retrieve detailed metadata about a specific metric, including its type, description, unit, and other attributes. Use this to understand a metric's meaning and proper usage.
Inputs: metricName (required).
get-metricsB
List available metrics from Datadog. Optionally use the q parameter to search for specific metrics matching a pattern. Helpful for discovering metrics to use in monitors or dashboards.
Inputs: q.
get-monitorB
Get detailed information about a specific Datadog monitor by its ID. Use this to retrieve the complete configuration, status, and other details of a single monitor.
Inputs: monitorId (required).
get-monitorsB
Fetch monitors from Datadog with optional filtering. Use groupStates to filter by monitor status (e.g., 'alert', 'warn', 'no data'), tags or monitorTags to filter by tag criteria, and limit to control result size.
Inputs: groupStates, tags, monitorTags, limit.
search-logsB
Search logs in Datadog with advanced filtering options. Use filter.query for search terms (e.g., 'service:web-app status:error'), from/to for time ranges (e.g., 'now-15m', 'now'), and sort to order results. Essential for investigating application issues.
Inputs: filter, sort, page, limit.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Each tool has a clearly distinct purpose targeting specific Datadog resources: logs (aggregate-logs, search-logs), dashboards (get-dashboard, get-dashboards), events (get-events), incidents (get-incidents), metrics (get-metric-metadata, get-metrics), and monitors (get-monitor, get-monitors). There is no overlap in functionality, and the descriptions clearly differentiate between analytical queries, retrieval operations, and search capabilities.
All tool names follow a consistent verb-noun pattern with hyphens, using 'get-' for retrieval operations (e.g., get-dashboard, get-metrics) and descriptive prefixes for other actions (e.g., aggregate-logs, search-logs). This uniformity makes the tool set predictable and easy to navigate, with no deviations in naming conventions.
With 10 tools, the server is well-scoped for a Datadog integration, covering key areas like logs, dashboards, events, incidents, metrics, and monitors. Each tool serves a distinct and necessary function, avoiding redundancy while providing comprehensive access to core Datadog features without being overwhelming.
The tool set offers strong read-only coverage for Datadog's core resources, including retrieval and search operations. However, it lacks write operations (e.g., create, update, delete) for dashboards, monitors, or incidents, which could limit agents in full lifecycle management. Minor gaps exist, but agents can still perform essential monitoring and analysis tasks effectively.
Maintenance
Related MCP Connectors
Blockchain intelligence for tracing funds, screening addresses, and investigating on-chain activity.
Gain visibility into the performance, availability, and health of your apps and infrastructure.
Track errors, manage performance alerts, and configure dashboards and monitors
Monitor, troubleshoot, and optimize your technology stack with Intelligent Observability.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceMCP server for tracing, logging, and debugging multi-agent systems by capturing sessions, spans, and events in a queryable trace tree.1MIT
- AlicenseNot gradedqualityDmaintenanceTracks a user's activity by trace ID from application logs stored in ClickHouse. Provides tools for log timeline, trace summaries, and search across services.78 npmMIT
- AlicenseNot gradedqualityDmaintenanceProvides unified AI agent observability including tracing, cost tracking, performance monitoring, anomaly detection, and audit trails via MCP.56 npmMIT
- AlicenseNot gradedqualityDmaintenanceMCP server for writing structured traces, spans, and decisions, enabling observability and EU AI Act traceability compliance for AI agent tasks.45 npmMIT