Purpose
Datadog MCP Server provides AI assistants with full access to the Datadog observability platform, enabling AI to directly query data such as logs, traces, metrics, events, monitors, RUM, and SLOs during a conversation.
Main capabilities
- grep-like log search.
- APM trace filtering, supporting queries by duration, status, and error conditions.
- Smart sampling modes (sample: "diverse" | "spread" | "first"), used to improve token efficiency.
- Cross-correlation between logs, traces, and metrics.
- Every query response includes a datadog_url field generated according to the configured DD_SITE, supporting datadoghq.com (default), .eu, us3/us5/ap1.datadoghq.com, and ddog-gov.com, for logs, metrics, traces, events, monitors, rum, slos.
Usage
Supports both stdio (local) and http (remote/Kubernetes) transports, selected via --transport=http or MCP_TRANSPORT=http. When configuring Claude Desktop / VS Code / Cursor, only two required keys are needed, and you can optionally configure the EU site, custom default limits, a longer log window, etc. Transport configuration should use environment variables rather than container arguments, because Kubernetes args replace the entire Dockerfile CMD, causing Node.js to receive these flags.
Required environment variables
The material lists a "Required environment variables" section, but does not provide the specific variable names and values.
Optional environment variables
The material lists an "Optional environment variables" section, but does not provide the specific variable names and values.
The AI assistant has full control over query limits. The MCP_DEFAULT_* environment variables only set the fallback values used when the AI does not specify a limit, and do not restrict the upper bound the AI can request. Tool-level token reduction features (compact: true for logs, sample: "diverse" | "spread" | "first", field projection, diagnostics) are presented in each tool's MCP description and selected by the AI at call time.
Notable behavior
- Renotifies vs. actual triggers: monitors top and events search with source:alert count every renotify sent by Datadog (once per renotify_interval while the monitor is in Alert). To get actual state transitions, use monitors history (default transitionType: ["alert","alert recovery"]) or pass transitionType to events search.
- Daylight saving time-safe time bucketing: events histogram buckets by hour_of_day / day_of_week / day_of_month in any IANA time zone via Intl.DateTimeFormat, the underlying search uses cursor pagination, the upper limit is controlled by MCP_MAX_EVENTS_HISTOGRAM (default 5000), and on overflow it returns bucketCountIncomplete + nextCursor.
- Validate before creating: monitors create with dry_run: true calls /api/v1/monitor/validate instead of persisting, and is also allowed in --read-only mode.
- Monitor template preview: monitors preview renders notifications against a context payload, supporting variable substitution, Datadog's six documented conditions (is_alert, is_warning, is_no_data, is_recovery, is_alert_to_warning, is_warning_to_alert), and tag conditions {{#is_match "tag" "val"}} (substring) and {{#is_exact_match "tag" "val"}} (exact), supporting ^ negation and OR of multiple comparison values (resolved based on context.variables, case-sensitive). {{#each}} and partials will throw EUNSUPPORTED_TEMPLATE_SYNTAX.
- SLO round-trip: slos get projects query, monitorIds, monitorTags, groups, and the UI url, making it easy to backfill into slos update after editing without losing definition fields.
- Cross-correlation: logs(sample:"diverse") → extract dd.trace_id → traces(query:"trace_id:<id>") → metrics(query:"p95:trace.express.request{service:...}") (percentiles use the root metric without .duration).
Use cases
Suitable for development and operations scenarios that require querying and troubleshooting Datadog observability data through an AI assistant, including log retrieval, trace analysis, metric queries, monitor and SLO management, and remote deployment in local or Kubernetes environments.
Limitations
This project is community-maintained and has no official affiliation, endorsement, or support relationship with Datadog, Inc.; it is independently developed based on the Datadog API. The materials do not provide specific required/optional environment variable names and values, installation commands, or usage examples; this content is not yet available.