Datadog MCP Server
The Datadog MCP Server enables interaction with the Datadog API for log and trace span management:
Log Search: Search and retrieve logs with filters for query, time range, and pagination.
Trace Span Search: Search for distributed trace spans with similar filtering options and pagination support.
Trace Span Aggregation: Aggregate trace spans by dimensions like service, resource_name, or status, with methods including count, avg, sum, min, max, and pct, across specified time intervals.
Enables log search, trace span search, and trace span aggregation functionalities through the Datadog API, allowing users to retrieve and analyze logs and distributed trace data with flexible query and aggregation options.
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 Server search logs from the last hour for errors in the payment service"
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
MCP Server for Datadog API, enabling log search, trace span search, and trace span aggregation functionalities.
Features
Log Search: Search and retrieve logs from Datadog with flexible query options
Trace Span Search: Search for distributed trace spans with various filtering options
Trace Span Aggregation: Aggregate trace spans by different dimensions for analysis
Related MCP server: Datadog MCP Server
Tools
search_logsSearch for logs in Datadog
Inputs:
filterQuery(optional string): Query string to search logs (default: "*")filterFrom(optional number): Search start time as UNIX timestamp in seconds (default: 15 minutes ago)filterTo(optional number): Search end time as UNIX timestamp in seconds (default: current time)pageLimit(optional number): Maximum number of logs to retrieve (default: 25, max: 1000)pageCursor(optional string): Pagination cursor for retrieving additional results
Returns: Formatted text containing:
Search conditions (query and time range)
Number of logs found
Next page cursor (if available)
Log details including:
Service name
Tags
Timestamp
Status
Message (truncated to 300 characters)
Host
Important attributes (http.method, http.url, http.status_code, error)
search_spansSearch for trace spans in Datadog
Inputs:
filterQuery(optional string): Query string to search spans (default: "*")filterFrom(optional number): Search start time as UNIX timestamp in seconds (default: 15 minutes ago)filterTo(optional number): Search end time as UNIX timestamp in seconds (default: current time)pageLimit(optional number): Maximum number of spans to retrieve (default: 25, max: 1000)pageCursor(optional string): Pagination cursor for retrieving additional results
Returns: Formatted text containing:
Search conditions (query and time range)
Number of spans found
Next page cursor (if available)
Span details including:
Service name
Timestamp
Resource name
Duration (in seconds)
Host
Environment
Type
Important attributes (http.method, http.url, http.status_code, error)
aggregate_spansAggregate trace spans in Datadog by specified dimensions
Inputs:
filterQuery(optional string): Query string to filter spans for aggregation (default: "*")filterFrom(optional number): Start time as UNIX timestamp in seconds (default: 15 minutes ago)filterTo(optional number): End time as UNIX timestamp in seconds (default: current time)groupBy(optional string[]): Dimensions to group by (e.g., ["service", "resource_name", "status"])aggregation(optional string): Aggregation method - "count", "avg", "sum", "min", "max", "pct" (default: "count")interval(optional string): Time interval for time series data (only when type is "timeseries")type(optional string): Result type, either "timeseries" or "total" (default: "timeseries")
Returns: Formatted text containing:
Aggregation results in buckets, each including:
Bucket ID
Group by values (if groupBy is specified)
Computed values based on the aggregation method
Additional metadata:
Processing time (elapsed)
Request ID
Status
Warnings (if any)
Setup
You need to set up Datadog API and application keys:
Get your API key and application key from the Datadog API Keys page
Install dependencies in the datadog-mcp project:
npm install # or pnpm installBuild the TypeScript project:
npm run build # or pnpm run build
Docker Setup
You can build using Docker with the following command:
docker build -t datadog-mcp .Usage with Claude Desktop
To use this with Claude Desktop, add the following to your claude_desktop_config.json:
{
"mcpServers": {
"datadog": {
"command": "node",
"args": [
"/path/to/datadog-mcp/build/index.js"
],
"env": {
"DD_API_KEY": "<YOUR_DATADOG_API_KEY>",
"DD_APP_KEY": "<YOUR_DATADOG_APP_KEY>"
}
}
}
}If you're using Docker, you can configure it like this:
{
"mcpServers": {
"datadog": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"DD_API_KEY",
"-e",
"DD_APP_KEY",
"datadog-mcp"
],
"env": {
"DD_API_KEY": "<YOUR_DATADOG_API_KEY>",
"DD_APP_KEY": "<YOUR_DATADOG_APP_KEY>"
}
}
}
}Usage with VS Code
For quick installation in VS Code, configure your settings:
Open User Settings (JSON) in VS Code (
Ctrl+Shift+P→Preferences: Open User Settings (JSON))Add the following configuration:
{
"mcp": {
"servers": {
"datadog": {
"command": "node",
"args": [
"/path/to/datadog-mcp/build/index.js"
],
"env": {
"DD_API_KEY": "<YOUR_DATADOG_API_KEY>",
"DD_APP_KEY": "<YOUR_DATADOG_APP_KEY>"
}
}
}
}
}If you're using Docker, you can configure it like this:
{
"mcp": {
"servers": {
"datadog": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"DD_API_KEY",
"-e",
"DD_APP_KEY",
"datadog-mcp"
],
"env": {
"DD_API_KEY": "<YOUR_DATADOG_API_KEY>",
"DD_APP_KEY": "<YOUR_DATADOG_APP_KEY>"
}
}
}
}
}Alternatively, you can add this to a .vscode/mcp.json file in your workspace (without the mcp key):
{
"servers": {
"datadog": {
"command": "node",
"args": [
"/path/to/datadog-mcp/build/index.js"
],
"env": {
"DD_API_KEY": "<YOUR_DATADOG_API_KEY>",
"DD_APP_KEY": "<YOUR_DATADOG_APP_KEY>"
}
}
}
}If you're using Docker, you can configure it like this:
{
"servers": {
"datadog": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"DD_API_KEY",
"-e",
"DD_APP_KEY",
"datadog-mcp"
],
"env": {
"DD_API_KEY": "<YOUR_DATADOG_API_KEY>",
"DD_APP_KEY": "<YOUR_DATADOG_APP_KEY>"
}
}
}
}Available Tools
3 toolsaggregate_spansC
Tool for aggregating Datadog trace spans
Inputs: filterQuery, filterFrom, filterTo, groupBy, +2 more.
search_logsC
Tool for searching Datadog logs
Inputs: filterQuery, filterFrom, filterTo, pageLimit, +1 more.
search_spansC
Tool for searching Datadog trace spans
Inputs: filterQuery, filterFrom, filterTo, pageLimit, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
The three tools are mostly distinct, with 'aggregate_spans' focusing on aggregation of trace data, 'search_logs' targeting log data, and 'search_spans' targeting trace data. However, 'aggregate_spans' and 'search_spans' both operate on spans and could be confused for overlapping purposes, though their descriptions clarify one aggregates and the other searches.
All tool names follow a consistent verb_noun pattern with snake_case, using 'aggregate' and 'search' as verbs paired with specific nouns like 'spans' and 'logs'. There are no deviations in naming style or convention.
With only 3 tools, the server feels thin for a Datadog integration, which typically involves monitoring, metrics, dashboards, and alerts. While the tools cover traces and logs, the scope is limited, making it borderline appropriate for the apparent domain.
The tool surface has significant gaps for a Datadog server, missing core operations like querying metrics, managing dashboards, setting alerts, or accessing APM data beyond spans. Agents will struggle with incomplete coverage for common monitoring workflows.
Maintenance
Related MCP Connectors
Query your app's logs, metrics and incidents from your AI assistant.
Manage uptime monitors and incidents and search logs, metrics and traces from an AI assistant.
Open-source agent that observes and fixes your application. Query logs, traces, metrics, incidents.
Investigate errors, track deployments, analyze performance, and manage application monitoring
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables monitoring and querying of Datadog metrics for Kubernetes clusters, APM traces, infrastructure hosts, and databases through a unified interface.8 npm-
- AlicenseBqualityDmaintenanceEnables interaction with Datadog's monitoring and observability platform through the MCP protocol. Supports incident management, monitor status checks, log searches, metrics queries, APM traces, dashboard access, RUM analytics, host management, and downtime scheduling.1327 npmApache 2.0
- FlicenseBqualityDmaintenanceEnables AI assistants to interact with Datadog APIs for querying metrics, logs, events, monitors, and APM traces.164-
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with Datadog's observability platform via natural language, covering metrics, logs, APM, monitors, dashboards, incidents, and infrastructure.2,087 npm1MIT