
Dynatrace MCP Server
OfficialOfficial Dynatrace server: run DQL over logs, events, spans and metrics.
Add to your client
Copy the config for your MCP client and paste it into its config file.
npx -y @dynatrace-oss/dynatrace-mcp-server@latestPaste into ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"dynatrace-mcp-server": {
"command": "npx",
"args": [
"-y",
"@dynatrace-oss/dynatrace-mcp-server@latest"
],
"env": {
"DT_ENVIRONMENT": "https://<your-env-id>.apps.dynatrace.com"
}
}
}
}Step-by-step guides: Add to Claude Desktop · Add to Cursor · Add to Windsurf
Before you start
- Node.js v24 or newer
- A Dynatrace environment URL (e.g. https://abc12345.apps.dynatrace.com), set as DT_ENVIRONMENT
- A Platform Token created in Dynatrace (Settings > Identity & access management > Platform tokens) with the relevant scopes — e.g. app-engine:apps:run, storage:logs:read, storage:metrics:read, storage:spans:read, storage:entities:read, storage:events:read, and davis-copilot/email scopes for those features. OAuth client credentials (OAUTH_CLIENT_ID / OAUTH_CLIENT_SECRET) or browser-based authorization-code flow are also supported.
About Dynatrace MCP Server
The Dynatrace MCP Server is the official server from Dynatrace that lets AI assistants query your Dynatrace observability platform in real time. Its core capability is running DQL (Dynatrace Query Language) over data stored in Grail — logs, events, spans, metrics, security events, and Smartscape topology — so an agent can pull production telemetry directly into a coding or incident-response workflow.
Beyond raw queries, it surfaces higher-level observability primitives: listing open problems, vulnerabilities, and exceptions; finding entities by name; and correlating trace IDs across data sources. It also integrates Davis CoPilot for natural-language-to-DQL generation and analyzer execution, plus automation hooks to send Slack messages, emails, and custom events.
The server runs over stdio via npx and is supported across VS Code, Claude Desktop, Cursor, Amazon Q, Windsurf, and GitHub Copilot. Note that querying Grail data can incur cost based on the volume scanned — the server exposes a DT_GRAIL_QUERY_BUDGET_GB guard (default 1000 GB) to cap consumption.
Tools & capabilities (13)
execute_dqlRun a Dynatrace Query Language query over Grail (logs, events, spans, metrics, entities).
verify_dqlValidate a DQL statement before executing it.
generate_dql_from_natural_languageTurn a plain-English request into a DQL query via Davis CoPilot.
explain_dql_in_natural_languageExplain what an existing DQL query does.
list_problemsList open problems detected by Dynatrace.
list_vulnerabilitiesList security vulnerabilities found in the environment.
list_exceptionsSurface exceptions captured across services.
find_entity_by_nameLook up a monitored entity (host, service, process) by name.
get_kubernetes_eventsRetrieve Kubernetes events for cluster troubleshooting.
chat_with_davis_copilotAsk Davis CoPilot for AI-driven analysis and answers.
execute_davis_analyzerRun a Davis analyzer (e.g. forecasting, anomaly detection) on data.
send_slack_messagePost a notification to Slack as part of an automation.
create_dynatrace_notebookGenerate a Dynatrace notebook to document an investigation.
When to use it
- Use it when you're debugging a production incident and want logs, spans, and metrics correlated by trace ID without leaving your editor.
- Use it when you want to ask in plain English ('show me 5xx errors for the checkout service in the last hour') and have it generate and run the DQL.
- Use it when you need a quick read on open problems or security vulnerabilities before shipping a change.
- Use it when an agent should gate a deployment on observability signals (error rates, anomalies) from Davis analyzers.
- Use it when you want to push an investigation summary to Slack or a Dynatrace notebook automatically.
Quick setup
- 1Ensure Node.js v24+ is installed.
- 2Create a Platform Token in Dynatrace with the required storage and app-engine scopes (or set up OAuth client credentials).
- 3Add the server to your MCP client config using `npx -y @dynatrace-oss/dynatrace-mcp-server@latest`.
- 4Set the DT_ENVIRONMENT env var to your environment URL and supply DT_PLATFORM_TOKEN (or OAUTH_CLIENT_ID/OAUTH_CLIENT_SECRET).
- 5Optionally set DT_GRAIL_QUERY_BUDGET_GB to cap query cost, then restart your MCP client.
- 6Verify by asking the agent to list open problems or run a simple DQL query.
Security notes
Prefer the browser OAuth flow over storing platform tokens or client secrets in plaintext env vars. DQL queries consume Grail budget, so set DT_GRAIL_QUERY_BUDGET_GB to cap unexpected query costs.
Dynatrace MCP Server FAQ
Does querying Dynatrace through this MCP server cost money?
It can. Accessing data in Grail (logs, events, spans, etc.) is billed by the volume scanned. The server provides a DT_GRAIL_QUERY_BUDGET_GB setting (default 1000 GB) to guard against runaway consumption.
What authentication does it support?
A Dynatrace Platform Token (recommended) via DT_PLATFORM_TOKEN, OAuth client credentials via OAUTH_CLIENT_ID/OAUTH_CLIENT_SECRET, or a browser-based authorization-code flow.
Which MCP clients work with it?
VS Code, Claude Desktop, Cursor, Amazon Q, Windsurf, ChatGPT, and GitHub Copilot are all documented as supported over stdio.
What scopes does my Platform Token need?
At minimum app-engine:apps:run plus the storage:*:read scopes for the data types you query (logs, metrics, spans, entities, events). Add davis-copilot and email:emails:send scopes if you use CoPilot or email notifications.
Do I need a self-hosted server?
No. It runs locally via npx over stdio and connects to your Dynatrace SaaS/Managed environment using your environment URL and token.
Alternatives to Dynatrace MCP Server
Compare all alternatives →Official Elastic server: list indices, read mappings, and search with Query DSL.
Official PostHog server: product analytics, feature flags, experiments, error tracking and SQL.
Run PromQL queries and analyze Prometheus metrics from any MCP client.
Compare Dynatrace MCP Server with: