Registry / observability / datadog-mcp-server

datadog-mcp-server

JSON →
library1.0.9jsnpmunverified

The `datadog-mcp-server` package provides a Model Context Protocol (MCP) server designed to interface with the Datadog API. Currently at version 1.0.9, this server acts as a comprehensive gateway for accessing various Datadog resources including monitors, dashboards, metrics, events, logs, and incidents. It offers direct integration with both Datadog's v1 and v2 APIs, featuring robust error handling and support for service-specific endpoints across different Datadog regional sites. The server is primarily distributed as a command-line interface (CLI) tool, configured via environment variables or CLI arguments, and is intended to run as a background service or be invoked by other MCP-compatible tools like Claude Desktop or MCP Inspector. Its main differentiator is providing a standardized MCP interface over the extensive Datadog API.

npm install datadog-mcp-server
INSTALL
IMPORT
SIG · DATADOG-MCP-SERVER
D
datadog-mcp-server
observabilityjavascriptv1.0.9
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

runServer
import { runServer } from 'datadog-mcp-server';
import DatadogMCP from 'datadog-mcp-server';
This package is primarily a command-line interface (CLI) server. Direct programmatic import of its main execution function, like `runServer`, is not its primary use case, but such a function might be exported for advanced scenarios or testing. Developers typically run it via `npx` or a global install.
ServerOptions
import type { ServerOptions } from 'datadog-mcp-server';
import { ServerConfig } from 'datadog-mcp-server';
While the server is configured via environment variables or CLI arguments, advanced users might interact with its underlying configuration types, such as `ServerOptions`, if extending or wrapping the server programmatically. This is not a common developer pattern.
getMonitorTool
import { getMonitorTool } from 'datadog-mcp-server/dist/tools';
import { getMonitor } from 'datadog-mcp-server';
The Datadog MCP server exposes various 'tools' (e.g., `get-monitor`, `get-dashboards`) via the Model Context Protocol. While these are consumed by MCP clients, internal implementations like `getMonitorTool` might be exposed for programmatic use from a subpath (e.g., `dist/tools`), though this is not documented as a primary public API.

Demonstrates how to programmatically launch the `datadog-mcp-server` CLI using `npx` with required Datadog API credentials, showing proper setup and process management.

import { spawn } from 'child_process'; import path from 'path'; // This demonstrates how to programmatically start the datadog-mcp-server CLI. // In a typical setup, you would run this server globally or via npx. const apiKey = process.env.DD_API_KEY ?? 'your_datadog_api_key'; const appKey = process.env.DD_APP_KEY ?? 'your_datadog_app_key'; const site = process.env.DD_SITE ?? 'datadoghq.com'; if (apiKey === 'your_datadog_api_key' || appKey === 'your_datadog_app_key') { console.warn("WARNING: Using placeholder Datadog API/App keys. Please set DD_API_KEY and DD_APP_KEY environment variables for actual use."); } const serverProcess = spawn('npx', [ 'datadog-mcp-server', '--apiKey', apiKey, '--appKey', appKey, '--site', site ], { stdio: 'inherit', // Pipe child process stdout/stderr to parent env: process.env, // Inherit environment variables cwd: path.resolve(__dirname), // Ensure context is correct }); console.log(`Datadog MCP Server started with site: ${site}.`); console.log('Use Ctrl+C to stop the server.'); serverProcess.on('error', (err) => { console.error('Failed to start Datadog MCP Server:', err); }); serverProcess.on('exit', (code) => { console.log(`Datadog MCP Server exited with code ${code}.`); }); // Example of how you might stop it programmatically after some time (optional) // setTimeout(() => { // console.log('Stopping Datadog MCP Server...'); // serverProcess.kill('SIGTERM'); // }, 60000);
mcp-server-datadog --version
Debug
Known issues
breakingNode.js version 16 or higher is a prerequisite for running `datadog-mcp-server`. Older Node.js versions will prevent the server from starting or cause unexpected runtime errors.
fix
Ensure your Node.js environment is updated to version 16 or newer. Use `nvm` or `volta` to manage Node.js versions if necessary.
affects: >=1.0.0
gotchaDatadog API and Application keys are mandatory for server operation. Running the server without valid keys, either via environment variables (`DD_API_KEY`, `DD_APP_KEY`) or command-line arguments (`--apiKey`, `--appKey`), will result in authentication failures and prevent any interaction with the Datadog API.
fix
Provide valid `DD_API_KEY` and `DD_APP_KEY` from your Datadog organization settings. For production, use environment variables; for testing, command-line arguments are acceptable.
affects: >=1.0.0
gotchaIncorrectly specifying the Datadog regional site (e.g., `--site`, `DD_SITE`) can lead to connectivity issues or data not being found, even with valid API keys. The default is `datadoghq.com` (US).
fix
Verify your Datadog account's region and set the `DD_SITE` environment variable or `--site` argument accordingly (e.g., `datadoghq.eu`, `us5.datadoghq.com`). Also consider `DD_LOGS_SITE` and `DD_METRICS_SITE` for specific endpoints if needed.
affects: >=1.0.0
gotchaAs a server process, `datadog-mcp-server` will continuously run and consume system resources (CPU, memory, network). It must be properly managed (e.g., via `systemd`, `pm2`, or `docker`) for production deployments to ensure uptime and resource efficiency.
fix
For production environments, deploy the server using process managers like PM2, systemd, or containerize it with Docker to ensure reliable operation, automatic restarts, and resource limits.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Node.js vX.Y.Z is not supported. Please use Node.js v16 or higher.
Attempting to run the server with an unsupported Node.js version.
fix
Upgrade your Node.js installation to version 16 or newer. Check your current version with `node -v`.
Failed to authenticate with Datadog API. Please check your API and Application keys.
Missing or invalid Datadog API or Application keys.
fix
Set `DD_API_KEY` and `DD_APP_KEY` environment variables, or pass `--apiKey` and `--appKey` command-line arguments with correct values.
API request failed: Host not found or service unavailable.
Incorrect Datadog site URL or network connectivity issues preventing access to the Datadog API endpoints.
fix
Verify the `--site` argument or `DD_SITE` environment variable is set to the correct regional endpoint (e.g., `datadoghq.com`, `datadoghq.eu`). Check network connectivity to Datadog's API.
Error: Missing required argument: --apiKey
Server started without providing the necessary Datadog API or Application key via CLI arguments or environment variables.
fix
Include both `--apiKey=<YOUR_API_KEY>` and `--appKey=<YOUR_APP_KEY>` in your command-line arguments, or ensure `DD_API_KEY` and `DD_APP_KEY` are set in your environment.
Upgrade
Version history
1.0.9latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
15 hits · last 30 days
node
12
OpenAI (training)
2
Resources
datadog-mcp-server — npm install datadog-mcp-server · libregistry