Skip to main content
Glama
Datadog MCP Server

Datadog MCP Server

by tuno-dev

Datadog MCP サーバー

英語 (本書) |日本語

ログ検索、トレーススパン検索、トレーススパン集約機能を有効にする、Datadog API 用の MCP サーバー。

特徴

  • ログ検索: 柔軟なクエリオプションを使用して、Datadog からログを検索および取得します。

  • トレーススパン検索: さまざまなフィルタリングオプションを使用して分散トレーススパンを検索します

  • トレーススパンの集計: 分析のために異なるディメンションでトレーススパンを集計します

Related MCP server: Datadog MCP Server

ツール

  1. search_logs

    • Datadogでログを検索する

    • 入力:

      • filterQuery (オプションの文字列): ログを検索するためのクエリ文字列 (デフォルト: "*")

      • filterFrom (オプションの数値): UNIXタイムスタンプによる検索開始時刻(秒単位)(デフォルト: 15分前)

      • filterTo (オプションの数値): 検索終了時刻 (UNIX タイムスタンプ、秒単位) (デフォルト: 現在の時刻)

      • pageLimit (オプションの数値): 取得するログの最大数 (デフォルト: 25、最大: 1000)

      • pageCursor (オプションの文字列): 追加の結果を取得するためのページ区切りカーソル

    • 戻り値: 次の内容を含む書式設定されたテキスト:

      • 検索条件(クエリと時間範囲)

      • 見つかったログの数

      • 次のページカーソル(利用可能な場合)

      • 以下を含むログの詳細:

        • サービス名

        • タグ

        • タイムスタンプ

        • 状態

        • メッセージ(300文字以内)

        • ホスト

        • 重要な属性 (http.method、http.url、http.status_code、error)

  2. search_spans

    • Datadogでトレーススパンを検索する

    • 入力:

      • filterQuery (オプションの文字列): 範囲を検索するクエリ文字列 (デフォルト: "*")

      • filterFrom (オプションの数値): UNIXタイムスタンプによる検索開始時刻(秒単位)(デフォルト: 15分前)

      • filterTo (オプションの数値): 検索終了時刻 (UNIX タイムスタンプ、秒単位) (デフォルト: 現在の時刻)

      • pageLimit (オプションの数値): 取得するスパンの最大数 (デフォルト: 25、最大: 1000)

      • pageCursor (オプションの文字列): 追加の結果を取得するためのページ区切りカーソル

    • 戻り値: 次の内容を含む書式設定されたテキスト:

      • 検索条件(クエリと時間範囲)

      • 見つかったスパンの数

      • 次のページカーソル(利用可能な場合)

      • スパンの詳細には以下が含まれます:

        • サービス名

        • タイムスタンプ

        • リソース名

        • 期間(秒)

        • ホスト

        • 環境

        • タイプ

        • 重要な属性 (http.method、http.url、http.status_code、error)

  3. aggregate_spans

    • 指定されたディメンションで Datadog のトレース範囲を集計する

    • 入力:

      • filterQuery (オプションの文字列): 集計の範囲をフィルタリングするためのクエリ文字列 (デフォルト: "*")

      • filterFrom (オプションの数値): 開始時刻 (UNIX タイムスタンプ、秒単位) (デフォルト: 15 分前)

      • filterTo (オプションの数値): 終了時刻 (UNIX タイムスタンプ、秒単位) (デフォルト: 現在の時刻)

      • groupBy (オプションの文字列[]): グループ化するディメンション (例: ["service", "resource_name", "status"])

      • aggregation (オプションの文字列):集計方法 - 「count」、「avg」、「sum」、「min」、「max」、「pct」(デフォルト:「count」)

      • interval (オプションの文字列):時系列データの時間間隔(タイプが「timeseries」の場合のみ)

      • type (オプションの文字列): 結果の型。「timeseries」または「total」のいずれか (デフォルト:「timeseries」)

    • 戻り値: 次の内容を含む書式設定されたテキスト:

      • 集計結果はバケットにまとめられ、各バケットには次のものが含まれます。

        • バケットID

        • 値でグループ化する(groupByが指定されている場合)

        • 集計方法に基づいて計算された値

      • 追加のメタデータ:

        • 処理時間(経過)

        • リクエストID

        • 状態

        • 警告(ある場合)

設定

Datadog API とアプリケーション キーを設定する必要があります。

  1. Datadog APIキーページからAPIキーとアプリケーションキーを取得します。

  2. datadog-mcp プロジェクトに依存関係をインストールします。

    npm install
    # or
    pnpm install
  3. TypeScript プロジェクトをビルドします。

    npm run build
    # or
    pnpm run build

Dockerのセットアップ

次のコマンドで Docker を使用してビルドできます。

docker build -t datadog-mcp .

Claude Desktopでの使用

Claude Desktop でこれを使用するには、 claude_desktop_config.jsonに以下を追加します。

{
  "mcpServers": {
    "datadog": {
      "command": "node",
      "args": [
        "/path/to/datadog-mcp/build/index.js"
      ],
      "env": {
        "DD_API_KEY": "<YOUR_DATADOG_API_KEY>",
        "DD_APP_KEY": "<YOUR_DATADOG_APP_KEY>"
      }
    }
  }
}

Docker を使用している場合は、次のように設定できます。

{
  "mcpServers": {
    "datadog": {
      "command": "docker",
        "args": [
          "run",
          "-i",
          "--rm",
          "-e",
          "DD_API_KEY",
          "-e",
          "DD_APP_KEY",
          "datadog-mcp"
        ],
      "env": {
        "DD_API_KEY": "<YOUR_DATADOG_API_KEY>",
        "DD_APP_KEY": "<YOUR_DATADOG_APP_KEY>"
      }
    }
  }
}

VS Codeでの使用

VS Code で簡単にインストールするには、設定を構成します。

  1. VS Code でユーザー設定 (JSON) を開く ( Ctrl+Shift+P → Preferences: Open User Settings (JSON) )

  2. 次の構成を追加します。

{
  "mcp": {
    "servers": {
      "datadog": {
        "command": "node",
        "args": [
          "/path/to/datadog-mcp/build/index.js"
        ],
        "env": {
          "DD_API_KEY": "<YOUR_DATADOG_API_KEY>",
          "DD_APP_KEY": "<YOUR_DATADOG_APP_KEY>"
        }
      }
    }
  }
}

Docker を使用している場合は、次のように設定できます。

{
  "mcp": {
    "servers": {
      "datadog": {
        "command": "docker",
          "args": [
          "run",
          "-i",
          "--rm",
          "-e",
          "DD_API_KEY",
          "-e",
          "DD_APP_KEY",
          "datadog-mcp"
        ],
        "env": {
          "DD_API_KEY": "<YOUR_DATADOG_API_KEY>",
          "DD_APP_KEY": "<YOUR_DATADOG_APP_KEY>"
        }
      }
    }
  }
}

あるいは、ワークスペースの.vscode/mcp.jsonファイルにこれを追加することもできます ( mcpキーなし)。

{
  "servers": {
    "datadog": {
      "command": "node",
      "args": [
        "/path/to/datadog-mcp/build/index.js"
      ],
      "env": {
        "DD_API_KEY": "<YOUR_DATADOG_API_KEY>",
        "DD_APP_KEY": "<YOUR_DATADOG_APP_KEY>"
      }
    }
  }
}

Docker を使用している場合は、次のように設定できます。

{
  "servers": {
    "datadog": {
      "command": "docker",
        "args": [
          "run",
          "-i",
          "--rm",
          "-e",
          "DD_API_KEY",
          "-e",
          "DD_APP_KEY",
          "datadog-mcp"
        ],
      "env": {
        "DD_API_KEY": "<YOUR_DATADOG_API_KEY>",
        "DD_APP_KEY": "<YOUR_DATADOG_APP_KEY>"
      }
    }
  }
}

Available Tools

3 tools
aggregate_spansC

Tool for aggregating Datadog trace spans

Inputs: filterQuery, filterFrom, filterTo, groupBy, +2 more.

search_logsC

Tool for searching Datadog logs

Inputs: filterQuery, filterFrom, filterTo, pageLimit, +1 more.

search_spansC

Tool for searching Datadog trace spans

Inputs: filterQuery, filterFrom, filterTo, pageLimit, +1 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.9/5.0

    Scored across 3 tools

    Disambiguation4/5

    The three tools are mostly distinct, with 'aggregate_spans' focusing on aggregation of trace data, 'search_logs' targeting log data, and 'search_spans' targeting trace data. However, 'aggregate_spans' and 'search_spans' both operate on spans and could be confused for overlapping purposes, though their descriptions clarify one aggregates and the other searches.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern with snake_case, using 'aggregate' and 'search' as verbs paired with specific nouns like 'spans' and 'logs'. There are no deviations in naming style or convention.

    Tool Count3/5

    With only 3 tools, the server feels thin for a Datadog integration, which typically involves monitoring, metrics, dashboards, and alerts. While the tools cover traces and logs, the scope is limited, making it borderline appropriate for the apparent domain.

    Completeness2/5

    The tool surface has significant gaps for a Datadog server, missing core operations like querying metrics, managing dashboards, setting alerts, or accessing APM data beyond spans. Agents will struggle with incomplete coverage for common monitoring workflows.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables monitoring and querying of Datadog metrics for Kubernetes clusters, APM traces, infrastructure hosts, and databases through a unified interface.
      8 npm
      -
    • A
      license
      B
      quality
      D
      maintenance
      Enables interaction with Datadog's monitoring and observability platform through the MCP protocol. Supports incident management, monitor status checks, log searches, metrics queries, APM traces, dashboard access, RUM analytics, host management, and downtime scheduling.
      13
      27 npm
      Apache 2.0
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to interact with Datadog's observability platform via natural language, covering metrics, logs, APM, monitors, dashboards, incidents, and infrastructure.
      2,023 npm
      1
      MIT