The Datadog MCP Server provides a Model Context Protocol implementation for interacting with the Datadog API, giving access to monitors, dashboards, metrics, events, logs, and incidents from your Datadog environment through a standardized protocol.
npm install -g datadog-mcp-server
# Clone the repository
# Install dependencies
npm install
# Build the project
npm run build
Configure the server using environment variables or command-line arguments.
Create a .env
file with your credentials:
DD_API_KEY=your_api_key_here
DD_APP_KEY=your_app_key_here
DD_SITE=datadoghq.com
DD_LOGS_SITE=datadoghq.com
DD_METRICS_SITE=datadoghq.com
Note: DD_LOGS_SITE
and DD_METRICS_SITE
are optional and default to DD_SITE
if not specified.
Basic usage with global site setting:
datadog-mcp-server --apiKey=your_api_key --appKey=your_app_key --site=datadoghq.eu
Advanced usage with service-specific endpoints:
datadog-mcp-server --apiKey=your_api_key --appKey=your_app_key --site=datadoghq.com --logsSite=logs.datadoghq.com --metricsSite=metrics.datadoghq.com
Different Datadog regions have different endpoints:
datadoghq.com
datadoghq.eu
ddog-gov.com
us5.datadoghq.com
ap1.datadoghq.com
Add this to your claude_desktop_config.json
:
{
"mcpServers": {
"datadog": {
"command": "npx",
"args": [
"datadog-mcp-server",
"--apiKey",
"<YOUR_API_KEY>",
"--appKey",
"<YOUR_APP_KEY>",
"--site",
"<YOUR_DD_SITE>(e.g us5.datadoghq.com)"
]
}
}
}
For advanced configurations with separate endpoints:
{
"mcpServers": {
"datadog": {
"command": "npx",
"args": [
"datadog-mcp-server",
"--apiKey",
"<YOUR_API_KEY>",
"--appKey",
"<YOUR_APP_KEY>",
"--site",
"<YOUR_DD_SITE>",
"--logsSite",
"<YOUR_LOGS_SITE>",
"--metricsSite",
"<YOUR_METRICS_SITE>"
]
}
}
}
Config file locations:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%/Claude/claude_desktop_config.json
npx @modelcontextprotocol/inspector datadog-mcp-server --apiKey=your_api_key --appKey=your_app_key
The server provides these MCP tools:
{
"method": "tools/call",
"params": {
"name": "get-monitors",
"arguments": {
"groupStates": ["alert", "warn"],
"limit": 5
}
}
}
{
"method": "tools/call",
"params": {
"name": "get-dashboard",
"arguments": {
"dashboardId": "abc-def-123"
}
}
}
{
"method": "tools/call",
"params": {
"name": "search-logs",
"arguments": {
"filter": {
"query": "service:web-app status:error",
"from": "now-15m",
"to": "now"
},
"sort": "-timestamp",
"limit": 20
}
}
}
{
"method": "tools/call",
"params": {
"name": "aggregate-logs",
"arguments": {
"filter": {
"query": "service:web-app",
"from": "now-1h",
"to": "now"
},
"compute": [
{
"aggregation": "count"
}
],
"groupBy": [
{
"facet": "status",
"limit": 10,
"sort": {
"aggregation": "count",
"order": "desc"
}
}
]
}
}
}
If you encounter a 403 Forbidden error, verify that:
Check Claude Desktop's MCP logs:
# On macOS
tail -n 20 -f ~/Library/Logs/Claude/mcp*.log
# On Windows
Get-Content -Path "$env:APPDATA\Claude\Logs\mcp*.log" -Tail 20 -Wait
Common issues:
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "datadog" '{"command":"npx","args":["datadog-mcp-server","--apiKey","<YOUR_API_KEY>","--appKey","<YOUR_APP_KEY>","--site","<YOUR_DD_SITE>(e.g us5.datadoghq.com)"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"datadog": {
"command": "npx",
"args": [
"datadog-mcp-server",
"--apiKey",
"<YOUR_API_KEY>",
"--appKey",
"<YOUR_APP_KEY>",
"--site",
"<YOUR_DD_SITE>(e.g us5.datadoghq.com)"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"datadog": {
"command": "npx",
"args": [
"datadog-mcp-server",
"--apiKey",
"<YOUR_API_KEY>",
"--appKey",
"<YOUR_APP_KEY>",
"--site",
"<YOUR_DD_SITE>(e.g us5.datadoghq.com)"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect