DA

Datadog MCP Server for Tracing, Dashboards and Incidents

Monitor application traces, dashboards, and incidents with a Datadog MCP server using the official Datadog API for real-time observability.

Quick Install
npx -y @GeLi2001/datadog-mcp-server

Overview

The Datadog MCP Server provides a bridge between Datadog and model-driven agents using the Model Context Protocol (MCP). It exposes Datadog data (traces, dashboards, incidents) through a small HTTP service that implements MCP-compatible tool endpoints so large language models and agent frameworks can request observability context in real time. This enables LLMs to include live application telemetry in responses, troubleshooting steps, and incident summaries.

Built on top of the official Datadog API, the server centralizes API keys, request shaping, and basic caching/authorization for safe automated access. For developer teams building conversational runbooks, automated incident responders, or observability assistants, the project reduces the friction of integrating Datadog into LLM workflows.

Features

  • Exposes Datadog traces, dashboards, and incident data through MCP-style tool endpoints
  • Uses official Datadog API for authoritative telemetry
  • Simple auth via Datadog API & Application keys (environment based)
  • Lightweight HTTP service suitable for local development or container deployment
  • Optional caching and request parameter validation to protect rate limits
  • Returns structured JSON that is easy for LLMs and agents to consume

Installation / Configuration

Prerequisites:

  • Node.js (>=14) or Docker
  • A Datadog API key and Application key (or equivalent API credentials)

Clone and run locally with npm:

git clone https://github.com/GeLi2001/datadog-mcp-server.git
cd datadog-mcp-server
npm install

Create a .env file with your Datadog credentials and server settings:

# .env
DATADOG_API_KEY=your_datadog_api_key
DATADOG_APP_KEY=your_datadog_app_key
PORT=8080
CACHE_TTL=60          # optional, seconds
LOG_LEVEL=info

Start the server:

npm start
# or, for development
npm run dev

Run with Docker:

# build
docker build -t datadog-mcp-server .

# run (example)
docker run -e DATADOG_API_KEY=... -e DATADOG_APP_KEY=... -p 8080:8080 datadog-mcp-server

Configuration notes:

  • Use least-privilege Datadog keys for production (read-only where possible).
  • Configure network egress to allow calls to api.datadoghq.com (or your Datadog region endpoint).
  • Tune CACHE_TTL to balance freshness and Datadog rate limits.

Available Tools / Resources

The server exposes a small set of MCP-style resources to be consumed by LLMs or orchestration systems. Typical endpoints include:

ToolHTTP PathMethodPurpose
Traces/tools/tracesGETQuery recent traces by service, span, or timeframe
Dashboards/tools/dashboardsGETRetrieve dashboard metadata and widgets
Dashboard JSON/tools/dashboards/:id/jsonGETFetch full dashboard definition
Incidents/tools/incidentsGETList or filter incidents by status or time
Incident Details/tools/incidents/:idGETGet incident timeline and related alerts

Example: fetch traces for service “web”:

curl "http://localhost:8080/tools/traces?service=web&from=3600" \
  -H "Accept: application/json"

The server translates these requests into Datadog API calls and returns structured JSON suitable for language models or downstream systems.

Use Cases

  • On-demand incident summaries: An LLM agent can call /tools/incidents to gather the latest incident state, then synthesize a human-readable summary for an on-call engineer or Slack channel.
  • Guided troubleshooting: When a user asks why an endpoint is slow, the assistant queries /tools/traces for the relevant service/time window, inspects spans for errors or latency, and suggests targeted remediation steps.
  • Dashboard-aware responses: Agents retrieving dashboard metadata can reference current widget values or graphs in reports, enabling conversational interfaces that answer “How are our payments metrics right now?” with live context.
  • Automated post-mortem data collection: After an incident, a runbook bot can collect related dashboards, traces, and incident timelines via the MCP server and produce a consistent archive for analysis.

Example integration snippet

A minimal snippet showing how an agent could call the MCP server from JavaScript:

const fetch = require('node-fetch');

async function getServiceTraces(service) {
  const res = await fetch(`http://localhost:8080/tools/traces?service=${encodeURIComponent(service)}&from=3600`);
  if (!res.ok) throw new Error(`failed: ${res.status}`);
  return res.json();
}

getServiceTraces('web').then(data => console.log(data)).catch(console.error);

Further notes

  • This server is intended as an adapter layer—not a replacement for Datadog. It forwards queries to the official API and returns JSON with simplified shapes for model consumption.
  • Secure deployment is important: protect the server endpoints and avoid exposing Datadog keys to untrusted models or external agents.
  • Visit the project repository for source, issues, and contribution guidelines: https://github.com/GeLi2001/datadog-mcp-server.