Skip to main content
Glama
tuno-dev

Datadog MCP Server

by tuno-dev

Datadog MCP Server

English (This Document) | 日本語

MCP Server for Datadog API, enabling log search, trace span search, and trace span aggregation functionalities.

Features

  • Log Search: Search and retrieve logs from Datadog with flexible query options

  • Trace Span Search: Search for distributed trace spans with various filtering options

  • Trace Span Aggregation: Aggregate trace spans by different dimensions for analysis

Related MCP server: Datadog MCP Server

Tools

  1. search_logs

    • Search for logs in Datadog

    • Inputs:

      • filterQuery (optional string): Query string to search logs (default: "*")

      • filterFrom (optional number): Search start time as UNIX timestamp in seconds (default: 15 minutes ago)

      • filterTo (optional number): Search end time as UNIX timestamp in seconds (default: current time)

      • pageLimit (optional number): Maximum number of logs to retrieve (default: 25, max: 1000)

      • pageCursor (optional string): Pagination cursor for retrieving additional results

    • Returns: Formatted text containing:

      • Search conditions (query and time range)

      • Number of logs found

      • Next page cursor (if available)

      • Log details including:

        • Service name

        • Tags

        • Timestamp

        • Status

        • Message (truncated to 300 characters)

        • Host

        • Important attributes (http.method, http.url, http.status_code, error)

  2. search_spans

    • Search for trace spans in Datadog

    • Inputs:

      • filterQuery (optional string): Query string to search spans (default: "*")

      • filterFrom (optional number): Search start time as UNIX timestamp in seconds (default: 15 minutes ago)

      • filterTo (optional number): Search end time as UNIX timestamp in seconds (default: current time)

      • pageLimit (optional number): Maximum number of spans to retrieve (default: 25, max: 1000)

      • pageCursor (optional string): Pagination cursor for retrieving additional results

    • Returns: Formatted text containing:

      • Search conditions (query and time range)

      • Number of spans found

      • Next page cursor (if available)

      • Span details including:

        • Service name

        • Timestamp

        • Resource name

        • Duration (in seconds)

        • Host

        • Environment

        • Type

        • Important attributes (http.method, http.url, http.status_code, error)

  3. aggregate_spans

    • Aggregate trace spans in Datadog by specified dimensions

    • Inputs:

      • filterQuery (optional string): Query string to filter spans for aggregation (default: "*")

      • filterFrom (optional number): Start time as UNIX timestamp in seconds (default: 15 minutes ago)

      • filterTo (optional number): End time as UNIX timestamp in seconds (default: current time)

      • groupBy (optional string[]): Dimensions to group by (e.g., ["service", "resource_name", "status"])

      • aggregation (optional string): Aggregation method - "count", "avg", "sum", "min", "max", "pct" (default: "count")

      • interval (optional string): Time interval for time series data (only when type is "timeseries")

      • type (optional string): Result type, either "timeseries" or "total" (default: "timeseries")

    • Returns: Formatted text containing:

      • Aggregation results in buckets, each including:

        • Bucket ID

        • Group by values (if groupBy is specified)

        • Computed values based on the aggregation method

      • Additional metadata:

        • Processing time (elapsed)

        • Request ID

        • Status

        • Warnings (if any)

Setup

You need to set up Datadog API and application keys:

  1. Get your API key and application key from the Datadog API Keys page

  2. Install dependencies in the datadog-mcp project:

    npm install
    # or
    pnpm install
  3. Build the TypeScript project:

    npm run build
    # or
    pnpm run build

Docker Setup

You can build using Docker with the following command:

docker build -t datadog-mcp .

Usage with Claude Desktop

To use this with Claude Desktop, add the following to your 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>"
      }
    }
  }
}

If you're using Docker, you can configure it like this:

{
  "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>"
      }
    }
  }
}

Usage with VS Code

For quick installation in VS Code, configure your settings:

  1. Open User Settings (JSON) in VS Code (Ctrl+Shift+PPreferences: Open User Settings (JSON))

  2. Add the following configuration:

{
  "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>"
        }
      }
    }
  }
}

If you're using Docker, you can configure it like this:

{
  "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>"
        }
      }
    }
  }
}

Alternatively, you can add this to a .vscode/mcp.json file in your workspace (without the mcp key):

{
  "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>"
      }
    }
  }
}

If you're using Docker, you can configure it like this:

{
  "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

ParametersJSON Schema
NameRequiredDescriptionDefault
filterQueryNoQuery string to search for (optional, default is '*')*
filterFromNoSearch start time (UNIX timestamp in seconds, optional, default is 15 minutes ago)
filterToNoSearch end time (UNIX timestamp in seconds, optional, default is current time)
groupByNoAttributes to group by (example: ['service', 'resource_name'])
intervalNoTime interval to group results by (optional, only used when type is timeseries)
typeNoResult type - timeseries or total (optional, default is 'timeseries')timeseries

TDQS

C2.6/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden but provides minimal behavioral insight. It doesn't disclose whether this is a read-only operation, its performance characteristics, rate limits, or what the aggregation output looks like. The description only states the tool's purpose without behavioral traits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with no wasted words. It's appropriately sized for a tool with a clear name and detailed schema. However, it could be more front-loaded with key details like aggregation type.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 6-parameter aggregation tool with no annotations and no output schema, the description is incomplete. It doesn't explain the return format, aggregation metrics, or how results are structured. The schema handles parameters well, but behavioral and output context is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents all 6 parameters. The description adds no parameter-specific information beyond what's in the schema. Baseline 3 is appropriate as the schema does the heavy lifting, but the description doesn't compensate or add value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool aggregates Datadog trace spans, which is a clear purpose. However, it doesn't specify what aggregation means (e.g., counting, averaging, summing) or how it differs from sibling tools like search_spans. The verb 'aggregating' is specific but lacks operational detail.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like search_spans. The description doesn't mention any prerequisites, exclusions, or contextual cues for selection. Usage is implied only by the tool name and basic purpose.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_logsC

Tool for searching Datadog logs

ParametersJSON Schema
NameRequiredDescriptionDefault
filterQueryNoQuery string to search logs (optional, default is '*')*
filterFromNoSearch start time (UNIX timestamp in seconds, optional, default is 15 minutes ago)
filterToNoSearch end time (UNIX timestamp in seconds, optional, default is current time)
pageLimitNoMaximum number of logs to retrieve (optional, default is 25)
pageCursorNoCursor to retrieve the next page (optional)

TDQS

C2.6/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure but only states the basic function. It doesn't mention authentication needs, rate limits, pagination behavior beyond the cursor parameter, error handling, or what the output looks like (especially critical since there's no output schema). For a search tool with 5 parameters and no annotations, this is inadequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with no wasted words. It's appropriately sized for a basic tool description, though it could be more informative while remaining concise.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (5 parameters, no annotations, no output schema, and sibling tools), the description is incomplete. It doesn't help the agent understand what the tool returns, how to interpret results, or how it differs from similar tools. For a search operation with multiple parameters and no output schema, more context is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so all parameters are documented in the schema. The description adds no additional meaning about parameters beyond implying a search function. It doesn't explain query syntax, time format nuances, or how pagination works in practice. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Tool for searching Datadog logs' states the basic action (searching) and resource (Datadog logs), but it's vague about scope and doesn't differentiate from sibling tools like 'search_spans'. It doesn't specify what kind of logs or what search capabilities exist beyond the basic verb+resource.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'search_spans' or 'aggregate_spans'. The description doesn't mention any context, prerequisites, or exclusions for usage, leaving the agent with no comparative information.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_spansC

Tool for searching Datadog trace spans

ParametersJSON Schema
NameRequiredDescriptionDefault
filterQueryNoQuery string to search for (optional, default is '*')*
filterFromNoSearch start time (UNIX timestamp in seconds, optional, default is 15 minutes ago)
filterToNoSearch end time (UNIX timestamp in seconds, optional, default is current time)
pageLimitNoMaximum number of spans to retrieve (optional, default is 25)
pageCursorNoCursor to retrieve the next page (optional)

TDQS

C2.6/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It only states it's a search tool without mentioning whether it's read-only, what permissions are needed, rate limits, pagination behavior (though schema hints at it), or what the output looks like. For a search tool with 5 parameters, this leaves significant behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that states the core purpose without unnecessary words. It's appropriately sized for a search tool, though it could be more informative by adding context about when to use it versus siblings.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 5 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain what the search returns, how results are structured, or behavioral aspects like pagination. For a search tool with moderate complexity, this leaves too much unspecified.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents all 5 parameters with their types, defaults, and descriptions. The description adds no additional parameter information beyond what's in the schema. This meets the baseline of 3 for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool searches Datadog trace spans, which is a clear verb+resource combination. However, it doesn't differentiate from sibling tools like 'aggregate_spans' (which likely aggregates rather than searches) or 'search_logs' (which searches logs rather than spans). The purpose is understandable but lacks sibling differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. There's no mention of when to choose search_spans over aggregate_spans or search_logs, nor any context about prerequisites or typical use cases. The user must infer usage from the tool name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 3 tool updatesv1.0.0
    • Changedaggregate_spans11 fields changed
      • removedInput schema / properties / aggregation
        Removed value: -{
        -  "default": "count",
        -  "description": "集計関数(オプション、デフォルトは「count」)",
        -  "enum": [
        -    "count",
        -    "avg",
        -    "sum",
        -    "min",
        -    "max",
        -    "pct"
        -  ],
        -  "type": "string"
        -}
      • changedInput schema / properties / filterFrom / default
        Previous value: -1745805204.363New value: +1767414583.907
      • changedInput schema / properties / filterFrom / description
        Previous value: -"検索開始時間(UNIXタイムスタンプ、秒単位、オプション、デフォルトは15分前)"New value: +"Search start time (UNIX timestamp in seconds, optional, default is 15 minutes ago)"
      • changedInput schema / properties / filterQuery / description
        Previous value: -"検索するためのクエリ文字列(オプション、デフォルトは「*」)"New value: +"Query string to search for (optional, default is '*')"
      • changedInput schema / properties / filterTo / default
        Previous value: -1745806104.363New value: +1767415483.907
      • changedInput schema / properties / filterTo / description
        Previous value: -"検索終了時間(UNIXタイムスタンプ、秒単位、オプション、デフォルトは現在時刻)"New value: +"Search end time (UNIX timestamp in seconds, optional, default is current time)"
      • changedInput schema / properties / groupBy / description
        Previous value: -"グループ化するための属性(例: ['service', 'resource_name'])"New value: +"Attributes to group by (example: ['service', 'resource_name'])"
      • addedInput schema / properties / groupBy / items / enum
        Added value: +[
        +  "service",
        +  "resource_name",
        +  "env",
        +  "status",
        +  "operation_name",
        +  "type",
        +  "@version",
        +  "@http.status_code",
        +  "@http.client_ip",
        +  "@http.url",
        +  "@http.method",
        +  "@http.host",
        +  "@http.user_agent",
        +  "@http.path_group",
        +  "@http.route"
        +]
      • removedInput schema / properties / interval / default
        Removed value: -"5m"
      • changedInput schema / properties / interval / description
        Previous value: -"結果をグループ化する時間間隔(オプション、デフォルト '5m')"New value: +"Time interval to group results by (optional, only used when type is timeseries)"
      • changedInput schema / properties / type / description
        Previous value: -"結果タイプ - timeseries または total(オプション、デフォルトは「timeseries」)"New value: +"Result type - timeseries or total (optional, default is 'timeseries')"
    • Changedsearch_logs7 fields changed
      • changedInput schema / properties / filterFrom / default
        Previous value: -1745805204.363New value: +1767414583.907
      • changedInput schema / properties / filterFrom / description
        Previous value: -"検索開始時間(UNIXタイムスタンプ、秒単位、オプション、デフォルトは15分前)"New value: +"Search start time (UNIX timestamp in seconds, optional, default is 15 minutes ago)"
      • changedInput schema / properties / filterQuery / description
        Previous value: -"ログを検索するためのクエリ文字列(オプション、デフォルトは「*」)"New value: +"Query string to search logs (optional, default is '*')"
      • changedInput schema / properties / filterTo / default
        Previous value: -1745806104.363New value: +1767415483.907
      • changedInput schema / properties / filterTo / description
        Previous value: -"検索終了時間(UNIXタイムスタンプ、秒単位、オプション、デフォルトは現在時刻)"New value: +"Search end time (UNIX timestamp in seconds, optional, default is current time)"
      • changedInput schema / properties / pageCursor / description
        Previous value: -"次のページを取得するためのカーソル(オプション)"New value: +"Cursor to retrieve the next page (optional)"
      • changedInput schema / properties / pageLimit / description
        Previous value: -"取得するログの最大数(オプション、デフォルトは25)"New value: +"Maximum number of logs to retrieve (optional, default is 25)"
    • Changedsearch_spans7 fields changed
      • changedInput schema / properties / filterFrom / default
        Previous value: -1745805204.364New value: +1767414583.907
      • changedInput schema / properties / filterFrom / description
        Previous value: -"検索開始時間(UNIXタイムスタンプ、秒単位、オプション、デフォルトは15分前)"New value: +"Search start time (UNIX timestamp in seconds, optional, default is 15 minutes ago)"
      • changedInput schema / properties / filterQuery / description
        Previous value: -"検索するためのクエリ文字列(オプション、デフォルトは「*」)"New value: +"Query string to search for (optional, default is '*')"
      • changedInput schema / properties / filterTo / default
        Previous value: -1745806104.364New value: +1767415483.907
      • changedInput schema / properties / filterTo / description
        Previous value: -"検索終了時間(UNIXタイムスタンプ、秒単位、オプション、デフォルトは現在時刻)"New value: +"Search end time (UNIX timestamp in seconds, optional, default is current time)"
      • changedInput schema / properties / pageCursor / description
        Previous value: -"次のページを取得するためのカーソル(オプション)"New value: +"Cursor to retrieve the next page (optional)"
      • changedInput schema / properties / pageLimit / description
        Previous value: -"取得するスパンの最大数(オプション、デフォルトは25)"New value: +"Maximum number of spans to retrieve (optional, default is 25)"
  2. 3 tool updates
    • First observedaggregate_spans
    • First observedsearch_logs
    • First observedsearch_spans

TDQS

C2.9/5.0
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
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

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.
    15
    -
  • 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
    18
    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.
    1,106
    1
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/tuno-dev/datadog-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server