Labsco
GeLi2001 logo

Datadog

β˜… 68

from GeLi2001

Interact with the Datadog API to monitor your cloud infrastructure, applications, and logs.

πŸ”₯πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedFreeQuick setup

Datadog MCP Server

A Model Context Protocol (MCP) server for interacting with the Datadog API.

<a href="https://glama.ai/mcp/servers/@GeLi2001/datadog-mcp-server"> <img width="380" height="200" src="https://glama.ai/mcp/servers/@GeLi2001/datadog-mcp-server/badge" alt="Datadog MCP server" /> </a>

Features

  • Monitoring: Access monitor data and configurations
  • Dashboards: Retrieve and view dashboard definitions
  • Metrics: Query available metrics and their metadata
  • Events: Search and retrieve events within timeframes
  • Logs: Search logs with advanced filtering and sorting options
  • Incidents: Access incident management data
  • API Integration: Direct integration with Datadog's v1 and v2 APIs
  • Comprehensive Error Handling: Clear error messages for API and authentication issues
  • Service-Specific Endpoints: Support for different endpoints for logs and metrics

Application Key Scopes

For improved security, you can scope your Application Key to grant only the minimum permissions required by this MCP server. By default, Application Keys inherit all permissions from the user who created them, but scoped Application Keys allow you to follow the principle of least privilege.

Required Scopes

The following scopes are required for the corresponding features:

Tool(s)Required ScopeDescription
get-monitors, get-monitormonitors_readRead access to monitor configurations and states
get-dashboards, get-dashboarddashboards_readRead access to dashboard definitions
get-metrics, get-metric-metadatametrics_readRead access to metrics list and metadata
get-eventsevents_readRead access to events from the event stream
search-logs, aggregate-logslogs_read_dataRead access to log data for search and aggregation
get-incidentsincident_readRead access to incident management data

Creating a Scoped Application Key

  1. Go to Organization Settings > Application Keys
  2. Click New Key
  3. Enter a name (e.g., "MCP Server - Read Only")
  4. Under Scopes, select only the permissions you need:
    • For full functionality: monitors_read, dashboards_read, metrics_read, events_read, logs_read_data, incident_read
    • For logs only: logs_read_data
    • For monitoring only: monitors_read, dashboards_read, metrics_read
  5. Click Create Key

Note: If you don't specify any scopes when creating an Application Key, it will have full access with all permissions of the creating user. For production use, we recommend always specifying explicit scopes.

Available Tools

The server provides these MCP tools:

  • get-monitors: Fetch monitors with optional filtering
  • get-monitor: Get details of a specific monitor by ID
  • get-dashboards: List all dashboards
  • get-dashboard: Get a specific dashboard by ID
  • get-metrics: List available metrics
  • get-metric-metadata: Get metadata for a specific metric
  • get-events: Fetch events within a time range
  • get-incidents: List incidents with optional filtering
  • search-logs: Search logs with advanced query filtering
  • aggregate-logs: Perform analytics and aggregations on log data

Examples

Example: Get Monitors

Copy & paste β€” that's it
{
  "method": "tools/call",
  "params": {
    "name": "get-monitors",
    "arguments": {
      "groupStates": ["alert", "warn"],
      "limit": 5
    }
  }
}

Example: Get a Dashboard

Copy & paste β€” that's it
{
  "method": "tools/call",
  "params": {
    "name": "get-dashboard",
    "arguments": {
      "dashboardId": "abc-def-123"
    }
  }
}

Example: Search Logs

Copy & paste β€” that's it
{
  "method": "tools/call",
  "params": {
    "name": "search-logs",
    "arguments": {
      "filter": {
        "query": "service:web-app status:error",
        "from": "now-15m",
        "to": "now"
      },
      "sort": "-timestamp",
      "limit": 20
    }
  }
}

Example: Aggregate Logs

Copy & paste β€” that's it
{
  "method": "tools/call",
  "params": {
    "name": "aggregate-logs",
    "arguments": {
      "filter": {
        "query": "service:web-app",
        "from": "now-1h",
        "to": "now"
      },
      "compute": [
        {
          "aggregation": "count"
        }
      ],
      "groupBy": [
        {
          "facet": "status",
          "limit": 10,
          "sort": {
            "aggregation": "count",
            "order": "desc"
          }
        }
      ]
    }
  }
}

Example: Get Incidents

Copy & paste β€” that's it
{
  "method": "tools/call",
  "params": {
    "name": "get-incidents",
    "arguments": {
      "includeArchived": false,
      "query": "state:active",
      "pageSize": 10
    }
  }
}

Debugging

If you encounter issues, check Claude Desktop's MCP logs:

Copy & paste β€” that's it
# On macOS
tail -n 20 -f ~/Library/Logs/Claude/mcp*.log

# On Windows
Get-Content -Path "$env:APPDATA\Claude\Logs\mcp*.log" -Tail 20 -Wait

Common issues:

  • 403 Forbidden: Authentication issue with Datadog API keys
  • API key or App key format invalid: Ensure you're using the full key strings
  • Site configuration errors: Make sure you're using the correct Datadog domain
  • Endpoint mismatches: Verify that service-specific endpoints are correctly set if you're using separate domains for logs and metrics

License

MIT