datadog-mcp-server
by GeLi2001
MCP server interacts with the official Datadog API
What is datadog-mcp-server
Datadog MCP Server
A Model Context Protocol (MCP) server for interacting with the Datadog API.
Features
- Monitoring: Access monitor data and configurations
- Dashboards: Retrieve and view dashboard definitions
- Metrics: Query available metrics and their metadata
- Events: Search and retrieve events within timeframes
- Logs: Search logs with advanced filtering and sorting options
- Incidents: Access incident management data
- API Integration: Direct integration with Datadog's v1 and v2 APIs
- Comprehensive Error Handling: Clear error messages for API and authentication issues
Prerequisites
- Node.js (version 16 or higher)
- Datadog account with:
- API key - Found in Organization Settings > API Keys
- Application key - Found in Organization Settings > Application Keys
Installation
Via npm (recommended)
npm install -g datadog-mcp-server
From Source
- Clone this repository
- Install dependencies:
npm install
- Build the project:
npm run build
Configuration
You can configure the Datadog MCP server using either environment variables or command-line arguments.
Environment Variables
Create a .env
file with your Datadog credentials:
DD_API_KEY=your_api_key_here
DD_APP_KEY=your_app_key_here
DD_SITE=datadoghq.com
Command-line Arguments
datadog-mcp-server --apiKey=your_api_key --appKey=your_app_key --site=datadoghq.eu
Note: The site argument doesn't need https://
- it will be added automatically.
Usage with Claude Desktop
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)"
]
}
}
}
Locations for the Claude Desktop config file:
- MacOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
%APPDATA%/Claude/claude_desktop_config.json
Usage with MCP Inspector
To use with the MCP Inspector tool:
npx @modelcontextprotocol/inspector datadog-mcp-server --apiKey=your_api_key --appKey=your_app_key
Available Tools
The server provides these MCP tools:
- get-monitors: Fetch monitors with optional filtering
- get-monitor: Get details of a specific monitor by ID
- get-dashboards: List all dashboards
- get-dashboard: Get a specific dashboard by ID
- get-metrics: List available metrics
- get-metric-metadata: Get metadata for a specific metric
- get-events: Fetch events within a time range
- get-incidents: List incidents with optional filtering
- search-logs: Search logs with advanced query filtering
- aggregate-logs: Perform analytics and aggregations on log data
Examples
Example: Get Monitors
{
"method": "tools/call",
"params": {
"name": "get-monitors",
"arguments": {
"groupStates": ["alert", "warn"],
"limit": 5
}
}
}
Example: Get a Dashboard
{
"method": "tools/call",
"params": {
"name": "get-dashboard",
"arguments": {
"dashboardId": "abc-def-123"
}
}
}
Example: Search Logs
{
"method": "tools/call",
"params": {
"name": "search-logs",
"arguments": {
"filter": {
"query": "service:web-app status:error",
"from": "now-15m",
"to": "now"
},
"sort": "-timestamp",
"limit": 20
}
}
}
Example: Aggregate Logs
{
"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"
}
}
]
}
}
}
Example: Get Incidents
{
"method": "tools/call",
"params": {
"name": "get-incidents",
"arguments": {
"includeArchived": false,
"query": "state:active",
"pageSize": 10
}
}
}
Troubleshooting
If you encounter a 403 Forbidden error, verify that:
- Your API key and Application key are correct
- The keys have the necessary permissions to access the requested resources
- Your account has access to the requested data
Debugging
If you encounter issues, 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:
- 403 Forbidden: Authentication issue with Datadog API keys
- API key or App key format invalid: Ensure you're using the full key strings
- Site configuration errors: Make sure you're using the correct Datadog domain
License
MIT
Leave a Comment
Comments section will be available soon. Stay tuned!
Frequently Asked Questions
What is MCP?
MCP (Model Context Protocol) is an open protocol that standardizes how applications provide context to LLMs. Think of MCP like a USB-C port for AI applications, providing a standardized way to connect AI models to different data sources and tools.
What are MCP Servers?
MCP Servers are lightweight programs that expose specific capabilities through the standardized Model Context Protocol. They act as bridges between LLMs like Claude and various data sources or services, allowing secure access to files, databases, APIs, and other resources.
How do MCP Servers work?
MCP Servers follow a client-server architecture where a host application (like Claude Desktop) connects to multiple servers. Each server provides specific functionality through standardized endpoints and protocols, enabling Claude to access data and perform actions through the standardized protocol.
Are MCP Servers secure?
Yes, MCP Servers are designed with security in mind. They run locally with explicit configuration and permissions, require user approval for actions, and include built-in security features to prevent unauthorized access and ensure data privacy.
Related MCP Servers
Ableton Live MCP Server
MCP Server implementation for Ableton Live OSC control
Airbnb MCP Server
AI Agent Marketplace Index Search MCP Server
MCP Server for AI Agent Marketplace Index from DeepNLP
Algorand MCP Implementation
Algorand Model Context Protocol (Server & Client)
mcp-server-apache-airflow
pypi.org/project/mcp-server-apache-airflow/
airtable-mcp-server
๐๏ธ๐ค Airtable Model Context Protocol Server, for allowing AI systems to interact with your Airtable bases
Airtable MCP Server
Search, create and update Airtable bases, tables, fields, and records using Claude Desktop and MCP (Model Context Protocol) clients
Alphavantage MCP Server
A MCP server for the stock market data API, Alphavantage API.
Amadeus MCP Server
Amadeus MCP(Model Context Protocol) Server
Anki MCP Server
An MCP server for Anki
Submit Your MCP Server
Share your MCP server with the community
Submit Now