This Python-based Datadog MCP server allows you to access your Datadog monitoring data directly through Claude, providing convenient access to monitor states and Kubernetes logs without leaving your AI interface.
To install Datadog for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @didlawowo/mcp-collection --client claude
The following Python packages are needed:
datadog-api-client
fastmcp
loguru
icecream
python-dotenv
uv
Create a .env
file with your Datadog credentials:
DD_API_KEY=your_api_key
DD_APP_KEY=your_app_key
# For macOS
brew install claude-desktop
# Or download from official website
# https://claude.ai/desktop
"Datadog-MCP-Server": {
"command": "uv",
"args": [
"run",
"--with",
"datadog-api-client",
"--with",
"fastmcp",
"--with",
"icecream",
"--with",
"loguru",
"--with",
"python-dotenv",
"fastmcp",
"run",
"/your-path/mcp-collection/datadog/main.py"
],
"env": {
"DD_API_KEY": "xxxx",
"DD_APP_KEY": "xxx"
}
}
The Claude config file is located at: ~/Library/Application\ Support/Claude/claude_desktop_config.json
on macOS.
Retrieve the state of specific monitors:
get_monitor_states(
name: str, # Monitor name to search
timeframe: int = 1 # Hours to look back
)
Example output:
{
"id": "12345678",
"name": "traefik",
"status": "OK",
"query": "avg(last_5m):avg:traefik.response_time{*} > 1000",
"message": "Response time is too high",
"type": "metric alert",
"created": "2024-01-14T10:00:00Z",
"modified": "2024-01-14T15:30:00Z"
}
Fetch logs from your Kubernetes clusters:
get_k8s_logs(
cluster: str, # Kubernetes cluster name
timeframe: int = 5, # Hours to look back
namespace: str = None # Optional namespace filter
)
Example output:
{
"timestamp": "2024-01-14T22:00:00Z",
"host": "worker-1",
"service": "nginx-ingress",
"pod_name": "nginx-ingress-controller-abc123",
"namespace": "default",
"container_name": "controller",
"message": "Connection refused",
"status": "error"
}
API Authentication Errors
Error: (403) Forbidden
➡️ Check your DD_API_KEY and DD_APP_KEY in .env
MCP Connection Issues
Error: Failed to connect to MCP server
➡️ Verify your claude_desktop_config.json path and content
Monitor Not Found
Error: No monitor found with name 'xxx'
➡️ Check monitor name spelling and case sensitivity
For debugging, you can use:
task run-mcp-inspector
This provides real-time view of server status, function call logs, error tracing, and API response monitoring.
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 > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.