Skip to content
Back to search

dynatrace-mcp

MCP server for Dynatrace Observability

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/dynatrace-oss--dynatrace-mcp/badge.svg)](/listings/dynatrace-oss--dynatrace-mcp)

HTML

<a href="/listings/dynatrace-oss--dynatrace-mcp"><img src="/api/listings/dynatrace-oss--dynatrace-mcp/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

You can add this MCP server to your MCP Client like VSCode, Claude, Cursor, Amazon Q, Windsurf, ChatGPT, or Github Copilot via the command is `npx -y @dynatrace-oss/dynatrace-mcp-server` (type: `stdio`). For more details, please refer to the [configuration section below](#configuration).

Furthermore, you need to configure the URL to a Dynatrace environment:

- `DT_ENVIRONMENT` (string, e.g., `https://abc12345.apps.dynatrace.com`) - URL to your Dynatrace Platform (do not use Dynatrace classic URLs like `abc12345.live.dynatrace.com`)

Authentication will be handled via Authorization Code Flow in your browser, you don't need to define a Platform Token nor an OAuth Client to get started. After the initial authentication, your token is securely stored in the **OS keychain** (macOS Keychain, Windows Credential Manager, or Linux Secret Service) and reused on subsequent server starts, so the browser only opens once per token lifetime.

If you are running in a headless/container environment where the OS keychain is unavailable, set `DT_MCP_TOKEN_STORAGE=file` to persist tokens in `~/.config/dynatrace-mcp/` instead.

Once you are done, we recommend looking into [example prompts](#-example-prompts-), like `Get all details of the entity 'my-service'` or `Show me error logs`. Please mind that these prompts lead to executing DQL statements which may incur [costs](#costs) in accordance to your licence.

**VSCode**

{
  "servers": {
    "npx-dynatrace-mcp-server": {
      "command": "npx",
      "args": ["-y", "@dynatrace-oss/dynatrace-mcp-server@latest"],
      "env": {
        "DT_ENVIRONMENT": "https://abc12345.apps.dynatrace.com"
      }
    }
  }
}

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 557 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # Dynatrace MCP Server
  2. [![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/dynatrace-oss/dynatrace-ai-agent-instrumentation-examples/badge)](https://scorecard.dev/viewer/?uri=github.com/dynatrace-oss/dynatrace-mcp)
  3. <h4 align="center">
  4. <a href="https://github.com/dynatrace-oss/dynatrace-mcp/releases">
  5. <img src="https://img.shields.io/github/release/dynatrace-oss/dynatrace-mcp" />
  6. </a>
  7. <a href="https://github.com/dynatrace-oss/dynatrace-mcp/blob/main/LICENSE">
  8. <img src="https://img.shields.io/badge/license-mit-blue.svg" alt="Dynatrace MCP Server is released under the MIT License" />
  9. </a>
  10. <a href="https://vscode.dev/redirect/mcp/install?name=dynatrace-mcp-server&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40dynatrace-oss%2Fdynatrace-mcp-server%22%5D%2C%22env%22%3A%7B%7D%7D">
  11. <img src="https://img.shields.io/badge/Install_in-VS_Code-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white" />
  12. </a>
  13. <a href="[https://vscode.dev/redirect/mcp/install?name=dynatrace-mcp-server&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40dynatrace-oss%2Fdynatrace-mcp-server%22%5D%2C%22env%22%3A%7B%7D%7D](https://cursor.com/en/install-mcp?name=dynatrace-mcp-server&config=eyJuYW1lIjoiZHluYXRyYWNlLW1jcC1zZXJ2ZXIiLCJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBkeW5hdHJhY2Utb3NzL2R5bmF0cmFjZS1tY3Atc2VydmVyIl0sImVudiI6e319)">
  14. <img src="https://img.shields.io/badge/Install_in-Cursor-000000?style=flat-square&logoColor=white" />
  15. </a>
  16. <a href="https://www.npmjs.com/package/@dynatrace-oss/dynatrace-mcp-server">
  17. <img src="https://img.shields.io/npm/dm/@dynatrace-oss/dynatrace-mcp-server?logo=npm&style=flat&color=red" alt="npm" />
  18. </a>
  19. <a href="https://github.com/dynatrace-oss/dynatrace-mcp">
  20. <img src="https://img.shields.io/github/stars/dynatrace-oss/dynatrace-mcp" alt="Dynatrace MCP Server Stars on GitHub" />
  21. </a>
  22. <a href="https://github.com/dynatrace-oss/dynatrace-mcp">
  23. <img src="https://img.shields.io/github/contributors/dynatrace-oss/dynatrace-mcp?color=green" alt="Dynatrace MCP Server Contributors on GitHub" />
  24. </a>
  25. </h4>
  26. ## ⚠️ DEPRECATED
  27. > **This repository is deprecated. Version 2.1.2 was the final release — no further updates will be made.**
  28. Please migrate to one of the actively maintained alternatives:
  29. | Use case | Recommended tool |
  30. | -------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
  31. | **Local development** (VS Code, IntelliJ, Claude Code, Cursor, …) | [Dynatrace-for-AI](https://github.com/Dynatrace/dynatrace-for-ai/) + [`dtctl`](https://github.com/dynatrace-oss/dtctl) |
  32. | **Agent-to-agent / remote** (Atlassian Rovo, GitHub Coding Agent, …) | [Dynatrace Remote MCP Server](https://www.dynatrace.com/hub/detail/dynatrace-mcp-server/) — no local setup required |
  33. See the [migration guide](docs/remote-mcp-migration.md) for a step-by-step comparison and migration instructions.
  34. The local _Dynatrace MCP server_ allows AI Assistants to interact with the [Dynatrace](https://www.dynatrace.com/) observability platform,
  35. bringing real-time observability data directly into your development workflow.
  36. > Note: This product is not officially supported by Dynatrace.
  37. If you need help, please contact us via [GitHub Issues](https://github.com/dynatrace-oss/dynatrace-mcp/issues) if you have feature requests, questions, or need help.
  38. https://github.com/user-attachments/assets/25c05db1-8e09-4a7f-add2-ed486ffd4b5a
  39. ## Prerequisites
  40. - **Node.js v24 or newer** is required to run the Dynatrace MCP Server.
  41. ## Quickstart
  42. You can add this MCP server to your MCP Client like VSCode, Claude, Cursor, Amazon Q, Windsurf, ChatGPT, or Github Copilot via the command is `npx -y @dynatrace-oss/dynatrace-mcp-server` (type: `stdio`). For more details, please refer to the [configuration section below](#configuration).
  43. Furthermore, you need to configure the URL to a Dynatrace environment:
  44. - `DT_ENVIRONMENT` (string, e.g., `https://abc12345.apps.dynatrace.com`) - URL to your Dynatrace Platform (do not use Dynatrace classic URLs like `abc12345.live.dynatrace.com`)
  45. Authentication will be handled via Authorization Code Flow in your browser, you don't need to define a Platform Token nor an OAuth Client to get started. After the initial authentication, your token is securely stored in the **OS keychain** (macOS Keychain, Windows Credential Manager, or Linux Secret Service) and reused on subsequent server starts, so the browser only opens once per token lifetime.
  46. If you are running in a headless/container environment where the OS keychain is unavailable, set `DT_MCP_TOKEN_STORAGE=file` to persist tokens in `~/.config/dynatrace-mcp/` instead.
  47. Once you are done, we recommend looking into [example prompts](#-example-prompts-), like `Get all details of the entity 'my-service'` or `Show me error logs`. Please mind that these prompts lead to executing DQL statements which may incur [costs](#costs) in accordance to your licence.
  48. **VSCode**
  49. ```json
  50. {
  51. "servers": {
  52. "npx-dynatrace-mcp-server": {
  53. "command": "npx",
  54. "args": ["-y", "@dynatrace-oss/dynatrace-mcp-server@latest"],
  55. "env": {
  56. "DT_ENVIRONMENT": "https://abc12345.apps.dynatrace.com"
  57. }
  58. }
  59. }
  60. }
  61. ```
  62. ## Architecture
  63. ![Architecture](https://github.com/dynatrace-oss/dynatrace-mcp/blob/main/assets/dynatrace-mcp-arch.png?raw=true)
  64. ## Use cases
  65. - **Real-time observability** - Fetch production-level data for early detection and proactive monitoring
  66. - **Contextual debugging** - Fix issues with full context from monitored exceptions, logs, and anomalies
  67. - **Security insights** - Get detailed vulnerability analysis and security problem tracking
  68. - **Natural language queries** - Use AI-powered DQL generation and explanation
  69. - **Multi-phase incident investigation** - Systematic 4-phase approach with automated impact assessment
  70. - **Advanced transaction analysis** - Precise root cause identification with file/line-level accuracy
  71. - **Cross-data source correlation** - Connect problems → spans → logs with trace ID correlation
  72. - **DevOps automation** - Deployment health gates with automated promotion/rollback logic
  73. - **Security compliance monitoring** - Multi-cloud compliance assessment with evidence-based investigation
  74. ## Capabilities
  75. - Observability & Problem Management (e.g., `list_problems`, `list_vulnerabilities`, `list_exceptions`, `get_kubernetes_events`)
  76. - Querying Data from Grail (e.g., `execute_dql`, `verify_dql`, `generate_dql_from_natural_language`, `explain_dql_in_natural_language`)
  77. - Entity Discovery (e.g., `find_entity_by_name`)
  78. - [Dynatrace Intelligence](https://www.dynatrace.com/platform/artificial-intelligence/) (e.g., `chat_with_davis_copilot`, `list_davis_analyzers`, `execute_davis_analyzer`)
  79. - Automation & Notifications (e.g., `send_slack_message`, `send_email`, `send_event`)
  80. - Share results (e.g., `create_dynatrace_notebook`)
  81. ### Costs
  82. **Important:** While this local MCP server is provided for free, using certain capabilities to access data in Dynatrace Grail may incur additional costs based
  83. on your Dynatrace consumption model. This affects `execute_dql` tool and other capabilities that **query** Dynatrace Grail storage, and costs
  84. depend on the volume (GB scanned).
  85. **Before using this MCP server extensively, please:**
  86. 1. Review your current Dynatrace consumption model and pricing
  87. 2. Understand the cost implications of the specific data you plan to query (logs, events, metrics) - see [Dynatrace Pricing and Rate Card](https://www.dynatrace.com/pricing/)
  88. 3. Start with smaller timeframes (e.g., 12h-24h) and make use of [buckets](https://docs.dynatrace.com/docs/discover-dynatrace/platform/grail/data-model#built-in-grail-buckets) to reduce the cost impact
  89. 4. Set an appropriate `DT_GRAIL_QUERY_BUDGET_GB` environment variable (default: 1000 GB) to control and monitor your Grail query consumption
  90. **Grail Budget Tracking:**
  91. The MCP server includes built-in budget tracking for Grail queries to help you monitor and control costs:
  92. - Set `DT_GRAIL_QUERY_BUDGET_GB` (default: 1000 GB) to define your session budget limit
  93. - The server tracks bytes scanned across all Grail queries in the current session
  94. - You'll receive warnings when approaching 80% of your budget
  95. - Budget exceeded alerts help prevent unexpected high consumption
  96. - Budget resets when you restart the MCP server session
  97. **To understand costs that occured:**
  98. Execute the following DQL statement in a notebook to see how much bytes have been queried from Grail (Logs, Events, etc...):
  99. ```
  100. fetch dt.system.events
  101. | filter event.kind == "QUERY_EXECUTION_EVENT" and contains(client.client_context, "dynatrace-mcp")
  102. | sort timestamp desc
  103. | fields timestamp, query_id, query_string, scanned_bytes, table, bucket, user.id, user.email, client.client_context
  104. | maketimeSeries sum(scanned_bytes), by: { user.email, user.id, table }
  105. ```
  106. ### AI-Powered Assistance
  107. - **Natural Language to DQL** - Convert plain English queries to Dynatrace Query Language
  108. - **DQL Explanation** - Get plain English explanations of complex DQL queries
  109. - **AI Chat Assistant** - Get contextual help and guidance for Dynatrace questions
  110. ## Configuration
  111. You can add this MCP server (using STDIO) to your MCP Client like VS Code, Claude, Cursor, Amazon Q Developer CLI, Windsurf Github Copilot via the package `@dynatrace-oss/dynatrace-mcp-server`.
  112. We recommend to always set it up for your current workspace instead of using it globally.
  113. **VS Code**
  114. ```json
  115. {
  116. "servers": {
  117. "npx-dynatrace-mcp-server": {
  118. "command": "npx",
  119. "args": ["-y", "@dynatrace-oss/dynatrace-mcp-server@latest"],
  120. "env": {
  121. "DT_ENVIRONMENT": "https://abc12345.apps.dynatrace.com"
  122. }
  123. }
  124. }
  125. }
  126. ```
  127. **Claude Desktop**
  128. ```json
  129. {
  130. "mcpServers": {
  131. "dynatrace-mcp-server": {
  132. "command": "npx",
  133. "args": ["-y", "@dynatrace-oss/dynatrace-mcp-server@latest"],
  134. "env": {
  135. "DT_ENVIRONMENT": "https://abc12345.apps.dynatrace.com"
  136. }
  137. }
  138. }
  139. }
  140. ```
  141. **Amazon Q Developer CLI**
  142. The [Amazon Q Developer CLI](https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/command-line-mcp-configuration.html) provides an interactive chat experience directly in your terminal. You can ask questions, get help with AWS services, troubleshoot issues, and generate code snippets without leaving your command line environment.
  143. ```json
  144. {
  145. "mcpServers": {
  146. "dynatrace-mcp-server": {
  147. "command": "npx",
  148. "args": ["-y", "@dynatrace-oss/dynatrace-mcp-server@latest"],
  149. "env": {
  150. "DT_ENVIRONMENT": "https://abc12345.apps.dynatrace.com"
  151. }
  152. }
  153. }
  154. }
  155. ```
  156. This configuration should be stored in `<your-repo>/.amazonq/mcp.json`.
  157. **Amazon Kiro**
  158. The [Amazon Kiro](https://kiro.dev/) is an agentic IDE that helps you do your best work with features such as specs, steering, and hooks.
  159. ```json
  160. {
  161. "mcpServers": {
  162. "dynatrace-mcp-server": {
  163. "command": "npx",
  164. "args": ["-y", "@dynatrace-oss/dynatrace-mcp-server@latest"],
  165. "env": {
  166. "DT_ENVIRONMENT": "https://abc12345.apps.dynatrace.com"
  167. }
  168. }
  169. }
  170. }
  171. ```
  172. This configuration should be stored in `<your-repo>/.kiro/settings/mcp.json`.
  173. **Google Gemini CLI**
  174. The [Google Gemini CLI](https://github.com/google-gemini/gemini-cli) is Google's official command-line AI assistant that supports MCP server integration. You can add the Dynatrace MCP server using either the built-in management commands or manual configuration.
  175. Using `gemini` CLI directly (recommended):
  176. ```bash
  177. gemini extensions install https://github.com/dynatrace-oss/dynatrace-mcp
  178. export DT_PLATFORM_TOKEN=... # optional
  179. ```
  180. The command will ask for the value Dynatrace Environment.
  181. Verify that the server is running via
  182. ```bash
  183. gemini mcp list
  184. ```
  185. Or manually in your `~/.gemini/settings.json` or `.gemini/settings.json`:
  186. ```json
  187. {
  188. "mcpServers": {
  189. "dynatrace": {
  190. "command": "npx",
  191. "args": ["@dynatrace-oss/dynatrace-mcp-server@latest"],
  192. "env": {
  193. "DT_ENVIRONMENT": "https://abc12345.apps.dynatrace.com"
  194. },
  195. "timeout": 30000,
  196. "trust": false
  197. }
  198. }
  199. }
  200. ```
  201. ### HTTP Server Mode (Alternative)
  202. > **💡 Recommendation:** Instead of self-hosting with `--http` / `--server`, consider using the official [Dynatrace Remote MCP Server](https://www.dynatrace.com/hub/detail/dynatrace-mcp-server/) — it is more secure, always up to date, and requires no infrastructure management.
  203. For scenarios where you need to run the MCP server as an HTTP service instead of using stdio (e.g., for stateful sessions, load balancing, or integration with web clients), you can use the HTTP server mode:
  204. **Running as HTTP server:**
  205. Please secure your server with a bearer token:
  206. ```bash
  207. export MCP_BEARER_TOKEN=<bearer-token>
  208. ```
  209. ```bash
  210. # Get help and see all available options
  211. npx -y @dynatrace-oss/dynatrace-mcp-server@latest --help
  212. # Run with HTTP server on default port 3000
  213. npx -y @dynatrace-oss/dynatrace-mcp-server@latest --http
  214. # Run with custom port (using short or long flag)
  215. npx -y @dynatrace-oss/dynatrace-mcp-server@latest --server -p 8080
  216. npx -y @dynatrace-oss/dynatrace-mcp-server@latest --http --port 3001
  217. # Run with custom host/IP (using short or long flag)
  218. npx -y @dynatrace-oss/dynatrace-mcp-server@latest --http --host 127.0.0.1 # recommended for local computers
  219. npx -y @dynatrace-oss/dynatrace-mcp-server@latest --http --host 0.0.0.0 # required for container (binds all interfaces; omitting --host defaults to 127.0.0.1)
  220. npx -y @dynatrace-oss/dynatrace-mcp-server@latest --http -H 192.168.0.1 # recommended when sharing connection over a local network
  221. # Static OAuth callback port (useful when the port must be exposed, e.g., when running the MCP in a container)
  222. npx -y @dynatrace-oss/dynatrace-mcp-server@latest --oauth-redirect-port 5344
  223. # Check version
  224. npx -y @dynatrace-oss/dynatrace-mcp-server@latest --version
  225. ```
  226. **Configuration for MCP clients that support HTTP transport:**
  227. ```json
  228. {
  229. "mcpServers": {
  230. "dynatrace-http": {
  231. "url": "http://localhost:3000",
  232. "transport": "http",
  233. "headers": {
  234. "Authorization": "Bearer <bearer-token>"
  235. }
  236. }
  237. }
  238. }
  239. ```
  240. #### Bearer Token Authentication (`MCP_BEARER_TOKEN`)
  241. `MCP_BEARER_TOKEN` is **required** when running in HTTP mode. The server will refuse to start if this variable is not set.
  242. Every HTTP request must include an `Authorization: Bearer <token>` header. Requests without a valid token receive `401 Unauthorized`.
  243. **Generating a secure token:**
  244. ```bash
  245. export MCP_BEARER_TOKEN=$(openssl rand -base64 32)
  246. npx -y @dynatrace-oss/dynatrace-mcp-server@latest --http
  247. ```
  248. **Configuring the MCP client to send the token:**
  249. ```json
  250. {
  251. "mcpServers": {
  252. "dynatrace-http": {
  253. "url": "http://localhost:3000",
  254. "transport": "http",
  255. "headers": {
  256. "Authorization": "Bearer <your-token>"
  257. }
  258. }
  259. }
  260. }
  261. ```
  262. ### MCP Bundle (MCPB)
  263. Each release publishes a pre-built MCP Bundle file (`.mcpb`) that you can install directly in Claude Desktop without any manual JSON configuration.
  264. **Installing in Claude Desktop:**
  265. 1. Go to the [GitHub Releases](https://github.com/dynatrace-oss/dynatrace-mcp/releases) page and download the latest `dynatrace-mcp-server-<version>.mcpb` file.
  266. 2. Double-click the downloaded `.mcpb` file, or open Claude Desktop → **Settings** → **Developer** and drag the file into the MCP servers list.
  267. 3. Follow the prompts to set your `DT_ENVIRONMENT` variable (e.g. `https://abc12345.apps.dynatrace.com`).
  268. This repository also includes an MCP Bundle-compatible [manifest.json](manifest.json) for local installation.
  269. The bundle runs the compiled local server entrypoint via stdio:
  270. - `server.type`: `node`
  271. - `server.entry_point`: `dist/index.js`
  272. - `mcp_config.command`: `node`
  273. - `mcp_config.args`: `["${__dirname}/dist/index.js"]`
  274. ### Rule File
  275. For efficient result retrieval from Dynatrace, please consider creating a rule file (e.g., [.github/copilot-instructions.md](https://docs.github.com/en/copilot/how-tos/configure-custom-instructions/add-repository-instructions), [.amazonq/rules/](https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/context-project-rules.html)), instructing coding agents on how to get more details for your component/app/service. Here is an example for [easytrade](https://github.com/Dynatrace/easytrade), please adapt the names and filters to fit your use-cases and components:
  276. ```
  277. # Observability
  278. We use Dynatrace as an Observability solution. This document provides instructions on how to get data for easytrade from Dynatrace using DQL.
  279. ## How to get any data for my App
  280. Depending on the query and tool used, the following filters can be applied to narrow down results:
  281. * `contains(entity.name, "easytrade")`
  282. * `contains(affected_entity.name, "easytrade")`
  283. * `contains(container.name, "easytrade")`
  284. For best results, you can combine these filters with an `OR` operator.
  285. ## Logs
  286. To fetch logs for easytrade, execute `fetch logs | filter contains(container.name, "easyatrade")`.
  287. For fetching just error-logs, add `| filter loglevel == "ERROR"`.
  288. ```
  289. ## Environment Variables
  290. > **Breaking Change in v1.0.0:** The MCP server no longer automatically loads `.env` files. To use environment variables from a `.env` file, you need to configure your MCP client to load environment variables using the native `envFile` configuration option. See the [configuration examples](#configuration) below for details.
  291. - `DT_ENVIRONMENT` (**required**, string, e.g., `https://abc12345.apps.dynatrace.com`) - URL to your Dynatrace Platform (do not use Dynatrace classic URLs like `abc12345.live.dynatrace.com`)
  292. - `DT_PLATFORM_TOKEN` (optional, string, e.g., `dt0s16.SAMPLE.abcd1234`) - Dynatrace Platform Token
  293. - `OAUTH_CLIENT_ID` (optional, string, e.g., `dt0s02.SAMPLE`) - Alternative: Dynatrace OAuth Client ID (for advanced use cases)
  294. - `OAUTH_CLIENT_SECRET` (optional, string, e.g., `dt0s02.SAMPLE.abcd1234`) - Alternative: Dynatrace OAuth Client Secret (for advanced use cases)
  295. - `DT_SSO_URL` (optional, string, e.g., `https://sso.dynatrace.com`) - Override the SSO URL for OAuth authentication. By default, the SSO URL is automatically discovered from your Dynatrace environment.
  296. - `DT_GRAIL_QUERY_BUDGET_GB` (optional, number, default: `1000`) - Budget limit in GB (base 1000) for Grail query bytes scanned per session. The MCP server tracks your Grail usage and warns when approaching or exceeding this limit.
  297. When just providing `DT_ENVIRONMENT`, the local MCP server will try to open a browser window to authenticate against the Dynatrace SSO.
  298. For more information about the other authentication methods, please have a look at the documentation about
  299. [creating a Platform Token in Dynatrace](https://docs.dynatrace.com/docs/manage/identity-access-management/access-tokens-and-oauth-clients/platform-tokens), as well as
  300. [creating an OAuth Client in Dynatrace](https://docs.dynatrace.com/docs/manage/identity-access-management/access-tokens-and-oauth-clients/oauth-clients) for advanced scenarios (service-users, backend-to-backend communication).
  301. In addition, depending on the features you use, the following variables can be configured:
  302. - `SLACK_CONNECTION_ID` (string) - connection ID of a [Slack Connection](https://docs.dynatrace.com/docs/analyze-explore-automate/workflows/actions/slack)
  303. ### Proxy Configuration
  304. The MCP server honors system proxy settings for corporate environments:
  305. - `https_proxy` or `HTTPS_PROXY` (optional, string, e.g., `http://proxy.example.com:8080`) - Proxy server URL for HTTPS requests
  306. - `http_proxy` or `HTTP_PROXY` (optional, string, e.g., `http://proxy.example.com:8080`) - Proxy server URL for HTTP requests
  307. - `no_proxy` or `NO_PROXY` (optional, string, e.g., `localhost,127.0.0.1,.local`) - Comma-separated list of hostnames or domains that should bypass the proxy
  308. - `NODE_EXTRA_CA_CERTS` (optional, string, e.g., `C:\some-path\certificate.pem`) - When set, the well known "root" CAs (like VeriSign) will be extended with the extra certificates
  309. **Note:** The `no_proxy` environment variable is currently logged for informational purposes but not fully enforced by the underlying HTTP client. If you need to bypass the proxy for specific hosts, consider configuring your proxy server to handle these exclusions.
  310. Example configuration with proxy:
  311. ```bash
  312. export HTTPS_PROXY=http://proxy.company.com:8080
  313. export NO_PROXY=localhost,127.0.0.1,.company.local
  314. export DT_ENVIRONMENT=https://abc12345.apps.dynatrace.com
  315. ```
  316. ### Scopes for Authentication
  317. Depending on the features you are using, the following scopes are needed:
  318. **Available for both Platform Tokens and OAuth Clients:**
  319. - `app-engine:apps:run` - needed for almost all tools
  320. - `app-settings:objects:read` - read app-settings - needed for `send_slack_message` tool to read connection details from App-Settings
  321. - `storage:buckets:read` - needed for `execute_dql` tool to read all system data stored on Grail
  322. - `storage:logs:read` - needed for `execute_dql` tool to read logs for reliability guardian validations
  323. - `storage:metrics:read` - needed for `execute_dql` tool to read metrics for reliability guardian validations
  324. - `storage:bizevents:read` - needed for `execute_dql` tool to read bizevents for reliability guardian validations
  325. - `storage:spans:read` - needed for `execute_dql` tool to read spans from Grail
  326. - `storage:entities:read` - needed for `execute_dql` tool to read Entities from Grail
  327. - `storage:events:read` - needed for `execute_dql` tool to read Events from Grail
  328. - `storage:security.events:read`- needed for `execute_dql` tool to read Security Events from Grail
  329. - `storage:system:read` - needed for `execute_dql` tool to read System Data from Grail
  330. - `storage:user.events:read` - needed for `execute_dql` tool to read User events from Grail
  331. - `storage:user.sessions:read` - needed for `execute_dql` tool to read User sessions from Grail
  332. - `storage:smartscape:read` - needed for `execute_dql` tool to read Smartscape Data
  333. - `storage:files:read` - needed for `execute_dql` tool to use DQL `load` statements for lookup data (e.g., `/lookups/http_status_codes`)
  334. - `storage:events:write` - needed for `send_event` tool to send event data to Dynatrace
  335. - `davis-copilot:conversations:execute` - execute conversational skill (chat with Copilot)
  336. - `davis-copilot:nl2dql:execute` - execute Davis Copilot Natural Language (NL) to DQL skill
  337. - `davis-copilot:dql2nl:execute` - execute DQL to Natural Language (NL) skill
  338. - `davis:analyzers:read` - needed for listing and getting Davis analyzer definitions
  339. - `davis:analyzers:execute` - needed for executing Davis analyzers
  340. - `email:emails:send` - needed for `send_email` tool to send emails
  341. - `document:documents:read` - needed for `list_documents` and `read_document` tools to list and read Dynatrace documents (Notebooks, Dashboards, Launchpads, etc.)
  342. - `document:documents:write` - needed for `create_document` tool to create new documents
  343. **Notes**:
  344. - Versions before 0.12.0 required the scope `app-engine:functions:run`, which is no longer required.
  345. - Versions before 0.13.0 required the scopes `settings:objects:read` and `environment-api:entities:read`, which are no longer required.
  346. ## ✨ Example prompts ✨
  347. You can start with something as simple as "Is my component monitored by Dynatrace?", and follow up with more sophisticated [examples](examples/).
  348. ## Troubleshooting
  349. ### Authentication Issues
  350. In most cases, authentication issues are related to missing scopes or invalid tokens. Please ensure that you have added all required scopes as listed above.
  351. **For Platform Tokens:**
  352. 1. Verify your Platform Token has all the necessary scopes listed in the "Scopes for Authentication" section
  353. 2. Ensure your token is valid and not expired
  354. 3. Check that your user has the required permissions in your Dynatrace Environment
  355. **For OAuth Clients:**
  356. In case of OAuth-related problems, you can troubleshoot SSO/OAuth issues based on our [Dynatrace Developer Documentation](https://developer.dynatrace.com/develop/access-platform-apis-from-outside/#get-bearer-token-and-call-app-function).
  357. It is recommended to test access with the following API (which requires minimal scopes `app-engine:apps:run` and, e.g., `storage:logs:read`):
  358. 1. Use OAuth Client ID and Secret to retrieve a Bearer Token (only valid for a couple of minutes):
  359. ```bash
  360. curl --request POST 'https://sso.dynatrace.com/sso/oauth2/token' \
  361. --header 'Content-Type: application/x-www-form-urlencoded' \
  362. --data-urlencode 'grant_type=client_credentials' \
  363. --data-urlencode 'client_id={your-client-id}' \
  364. --data-urlencode 'client_secret={your-client-secret}' \
  365. --data-urlencode 'scope=app-engine:apps:run storage:logs:read'
  366. ```
  367. 2. Use `access_token` from the response of the above call as the bearer-token in the next call:
  368. ```bash
  369. curl -X GET https://abc12345.apps.dynatrace.com/platform/management/v1/environment \
  370. -H 'accept: application/json' \
  371. -H 'Authorization: Bearer {your-bearer-token}'
  372. ```
  373. 3. You should retrieve a result like this:
  374. ```json
  375. {
  376. "environmentId": "abc12345",
  377. "createTime": "2023-01-01T00:10:57.123Z",
  378. "blockTime": "2025-12-07T00:00:00Z",
  379. "state": "ACTIVE"
  380. }
  381. ```
  382. ### Problem accessing data on Grail
  383. Grail has a dedicated section about permissions in the Dynatrace Docs. Please refer to https://docs.dynatrace.com/docs/discover-dynatrace/platform/grail/data-model/assign-permissions-in-grail for more details.
  384. ## Telemetry
  385. The Dynatrace MCP Server sends telemetry data using Dynatrace OpenKit BizEvents to help improve the product. This includes:
  386. - Server start events (`com.dynatrace-oss.mcp.server-start`)
  387. - Client initialization events (`com.dynatrace-oss.mcp.client-initialization`) - which MCP client is connecting (e.g., VS Code, Claude Desktop, Cursor)
  388. - Tool usage events (`com.dynatrace-oss.mcp.tool-usage`) - which tools are called, success/failure, execution duration
  389. - Error events (`com.dynatrace-oss.mcp.error`) - error tracking for debugging and improvement
  390. All telemetry data is sent as **Business Events** and is accessible via Grail for analysis:
  391. ```dql
  392. fetch bizevents
  393. | filter startsWith(event.type, "com.dynatrace-oss.mcp")
  394. | sort timestamp DESC
  395. ```
  396. **Privacy and Opt-out:**
  397. - Telemetry is **enabled by default** but can be disabled by setting `DT_MCP_DISABLE_TELEMETRY=true`
  398. - No sensitive data from your Dynatrace environment is tracked
  399. - Only anonymous usage statistics and error information are collected
  400. - Usage statistics and error data are transmitted to Dynatrace’s analytics endpoint
  401. **Configuration options:**
  402. - `DT_MCP_DISABLE_TELEMETRY` (boolean, default: `false`) - Disable Telemetry
  403. - `DT_MCP_TELEMETRY_APPLICATION_ID` (string, default: `dynatrace-mcp-server`) - Application ID for tracking
  404. - `DT_MCP_TELEMETRY_ENDPOINT_URL` (string, default: Dynatrace endpoint) - OpenKit endpoint URL
  405. - `DT_MCP_TELEMETRY_DEVICE_ID` (string, default: auto-generated) - Device identifier for tracking
  406. To disable usage tracking, add this to your environment:
  407. ```bash
  408. DT_MCP_DISABLE_TELEMETRY=true
  409. ```

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.