{"id":14522,"library":"datadog-mcp-server","title":"Datadog Model Context Protocol Server","description":"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.","status":"active","version":"1.0.9","language":"javascript","source_language":"en","source_url":"https://github.com/GeLi2001/datadog-mcp-server","tags":["javascript","datadog","mcp","model-context-protocol","observability","api"],"install":[{"cmd":"npm install datadog-mcp-server","lang":"bash","label":"npm"},{"cmd":"yarn add datadog-mcp-server","lang":"bash","label":"yarn"},{"cmd":"pnpm add datadog-mcp-server","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"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.","wrong":"import DatadogMCP from 'datadog-mcp-server';","symbol":"runServer","correct":"import { runServer } from 'datadog-mcp-server';"},{"note":"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.","wrong":"import { ServerConfig } from 'datadog-mcp-server';","symbol":"ServerOptions","correct":"import type { ServerOptions } from 'datadog-mcp-server';"},{"note":"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.","wrong":"import { getMonitor } from 'datadog-mcp-server';","symbol":"getMonitorTool","correct":"import { getMonitorTool } from 'datadog-mcp-server/dist/tools';"}],"quickstart":{"code":"import { spawn } from 'child_process';\nimport path from 'path';\n\n// This demonstrates how to programmatically start the datadog-mcp-server CLI.\n// In a typical setup, you would run this server globally or via npx.\n\nconst apiKey = process.env.DD_API_KEY ?? 'your_datadog_api_key';\nconst appKey = process.env.DD_APP_KEY ?? 'your_datadog_app_key';\nconst site = process.env.DD_SITE ?? 'datadoghq.com';\n\nif (apiKey === 'your_datadog_api_key' || appKey === 'your_datadog_app_key') {\n    console.warn(\"WARNING: Using placeholder Datadog API/App keys. Please set DD_API_KEY and DD_APP_KEY environment variables for actual use.\");\n}\n\nconst serverProcess = spawn('npx', [\n  'datadog-mcp-server',\n  '--apiKey', apiKey,\n  '--appKey', appKey,\n  '--site', site\n], {\n  stdio: 'inherit', // Pipe child process stdout/stderr to parent\n  env: process.env, // Inherit environment variables\n  cwd: path.resolve(__dirname), // Ensure context is correct\n});\n\nconsole.log(`Datadog MCP Server started with site: ${site}.`);\nconsole.log('Use Ctrl+C to stop the server.');\n\nserverProcess.on('error', (err) => {\n  console.error('Failed to start Datadog MCP Server:', err);\n});\n\nserverProcess.on('exit', (code) => {\n  console.log(`Datadog MCP Server exited with code ${code}.`);\n});\n\n// Example of how you might stop it programmatically after some time (optional)\n// setTimeout(() => {\n//   console.log('Stopping Datadog MCP Server...');\n//   serverProcess.kill('SIGTERM');\n// }, 60000);","lang":"typescript","description":"Demonstrates how to programmatically launch the `datadog-mcp-server` CLI using `npx` with required Datadog API credentials, showing proper setup and process management."},"warnings":[{"fix":"Ensure your Node.js environment is updated to version 16 or newer. Use `nvm` or `volta` to manage Node.js versions if necessary.","message":"Node.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.","severity":"breaking","affected_versions":">=1.0.0"},{"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.","message":"Datadog 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.","severity":"gotcha","affected_versions":">=1.0.0"},{"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.","message":"Incorrectly 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).","severity":"gotcha","affected_versions":">=1.0.0"},{"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.","message":"As 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.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Upgrade your Node.js installation to version 16 or newer. Check your current version with `node -v`.","cause":"Attempting to run the server with an unsupported Node.js version.","error":"Error: Node.js vX.Y.Z is not supported. Please use Node.js v16 or higher."},{"fix":"Set `DD_API_KEY` and `DD_APP_KEY` environment variables, or pass `--apiKey` and `--appKey` command-line arguments with correct values.","cause":"Missing or invalid Datadog API or Application keys.","error":"Failed to authenticate with Datadog API. Please check your API and Application keys."},{"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.","cause":"Incorrect Datadog site URL or network connectivity issues preventing access to the Datadog API endpoints.","error":"API request failed: Host not found or service unavailable."},{"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.","cause":"Server started without providing the necessary Datadog API or Application key via CLI arguments or environment variables.","error":"Error: Missing required argument: --apiKey"}],"ecosystem":"npm"}