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.
npx -y @GeLi2001/datadog-mcp-serverOverview
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:
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:
# or, for development
Run with Docker:
# build
# run (example)
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:
| Tool | HTTP Path | Method | Purpose |
|---|---|---|---|
| Traces | /tools/traces | GET | Query recent traces by service, span, or timeframe |
| Dashboards | /tools/dashboards | GET | Retrieve dashboard metadata and widgets |
| Dashboard JSON | /tools/dashboards/:id/json | GET | Fetch full dashboard definition |
| Incidents | /tools/incidents | GET | List or filter incidents by status or time |
| Incident Details | /tools/incidents/:id | GET | Get incident timeline and related alerts |
Example: fetch traces for service “web”:
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:
;
'web'dataconsole.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.