MCP Datadog Server
Provides tools for querying metrics, logs, events, monitors, and APM traces from the Datadog platform.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Datadog ServerWhat's the CPU usage on production?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Datadog Server
A Model Context Protocol (MCP) server that exposes Datadog APIs to AI assistants and code editors via tools.
Overview
The server provides MCP tools for:
Metrics – Query metrics, metadata, list metrics
Logs – Search logs, get log details, aggregate logs
Events – Search events, get event details
Monitors – List monitors, get status, search monitors
APM/Traces – Query traces, service health, service dependencies
Services – Service dependencies (single and multi-environment)
Related MCP server: MCP Datadog Server
Quick Start
Prerequisites
Node.js 22+
npm
Run with npx (recommended)
No clone or install needed. Add the server to your MCP client (e.g. Cursor, Claude) using stdio and run it from GitHub:
{
"datadog": {
"type": "stdio",
"command": "npx",
"args": ["-y", "github:micaelmalta/mcp-server-datadog"],
"env": {
"DATADOG_API_KEY": "your_api_key",
"DATADOG_APP_KEY": "your_app_key"
}
}
}Set DATADOG_API_KEY and DATADOG_APP_KEY (and optionally DATADOG_SITE, default datadoghq.com). Restart the client so the tools appear.
To try from the terminal:
DATADOG_API_KEY=your_key DATADOG_APP_KEY=your_app_key npx -y github:micaelmalta/mcp-server-datadogRun from source
For development or a fixed install:
git clone https://github.com/micaelmalta/mcp-server-datadog.git
cd mcp-server-datadog
npm install
cp .env.example .envEdit .env and set DATADOG_API_KEY and DATADOG_APP_KEY. Then:
npm start
# or with NODE_ENV=local: npm run devIn your MCP config, use stdio with node and the path to the entry point:
{
"datadog": {
"type": "stdio",
"command": "node",
"args": ["/path/to/mcp-server-datadog/src/index.js"],
"env": {
"DATADOG_API_KEY": "your_api_key",
"DATADOG_APP_KEY": "your_app_key"
}
}
}Tools
Tool | Purpose |
| Query metrics data |
| Get metric metadata |
| List metrics |
| Search logs with filter |
| Get a single log by ID |
| Aggregate logs |
| Search events |
| Get event by ID |
| List monitors |
| Get monitor status |
| Search monitors |
| Query APM traces |
| Service health metrics |
| Service dependencies |
| Dependencies across environments |
Example prompts: "Show error logs from service X in the last hour" → search_logs. "What's CPU usage on production?" → query_metrics. "How is the API service doing?" → get_service_health.
Time ranges: Use ISO 8601 or Unix timestamps (seconds for metrics/events, milliseconds for logs/APM). Filters: Datadog syntax, e.g. service:api, status:error, env:production.
Project structure
mcp_datadog/
├── src/
│ ├── clients/ # Datadog API clients (SDK-based)
│ ├── tools/ # MCP tool definitions and handlers
│ ├── utils/ # Environment, errors, logger, toolErrors
│ └── index.js # Server entry point
├── test/ # Vitest tests and fixtures
│ ├── benchmark/ # Tool handler benchmarks (mocked)
│ ├── mocks/ # Datadog SDK mocks
│ └── ...
├── docs/ # Additional documentation
└── package.jsonTech stack: Node.js 22+, JavaScript (ESM), JSDoc, Vitest, ESLint, Prettier, @modelcontextprotocol/sdk, @datadog/datadog-api-client.
Development
Commands
Command | Description |
| Run server |
| Run with NODE_ENV=local |
| Run tests |
| Tests in watch mode |
| Tests with coverage |
| E2E tests (real Datadog API; see below) |
| Run tool-handler benchmark (mocked) |
| Lint |
| Fix lint issues |
| Format with Prettier |
| Check formatting (used in CI) |
| Lint + test |
API client pattern
Clients return { data, error }:
const { data, error } = await client.queryMetrics(query, from, to);
if (error) {
console.error(error.message, error.statusCode);
} else {
console.log(data);
}CI
GitHub Actions (.github/workflows/ci.yml) runs on push and pull requests to main/master: format check (prettier --check), lint (ESLint), and tests. Same commands locally: npm run format:check && npm run lint && npm test.
Testing
Tests use Vitest with mocked Datadog SDK (test/mocks/datadogApi.js) and fixtures in test/fixtures/. Run npm test before committing.
E2E tests (test/e2e/) run against the real Datadog API. They are skipped unless RUN_E2E=1 and real DATADOG_API_KEY/DATADOG_APP_KEY are set in .env. Example: RUN_E2E=1 npm run test:e2e. Use this to verify that document-center production error logs are visible (e.g. logsDocumentCenter.e2e.test.js).
Operational notes
Logging: Tool calls are logged to stderr as JSON lines (
tool,durationMs,slow). Optional: setMCP_SLOW_TOOL_MS(default 2000) to mark slow calls. Some clients also write tomcp_datadog.log(seesrc/utils/logger.js).Rate limiting: The server does not rate limit; high tool usage can hit Datadog API limits.
Troubleshooting: Tools missing → check MCP config and env vars, restart client. 403/404 → permissions or plan. See Troubleshooting for "no data" cases.
Troubleshooting
Search returns 0 logs but I expect data
If search_logs (or aggregate_logs) returns no results for a service you know has traffic:
Same Datadog org – The MCP server uses
DATADOG_API_KEY,DATADOG_APP_KEY, and optionallyDATADOG_SITE. Ensure these point to the same Datadog org and site where your app (e.g. document-center) sends logs.Compare in Datadog – In Datadog Logs Explorer, run the same filter and time range (e.g.
service:document-center env:production status:error, last 7 days). If you see logs there but not via MCP, the env/site or keys are likely different.Exact filter syntax – Confirm the attribute names and values your app sends (e.g.
service,env,status). Try withoutenv:productionor withenv:prod, or search onlyservice:document-centerto see if any logs appear.Retention and indexes – Logs must be in an index that your API key can read; check log indexes and retention.
Documentation
README (this file) – Setup, usage, structure.
CLAUDE.md – Project conventions and patterns for contributors.
docs/ – Additional guides (e.g. performance, security) when present.
Contributing
Follow existing style (
npm run lint,npm run format).Add tests for new behavior.
Run
npm run validatebefore committing.Use conventional commits:
feat,fix,docs,chore,refactor,test.
Links
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityDmaintenanceEnables AI assistants to interact with DataDog's observability platform through a standardized interface. Supports monitoring infrastructure, managing events, analyzing logs and metrics, and automating operations like alerts and downtimes.Last updated1MIT
- AlicenseCqualityCmaintenanceEnables interaction with Datadog APIs through automatically generated tools from Postman collections. Supports monitoring operations, log management, metrics submission, and other Datadog functionality through natural language.Last updated10065Apache 2.0
- Alicense-qualityDmaintenanceEnables interaction with Datadog APIs through natural language, supporting full CRUD operations on metrics, monitors, dashboards, logs, infrastructure, and more.Last updated4MIT
- Alicense-qualityDmaintenanceEnables AI assistants to interact with Datadog's observability platform via natural language, covering metrics, logs, APM, monitors, dashboards, incidents, and infrastructure.Last updated8681MIT
Related MCP Connectors
Gateway between LLM agents and world data through eight tools and a bundled endpoint catalog.
Provides AI assistants with direct access to Mapbox developer APIs and documentation.
Connect your AI assistants to Keboola and expose your data, transformations, SQL queries, ...
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/micaelmalta/mcp-server-datadog'
If you have feedback or need assistance with the MCP directory API, please join our Discord server