npm package: @fazorboy/datadog-mcp-server
Description: MCP server for Datadog — metric queries, log search, APM traces, monitor management, dashboard analysis
Latest version: 0.1.0

<p align="center">
  <img src="../../logo.svg" width="128" height="128" alt="Datadog MCP Server" />
</p>

# Datadog MCP Server

MCP server providing 16 tools for interacting with Datadog's observability platform.

## Client Configuration

### VS Code / GitHub Copilot

Add to `.vscode/mcp.json`:

```json
{
  "servers": {
    "datadog": {
      "command": "npx",
      "args": ["-y", "@fazorboy/datadog-mcp-server"],
      "env": {
        "datadog_DD_API_KEY": "${input:datadogApiKey}",
        "datadog_DD_APP_KEY": "${input:datadogAppKey}",
        "datadog_DD_SITE": "datadoghq.com"
      }
    }
  },
  "inputs": [
    { "id": "datadogApiKey", "type": "promptString", "description": "Datadog API Key", "password": true },
    { "id": "datadogAppKey", "type": "promptString", "description": "Datadog App Key", "password": true }
  ]
}
```

Or install the [Datadog MCP Server VS Code Extension](../datadog-vscode-extension/) for automatic registration with a settings UI.

### Claude Desktop

Add to `claude_desktop_config.json` (`~/Library/Application Support/Claude/` on macOS, `%APPDATA%\Claude\` on Windows):

```json
{
  "mcpServers": {
    "datadog": {
      "command": "npx",
      "args": ["-y", "@fazorboy/datadog-mcp-server"],
      "env": {
        "datadog_DD_API_KEY": "your-api-key",
        "datadog_DD_APP_KEY": "your-app-key",
        "datadog_DD_SITE": "datadoghq.com"
      }
    }
  }
}
```

### Cursor

Add to Cursor Settings → MCP → Add Server, or in `.cursor/mcp.json`:

```json
{
  "mcpServers": {
    "datadog": {
      "command": "npx",
      "args": ["-y", "@fazorboy/datadog-mcp-server"],
      "env": {
        "datadog_DD_API_KEY": "your-api-key",
        "datadog_DD_APP_KEY": "your-app-key",
        "datadog_DD_SITE": "datadoghq.com"
      }
    }
  }
}
```

## Tools (16 total)

### Metric Queries (3)
| Tool | Description |
|------|-------------|
| `datadog_query_metrics` | Query timeseries metrics |
| `datadog_list_metrics` | List available metric names |
| `datadog_get_metric_metadata` | Get metric metadata (type, unit, description) |

### Log Search (2)
| Tool | Description |
|------|-------------|
| `datadog_search_logs` | Search and filter logs |
| `datadog_log_facets` | Get log facet values |

### APM Traces (2)
| Tool | Description |
|------|-------------|
| `datadog_search_traces` | Search APM traces |
| `datadog_service_map` | Get service dependency map |

### Monitor Management (4)
| Tool | Description |
|------|-------------|
| `datadog_list_monitors` | List monitors/alerts |
| `datadog_create_monitor` | Create a new monitor |
| `datadog_update_monitor` | Update an existing monitor |
| `datadog_mute_monitor` | Mute/unmute a monitor |

### Dashboard & Incident (3)
| Tool | Description |
|------|-------------|
| `datadog_list_dashboards` | List dashboards |
| `datadog_get_dashboard` | Get dashboard details and widgets |
| `datadog_list_incidents` | List incidents |

### Infrastructure (2)
| Tool | Description |
|------|-------------|
| `datadog_list_hosts` | List infrastructure hosts |
| `datadog_host_metrics` | Get host-level metrics |

## Configuration

| Variable | Required | Description | Default |
|----------|----------|-------------|---------|
| `datadog_DD_API_KEY` | Yes | Datadog API key | — |
| `datadog_DD_APP_KEY` | Yes | Datadog Application key | — |
| `datadog_DD_SITE` | No | Datadog site | `datadoghq.com` |
| `datadog_DD_MAX_RESULTS` | No | Max results per query | `100` |
| `datadog_DD_LOG_RETENTION_DAYS` | No | Max days back for logs | `15` |
| `datadog_DD_TIMEOUT_MS` | No | API request timeout | `30000` |
| `datadog_DD_ALLOWED_TAGS` | No | Tag filter (comma-separated) | — |

## Security

- API keys loaded from environment variables only — never logged or returned
- `ALLOWED_TAGS` restricts queryable scope
- Rate limiting respected (300 req/min with backoff)
- All API calls over HTTPS
- Zod schema validation on all inputs
- Result sizes limited; no bulk export

## Usage Examples

Ask your AI assistant natural language questions — the MCP server maps them to the right tool:

| Prompt | Tool |
|--------|------|
| "Query the `system.cpu.user` metric for `env:prod` over the last 2 hours" | `datadog_query_metrics` |
| "What metrics are available matching `aws.ec2`?" | `datadog_list_metrics` |
| "Get metadata for the `trace.http.request.duration` metric" | `datadog_get_metric_metadata` |
| "Search logs for `status:error` in `service:auth-api` from the past 30 minutes" | `datadog_search_logs` |
| "Show me the top log facet values for `@http.status_code`" | `datadog_log_facets` |
| "Find APM traces where duration > 5s in `order-service`" | `datadog_search_traces` |
| "Show the service dependency map for `payment-gateway`" | `datadog_service_map` |
| "List all monitors tagged `team:platform` that are alerting" | `datadog_list_monitors` |
| "Create a metric monitor for high memory usage on production hosts" | `datadog_create_monitor` |
| "Mute monitor ID 12345 for 1 hour during a maintenance window" | `datadog_mute_monitor` |