datadog mcp
Datadog MCP 服务器
用于与 Datadog API 交互的模型上下文协议 (MCP) 服务器。
特征
监控:访问监控数据和配置
仪表板:检索和查看仪表板定义
指标:查询可用指标及其元数据
事件:在时间范围内搜索和检索事件
日志:使用高级过滤和排序选项搜索日志
事件:访问事件管理数据
API 集成:与 Datadog 的 v1 和 v2 API 直接集成
全面的错误处理:清晰的 API 和身份验证问题错误消息
服务特定端点:支持日志和指标的不同端点
Related MCP server: Ingero
先决条件
Node.js(版本 16 或更高版本)
Datadog 帐户:
API 密钥 - 在“组织设置”>“API 密钥”中找到
应用程序密钥 - 在“组织设置”>“应用程序密钥”中找到
安装
通过 npm(推荐)
npm install -g datadog-mcp-server来自源
克隆此存储库
安装依赖项:
npm install构建项目:
npm run build
配置
您可以使用环境变量或命令行参数配置 Datadog MCP 服务器。
环境变量
使用您的 Datadog 凭证创建一个.env文件:
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注意: DD_LOGS_SITE和DD_METRICS_SITE是可选的,如果未指定,则默认为DD_SITE的值。
命令行参数
全局站点设置的基本用法:
datadog-mcp-server --apiKey=your_api_key --appKey=your_app_key --site=datadoghq.eu服务特定端点的高级用法:
datadog-mcp-server --apiKey=your_api_key --appKey=your_app_key --site=datadoghq.com --logsSite=logs.datadoghq.com --metricsSite=metrics.datadoghq.com注意:站点参数不需要https:// - 它会自动添加。
区域端点
不同的 Datadog 区域有不同的端点:
美国(默认):
datadoghq.com欧盟:
datadoghq.euUS3(政府云):
ddog-gov.comUS5:
us5.datadoghq.comAP1:
ap1.datadoghq.com
与 Claude Desktop 一起使用
将其添加到您的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)"
]
}
}
}对于具有用于日志和指标的单独端点的更高级配置:
{
"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>"
]
}
}
}Claude 桌面配置文件的位置:
MacOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%/Claude/claude_desktop_config.json
与 MCP Inspector 一起使用
要与 MCP Inspector 工具一起使用:
npx @modelcontextprotocol/inspector datadog-mcp-server --apiKey=your_api_key --appKey=your_app_key可用工具
该服务器提供以下 MCP 工具:
get-monitors :获取带有可选过滤的监视器
get-monitor :通过 ID 获取特定监视器的详细信息
get-dashboards :列出所有仪表板
get-dashboard :通过 ID 获取特定仪表板
get-metrics :列出可用指标
get-metric-metadata :获取特定指标的元数据
get-events :获取时间范围内的事件
get-incidents :列出带有可选过滤的事件
search-logs :使用高级查询过滤搜索日志
聚合日志:对日志数据进行分析和聚合
示例
示例:获取监视器
{
"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"
}
}
]
}
}
}示例:获取事件
{
"method": "tools/call",
"params": {
"name": "get-incidents",
"arguments": {
"includeArchived": false,
"query": "state:active",
"pageSize": 10
}
}
}故障排除
如果遇到 403 Forbidden 错误,请验证:
您的 API 密钥和应用程序密钥正确
这些密钥具有访问所请求资源的必要权限
您的帐户有权访问所请求的数据
您正在使用适合您所在地区的正确端点(例如,欧盟客户使用
datadoghq.eu)
调试
如果遇到问题,请检查 Claude Desktop 的 MCP 日志:
# 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常见问题:
403 禁止:Datadog API 密钥的身份验证问题
API 密钥或应用密钥格式无效:请确保您使用的是完整的密钥字符串
站点配置错误:确保您使用的是正确的 Datadog 域
端点不匹配:如果您对日志和指标使用单独的域,请验证特定于服务的端点是否正确设置
执照
麻省理工学院
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
- Flicense-qualityDmaintenanceAutomatically tracks and logs all client-agent conversations in real-time without user intervention. Provides conversation history, analytics, weather tools, and continuous system health monitoring with complete request-response pair recording.
- AlicenseAqualityAmaintenanceeBPF-based GPU causal observability agent with MCP server. Traces CUDA Runtime and Driver APIs via kernel uprobes and host events via tracepoints to build causal chains explaining GPU latency. 7 tools: get_check, get_trace_stats, get_causal_chains, get_stacks, run_demo, get_test_report, run_sql. Telegraphic compression reduces token usage ~60%. Supports stdio and HTTPS (TLS 1.3) transport.1184
- Alicense-qualityDmaintenanceMCP server for tracing, logging, and debugging multi-agent systems by capturing sessions, spans, and events in a queryable trace tree.1MIT
- Alicense-qualityCmaintenanceTracks a user's activity by trace ID from application logs stored in ClickHouse. Provides tools for log timeline, trace summaries, and search across services.32MIT
Related MCP Connectors
Investigate errors, track deployments, analyze performance, and manage application monitoring
An inter-agent graffiti wall for one completely optional trace.
Real-time health monitoring and heartbeat tracking for agent services
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/GeLi2001/datadog-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server