D

Datadog服务管理器

@winor30/mcp-server-datadog
Hosted
0 Stars 401 次浏览 winor30 更新于 2026-08-23

MCP服务器提供了一个对接Datadog API的接口,能够实现对事件、监控、日志、仪表板、指标、跟踪和主机的无缝管理。其可扩展的设计使得未来可以轻松集成更多的Datadog API以进行功能扩展。

MCP 服务配置

复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用

{
  "mcpServers": {
    "github": {
      "args": [
        "-y",
        "@modelcontextprotocol/server-github"
      ],
      "command": "npx",
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "\u003cYOUR_TOKEN\u003e"
      }
    }
  }
}

该服务需要配置环境变量:DATADOG_API_KEY、DATADOG_APP_KEY、DATADOG_SITE

服务介绍

Datadog MCP 服务器

NPM 版本构建和测试codecovsmithery 徽章

用于 Datadog API 的 MCP 服务器,支持事件管理等功能。

功能

  • 可观测性工具:提供一种机制来利用关键的 Datadog 监控功能,如事件、监控器、日志、仪表板和指标,通过 MCP 服务器实现。
  • 可扩展设计:设计为易于与额外的 Datadog API 集成,允许未来无缝地扩展功能。

工具

  1. list_incidents

    • Retrieve a list of incidents from Datadog.
    • Inputs:
      • filter (optional string): Filter parameters for incidents (e.g., status, priority).
      • pagination (optional object): Pagination details like page size/offset.
    • Returns: Array of Datadog incidents and associated metadata.
  2. get_incident

    • Retrieve detailed information about a specific Datadog incident.
    • Inputs:
      • incident_id (string): Incident ID to fetch details for.
    • Returns: Detailed incident information (title, status, timestamps, etc.).
  3. get_monitors

    • Fetch the status of Datadog monitors.
    • Inputs:
      • groupStates (optional array): States to filter (e.g., alert, warn, no data, ok).
      • name (optional string): Filter by name.
      • tags (optional array): Filter by tags.
    • Returns: Monitors data and a summary of their statuses.
  4. get_logs

    • Search and retrieve logs from Datadog.
    • Inputs:
      • query (string): Datadog logs query string.
      • from (number): Start time in epoch seconds.
      • to (number): End time in epoch seconds.
      • limit (optional number): Maximum number of logs to return (defaults to 100).
    • Returns: Array of matching logs.
  5. list_dashboards

    • Get a list of dashboards from Datadog.
    • Inputs:
      • name (optional string): Filter dashboards by name.
      • tags (optional array): Filter dashboards by tags.
    • Returns: Array of dashboards with URL references.
  6. get_dashboard

    • Retrieve a specific dashboard from Datadog.
    • Inputs:
      • dashboard_id (string): ID of the dashboard to fetch.
    • Returns: Dashboard details including title, widgets, etc.
  7. get_metrics

    • Retrieve metrics data from Datadog.
    • Inputs:
      • query (string): Metrics query string.
      • from (number): Start time in epoch seconds.
      • to (number): End time in epoch seconds.
    • Returns: Metrics data for the queried timeframe.
  8. list_traces

    • Retrieve a list of APM traces from Datadog.
    • Inputs:
      • query (string): Datadog APM trace query string.
      • from (number): Start time in epoch seconds.
      • to (number): End time in epoch seconds.
      • limit (optional number): Maximum number of traces to return (defaults to 100).
      • sort (optional string): Sort order for traces (defaults to '-timestamp').
      • service (optional string): Filter by service name.
      • operation (optional string): Filter by operation name.
    • Returns: Array of matching traces from Datadog APM.
  9. list_hosts

    • Get list of hosts from Datadog.
    • Inputs:
      • filter (optional string): Filter string for search results.
      • sort_field (optional string): Field to sort hosts by.
      • sort_dir (optional string): Sort direction (asc/desc).
      • start (optional number): Starting offset for pagination.
      • count (optional number): Max number of hosts to return (max: 1000).
      • from (optional number): Search hosts from this UNIX timestamp.
      • include_muted_hosts_data (optional boolean): Include muted hosts status and expiry.
      • include_hosts_metadata (optional boolean): Include host metadata (version, platform, etc).
    • Returns: Array of hosts with details including name, ID, aliases, apps, mute status, and more.
  10. get_active_hosts_count

    • Get the total number of active hosts in Datadog.
    • Inputs:
      • from (optional number): Number of seconds from which you want to get total number of active hosts (defaults to 2h).
    • Returns: Count of total active and up hosts.
  11. mute_host

    • Mute a host in Datadog.
    • Inputs:
      • hostname (string): The name of the host to mute.
      • message (optional string): Message to associate with the muting of this host.
      • end (optional number): POSIX timestamp for when the mute should end.
      • override (optional boolean): If true and the host is already muted, replaces existing end time.
    • Returns: Success status and confirmation message.
  12. unmute_host

    • Unmute a host in Datadog.
    • Inputs:
      • hostname (string): The name of the host to unmute.
    • Returns: Success status and confirmation message.
  13. list_downtimes

    • List scheduled downtimes from Datadog.
    • Inputs:
      • currentOnly (optional boolean): Return only currently active downtimes when true.
      • monitorId (optional number): Filter by monitor ID.
    • Returns: Array of scheduled downtimes with details including scope, monitor information, and schedule.
  14. schedule_downtime

    • Schedule a downtime in Datadog.
    • Inputs:
      • scope (string): Scope to apply downtime to (e.g. 'host:my-host').
      • start (optional number): UNIX timestamp for the start of the downtime.
      • end (optional number): UNIX timestamp for the end of the downtime.
      • message (optional string): A message to include with the downtime.
      • timezone (optional string): The timezone for the downtime (e.g. 'UTC', 'America/New_York').
      • monitorId (optional number): The ID of the monitor to mute.
      • monitorTags (optional array): A list of monitor tags for filtering.
      • recurrence (optional object): Recurrence settings for the downtime.
        • type (string): Recurrence type ('days', 'weeks', 'months', 'years').
        • period (number): How often to repeat (must be >= 1).
        • weekDays (optional array): Days of the week for weekly recurrence.
        • until (optional number): UNIX timestamp for when the recurrence ends.
    • Returns: Scheduled downtime details including ID and active status.
  15. cancel_downtime

    • Cancel a scheduled downtime in Datadog.
    • Inputs:
      • downtimeId (number): The ID of the downtime to cancel.
    • Returns: Confirmation of downtime cancellation.

设置

Datadog 凭证

要使用此 MCP 服务器,您需要有效的 Datadog API 凭证:

  • DATADOG_API_KEY:您的 Datadog API 密钥
  • DATADOG_APP_KEY:您的 Datadog 应用密钥
  • DATADOG_SITE(可选):Datadog 站点(例如 datadoghq.eu

在运行服务器之前,请将它们导出到您的环境中:

export DATADOG_API_KEY="your_api_key"
export DATADOG_APP_KEY="your_app_key"
export DATADOG_SITE="your_datadog_site"

安装

通过 Smithery 安装

要通过 Smithery 自动安装适用于 Claude Desktop 的 Datadog MCP 服务器:

npx -y @smithery/cli install @winor30/mcp-server-datadog --client claude

手动安装

pnpm install
pnpm build
pnpm watch   # for development with auto-rebuild

与 Claude Desktop 一起使用

要与 Claude Desktop 一起使用,请将以下内容添加到您的 claude_desktop_config.json 中:

在 MacOS 上:~/Library/Application Support/Claude/claude_desktop_config.json
在 Windows 上:%APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "<YOUR_TOKEN>"
      }
    }
  }
}
{
  "mcpServers": {
    "datadog": {
      "command": "/path/to/mcp-server-datadog/build/index.js",
      "env": {
        "DATADOG_API_KEY": "<YOUR_API_KEY>",
        "DATADOG_APP_KEY": "<YOUR_APP_KEY>",
        "DATADOG_SITE": "<YOUR_SITE>" // Optional
      }
    }
  }
}

或者通过 npx 指定:

{
  "mcpServers": {
    "mcp-server-datadog": {
      "command": "npx",
      "args": ["-y", "@winor30/mcp-server-datadog"],
      "env": {
        "DATADOG_API_KEY": "<YOUR_API_KEY>",
        "DATADOG_APP_KEY": "<YOUR_APP_KEY>",
        "DATADOG_SITE": "<YOUR_SITE>" // Optional
      }
    }
  }
}

调试

由于 MCP 服务器通过标准输入/输出进行通信,调试有时可能会很棘手。我们建议使用 MCP Inspector。您可以使用以下命令运行检查器:

npm run inspector

检查器将提供一个 URL,您可以在浏览器中打开它以查看日志并手动发送请求。

贡献

欢迎贡献!如果您有任何建议、错误报告或改进意见,请随时提出问题或拉取请求。

许可证

本项目根据 Apache License, Version 2.0 许可。

相关 MCP 服务