Dynatrace MCP Server

MIT License
113
32

Integrations

  • Enables real-time observability data access from Dynatrace, allowing users to fetch problem details, security vulnerabilities, execute DQL queries, retrieve logs and metrics, analyze Kubernetes cluster events, and set up notifications via Slack and Dynatrace AutomationEngine.

  • Provides tools for monitoring Kubernetes clusters, retrieving problem details from services, and analyzing cluster events to troubleshoot deployment issues.

  • Allows sending notification messages to Slack channels via a Slack Connector, supporting features like alerting on availability problems and security vulnerabilities.

Dynatrace MCP 服务器

此远程 MCP 服务器允许与Dynatrace可观测性平台进行交互。将实时可观测性数据直接引入您的开发工作流程。

用例

  • 实时可观察性,获取生产级数据以便早期检测。
  • 从监控的异常、日志和异常中修复上下文中的问题。
  • 有关安全级别问题的更多背景信息
  • 使用自然语言查询日志数据

功能

  • 列出并获取服务(例如 Kubernetes)的问题详细信息
  • 列出并获取安全问题/漏洞详细信息
  • 执行 DQL(Dynatrace 查询语言),例如获取事件或日志
  • 发送 Slack 消息(通过 Slack Connector)
  • 设置通知工作流(通过 Dynatrace AutomationEngine
  • 获取实体的所有权

快速入门

正在进行的工作

您可以通过包@dynatrace-oss/dynatrace-mcp-server将此 MCP 服务器(使用 STDIO)添加到您的 MCP 客户端,如 VS Code、Claude、Cursor、Windsurf Github Copilot。

VS 代码

{ "servers": { "npx-dynatrace-mcp-server": { "command": "npx", "args": ["-y", "@dynatrace-oss/dynatrace-mcp-server@latest"], "envFile": "${workspaceFolder}/.env" } } }

克劳德桌面

{ "mcpServers": { "mobile-mcp": { "command": "npx", "args": ["-y", "@dynatrace-oss/dynatrace-mcp-server@latest"], "env": { "OAUTH_CLIENT_ID": "", "OAUTH_CLIENT_SECRET": "", "DT_ENVIRONMENT": "" } } } }

环境变量

您需要一个Dynatrace OAuth 客户端才能与您的 Dynatrace 环境进行通信。请参考Dynatrace OAuth 客户端文档,并设置以下环境变量以确保此 MCP 正常工作:

  • DT_ENVIRONMENT (字符串,例如https://abcd1234.apps.dynatrace.com )- 您的 Dynatrace 平台的 URL
  • OAUTH_CLIENT_ID (字符串,例如dt0s02.SAMPLE )- Dynatrace OAuth 客户端 ID
  • OAUTH_CLIENT_SECRET (字符串,例如dt0s02.SAMPLE.abcd1234 )- Dynatrace OAuth 客户端密钥
  • OAuth 客户端范围:
    • app-engine:apps:run - environmentInformationClient 所需
    • app-engine:functions:run - environmentInformationClient 所需
    • hub:catalog:read - 获取有关 Dynatrace 环境中已安装应用程序的详细信息
    • environment-api:security-problems:read - 需要读取安全问题
    • environment-api:entities:read - 读取受监控的实体
    • environment-api:problems:read - 获取问题
    • environment-api:metrics:read - 读取指标
    • environment-api:slo:read - 读取 SLO
    • settings:objects:read - 需要从设置中读取所有权信息和守护者(SRG)
    • storage:buckets:read - 读取存储在 Grail 上的所有系统数据
    • storage:logs:read - 读取日志以进行可靠性守护验证
    • storage:metrics:read - 读取可靠性守护验证的指标
    • storage:bizevents:read - 读取 bizevents 以进行可靠性守护验证
    • storage:spans:read - 从 Grail 读取跨度
    • storage:entities:read - 从 Grail 读取实体
    • storage:system:read - 从 Grail 读取系统数据
    • storage:user.events:read - 从 Grail 读取用户事件
    • storage:user.sessions:read - 从 Grail 读取用户会话

此外,根据您使用的功能,可以配置以下变量:

  • SLACK_CONNECTION_ID (字符串) - Slack 连接的连接 ID
  • USE_APP_SETTINGS (布尔值, truefalse ;默认值: false
    • 需要范围app-settings:objects:read从应用程序设置中读取设置对象
  • USE_WORKFLOWS (布尔值, truefalse ;默认值: false
    • 需要范围automation:workflows:readautomation:workflows:writeautomation:workflows:run来读取、写入和执行工作流

✨ 示例提示 ✨

使用这些示例提示作为起点。只需将它们复制到您的 IDE 或代理设置中,使其适应您的服务/堆栈/架构,并根据需要进行扩展即可。它们可以帮助您想象实时可观察性和自动化如何在 IDE 中的 MCP 环境中协同工作。

查找生产中的开放漏洞,设置警报。

I have this code snippet here in my IDE, where I get a dependency vulnerability warning for my code. Check if I see any open vulnerability/cve on production. Analyze a specific production problem. Setup a workflow that sends Slack alerts to the #devops-alerts channel when availability problems occur.

调试间歇性 503 错误。

Our load balancer is intermittently returning 503 errors during peak traffic. Pull all recent problems detected for our front-end services and run a query to correlate error rates with service instance health indicators. I suspect we have circuit breakers triggering, but need confirmation from the telemetry data.

将内存问题与日志关联起来。

There's a problem with high memory usage on one of our hosts. Get the problem details and then fetch related logs to help understand what's causing the memory spike? Which file in this repo is this related to?

跟踪请求流程分析。

Our users are experiencing slow checkout processes. Can you execute a DQL query to show me the full request trace for our checkout flow, so I can identify which service is causing the bottleneck?

分析 Kubernetes 集群事件。

Our application deployments seem to be failing intermittently. Can you fetch recent events from our "production-cluster" to help identify what might be causing these deployment issues?

发展

出于开发目的,您可以使用 VSCode 和 GitHub Copilot。

首先,为您的工作区.vscode/settings.json启用 Copilot:

{ "github.copilot.enable": { "*": true } }

其次,将 MCP 添加到.vscode/mcp.json

{ "servers": { "my-dynatrace-mcp-server": { "command": "node", "args": [ "${workspaceFolder}/dist/index.js" ], "envFile": "${workspaceFolder}/.env" } } }

第三,在此存储库中创建一个.env文件(您可以从.env.template复制)并按照上述说明配置环境变量。

最后但同样重要的是,切换到 CoPilot 中的代理模式并重新加载工具。

笔记

Dynatrace 未正式支持此产品。如果您有功能请求、疑问或需要帮助,请通过GitHub Issues联系我们。

-
security - not tested
A
license - permissive license
-
quality - not tested

远程 MCP 服务器可与 Dynatrace 可观察性平台进行实时交互,将生产级监控数据直接引入开发工作流程。

  1. 用例
    1. 功能
      1. 快速入门
        1. 环境变量
          1. ✨ 示例提示 ✨
            1. 发展
              1. 笔记

                Related MCP Servers

                • -
                  security
                  A
                  license
                  -
                  quality
                  MCP server for interacting with Prometheus metrics and data.
                  Last updated -
                  8
                  JavaScript
                  MIT License
                  • Apple
                • -
                  security
                  F
                  license
                  -
                  quality
                  A configurable MCP server that dynamically loads capabilities from a remote configuration to bridge MCP clients with remote APIs for executing actions, accessing resources, and utilizing prompt templates.
                  Last updated -
                  1,261
                  4
                  TypeScript
                • A
                  security
                  A
                  license
                  A
                  quality
                  The MCP server provides an interface to the Datadog API, enabling seamless management of incidents, monitoring, logs, dashboards, metrics, traces, and hosts. Its extensible design allows easy integration of additional Datadog APIs for future expansions.
                  Last updated -
                  14
                  322
                  36
                  TypeScript
                  Apache 2.0
                  • Apple
                • A
                  security
                  F
                  license
                  A
                  quality
                  An MCP server implementation that enables interaction with the Unstructured API, providing tools to list, create, update, and manage sources, destinations, and workflows.
                  Last updated -
                  39
                  25
                  • Apple

                View all related MCP servers

                ID: 3pwqt25s6z