Skip to main content
Glama
Dynatrace MCP

Dynatrace MCP

by raviraj-ntp

Dynatrace MCP

Local MCP server for any Dynatrace SaaS/Grail tenant — Kubernetes pod status, bounded log search, Davis problem triage, metrics, and security summaries. Nothing is hardcoded to a cluster, namespace, or workload; pass filters (or discover them with list_clusters / list_namespaces).

  • Runs on your machine (stdio)

  • npm: @raviraj87/dynatrace-mcp

  • Replaces the hosted Dynatrace MCP gateway for agent workflows. Does not clone Davis Copilot NL→DQL or docs RAG.


Quick start

Edit ~/.cursor/mcp.json:

{
  "mcpServers": {
    "dynatrace": {
      "command": "npx",
      "args": ["-y", "@raviraj87/dynatrace-mcp@latest"],
      "env": {
        "DYNATRACE_URL": "https://abc12345.apps.dynatrace.com",
        "DYNATRACE_API_TOKEN": "dt0s16.your-platform-token"
      }
    }
  }
}

Local checkout:

{
  "mcpServers": {
    "dynatrace-local": {
      "command": "node",
      "args": ["/path/to/dynatrace-mcp/dist/index.js"],
      "env": {
        "DYNATRACE_URL": "https://abc12345.apps.dynatrace.com",
        "DYNATRACE_API_TOKEN": "dt0s16.your-platform-token"
      }
    }
  }
}

Restart Cursor. Ask: "Use dynatrace_health".

Platform token scopes should include Grail reads (storage:logs:read, storage:events:read, storage:metrics:read, storage:entities:read, storage:buckets:read, storage:security.events:read) plus problem/entity access as needed.

DT_ENVIRONMENT / DT_PLATFORM_TOKEN are accepted as aliases.


Related MCP server: K8s Lens MCP

Environment variables

Variable

Required

Description

DYNATRACE_URL

Yes*

https://{env}.apps.dynatrace.com

DYNATRACE_API_TOKEN

Yes*

Token only (dt0s16....). Do not prefix Api-Token — the server adds that. A pasted Api-Token … / Bearer … value is stripped.

DYNATRACE_STAGE_URL / DYNATRACE_STAGE_TOKEN

No

Named stage connection

DYNATRACE_PROD_URL / DYNATRACE_PROD_TOKEN

No

Named prod connection

DYNATRACE_CONNECTIONS

No

JSON map of extra { "name": { "url", "token" } }

DYNATRACE_DEFAULT_CONNECTION

No

Default connection name

DYNATRACE_GRAIL_QUERY_BUDGET_GB

No

Session Grail scan cap (default 1000)

NODE_EXTRA_CA_CERTS

No

Corporate CA PEM

DYNATRACE_NO_SSL_VERIFY

No

Skip TLS verify (insecure)

*Or DT_ENVIRONMENT + DT_PLATFORM_TOKEN.

Every tool accepts optional connection (default, stage, prod, …).


Time bounds

All query tools take from / to (e.g. now-30m, ISO-8601) or calendar startDate / endDate (YYYY-MM-DD, UTC day). around + window pin a pivot. Raw logs default to the last 30 minutes and cap at 7 days unless allowLongRange is true. Never unbounded.


Tools

Core

Tool

Purpose

dynatrace_health

Connectivity + tiny Grail query

dynatrace_list_connections

Named connections

dynatrace_execute_dql

Raw DQL

dynatrace_verify_dql

Parse DQL without executing

dynatrace_reset_grail_budget

Clear session scan budget

dynatrace_query_problems

Davis problems (search optional)

dynatrace_get_problem

One problem (P-123)

dynatrace_list_exceptions

ERROR/exception logs

dynatrace_k8s_events

Cluster/pod events

dynatrace_k8s_issue_events

OOM / CrashLoop / Evicted / Warning

dynatrace_get_entity_id / dynatrace_get_entity_name

Entity lookup

Kubernetes Explorer

Tool

Purpose

dynatrace_list_clusters / dynatrace_list_namespaces

Inventory

dynatrace_list_nodes

Nodes by container CPU/mem

dynatrace_list_pods

Pod table from kube CPU/mem metrics (quiet pods included). includeLogs optional

dynatrace_get_pod

One pod: metrics status, entity, ready/restarts if present

dynatrace_pod_issues

CrashLoop / Warning events for one pod

dynatrace_pod_utilization

CPU / memory usage (quota tables)

dynatrace_pod_quota

Kubernetes Explorer CPU + Memory quota (requests, limits, %)

dynatrace_pod_events

Events for a pod/workload

dynatrace_workload_status

Desired vs ready

dynatrace_service_health

Failure rate / latency

dynatrace_failed_spans

Error spans by service

dynatrace_slow_spans

Highest-duration spans

dynatrace_get_trace

Spans (+ optional logs) by trace_id

Logs (summary → exact → surround)

Tool

Purpose

dynatrace_log_summary

Counts by level × pod × container

dynatrace_search_logs

Exact matching lines (limit 50/200)

dynatrace_logs_surrounding

±30s around a hit timestamp

dynatrace_pod_logs

Last N lines for one pod

dynatrace_logs_tail

Poll new lines (since / nextSince)

dynatrace_logs_wait

Integration-test wait for a pattern (max 120s)

Log filters: cluster, namespace, workload, pod(s), container, node, loglevel, contains / containsAll / containsAny / notContains / regex, trace/span id, excludePatterns, sample, date bounds. Content is truncated and likely secrets are redacted.

Triage

Tool

Purpose

dynatrace_triage_problem

P-id or pasted alert → problem + pods + logs + quota + OOM/CrashLoop

dynatrace_triage_scope

Namespace/workload snapshot without a P-id

Prompt dynatrace_triage_alert

Full SRE workflow

Security & metrics

Tool

Purpose

dynatrace_security_events_summary

Aggregated security.events

dynatrace_vulnerabilities

Vulnerability summary

dynatrace_compliance_findings

Compliance summary

dynatrace_metrics_query

DQL timeseries or classic /api/v2/metrics/query


Typical triage

  1. dynatrace_list_clusters / dynatrace_list_namespaces if the target is unknown

  2. dynatrace_triage_problem (P-id) or dynatrace_triage_scope (cluster/namespace/workload)

  3. dynatrace_log_summary then dynatrace_search_logs loglevel=ERROR

  4. dynatrace_logs_surrounding on a match timestamp

  5. dynatrace_k8s_issue_events / dynatrace_pod_quota / dynatrace_get_pod

  6. dynatrace_failed_spans / dynatrace_slow_spans / dynatrace_get_trace if app latency or errors

Integration test tail

dynatrace_logs_wait  pods=["my-app-7f8c9d4b6-abc12"] namespace=default contains="started" timeoutSeconds=60
dynatrace_logs_tail  pods=["my-app-7f8c9d4b6-abc12"] namespace=default since=<nextSince>

Verify

export DYNATRACE_URL=https://abc12345.apps.dynatrace.com
export DYNATRACE_API_TOKEN=your-token
npm run build
npm run test:readonly

License

MIT — Copyright © 2026 Ravi Raj

Available Tools

38 tools
dynatrace_compliance_findingsCompliance Findings SummaryB

Summarized compliance findings from Grail (aggregated, max 100).

Inputs: to, from, around, window, +5 more.

dynatrace_execute_dqlExecute DQLB

Run a DQL query against Grail. Use templated tools when possible. Requires valid DQL, not natural language.

Inputs: dql (required), to, from, around, +6 more.

dynatrace_failed_spansFailed SpansA

Error spans grouped by service/span/pod. Use after service_health shows failures or for latency vs error triage.

Inputs: to, from, limit, around, +7 more.

dynatrace_get_entity_idGet Entity IDB

Look up Dynatrace entity IDs by type (dt.entity.host, dt.entity.service, ...) and name substring.

Inputs: entityType (required), entityNameFilter (required), connection.

dynatrace_get_entity_nameGet Entity NameB

Resolve a Dynatrace entity ID to its display name.

Inputs: entityId (required), entityType (required), connection.

dynatrace_get_podGet PodB

Detail for one pod: kube-metrics status (CPU/mem), entity lifetime, ready/restarts if ingested.

Inputs: pod (required), to, from, around, +7 more.

dynatrace_get_problemGet Davis ProblemB

Get a Davis problem by display id (P-123) or event id.

Inputs: problemId (required), to, from, around, +5 more.

dynatrace_get_traceGet TraceC

Fetch spans for a trace_id (from a log line) plus optional linked logs.

Inputs: traceId (required), to, from, limit, +7 more.

dynatrace_healthDynatrace HealthB

Check Dynatrace connectivity and Grail access for a named connection.

Inputs: connection.

dynatrace_k8s_eventsKubernetes EventsC

Kubernetes cluster/pod/workload events in a time range.

Inputs: to, pod, from, limit, +10 more.

dynatrace_k8s_issue_eventsKubernetes Issue EventsC

OOMKilled, CrashLoop/BackOff, Evicted, Failed, Unhealthy, probe failures, Warning events. Scope with cluster/namespace/workload/pod.

Inputs: to, pod, from, limit, +9 more.

dynatrace_list_clustersList Kubernetes ClustersA

List Kubernetes clusters known to this Dynatrace tenant (k8s.cluster.name). Call this before filtering pods.

Inputs: to, from, around, window, +4 more.

dynatrace_list_connectionsList Dynatrace ConnectionsB

List configured named connections (default, stage, prod, ...).

Inputs: no named parameters.

dynatrace_list_exceptionsList ExceptionsC

Recent ERROR/exception log lines. Use log filters and date bounds.

Inputs: to, pod, from, host, +31 more.

dynatrace_list_namespacesList Kubernetes NamespacesC

List namespaces in this tenant, optionally filtered by cluster.

Inputs: to, from, around, window, +5 more.

dynatrace_list_nodesList Kubernetes NodesB

Nodes ranked by container CPU/memory on that node. Pass cluster from dynatrace_list_clusters.

Inputs: to, from, limit, around, +6 more.

dynatrace_list_podsList PodsA

Pod table from kube CPU/memory metrics for any cluster/namespace/workload. Quiet pods (no logs) are included. Pass filters from list_clusters / list_namespaces or the user; do not assume names. Unfiltered lists are capped. includeLogs is an optional extra Grail scan.

Inputs: to, pod, from, limit, +10 more.

dynatrace_logs_surroundingSurrounding LogsB

Lines around a pivot timestamp for the same pod/container (grep -C in time). before/after default 30s, max 5m.

Inputs: pivot (required), to, pod, from, +34 more.

dynatrace_logs_tailTail LogsB

Polling live tail for one or more pods. Pass since from the previous nextSince. First call defaults to now-30s. Not a websocket; poll from the agent.

Inputs: pods (required), sort, limit, regex, +19 more.

dynatrace_log_summaryLog SummaryA

Count logs by level, namespace, pod, and container. Call this before fetching raw lines. Requires date/time bounds.

Inputs: to, pod, from, host, +31 more.

dynatrace_logs_waitWait For Log PatternB

Poll until contains/regex appears on the given pods or timeout (default 30s, max 120s). For integration tests.

Inputs: pods (required), sort, limit, regex, +19 more.

dynatrace_metrics_queryQuery MetricsC

Run a DQL timeseries or Environment API v2 metric selector within date bounds.

Inputs: metric (required), by, to, from, +8 more.

dynatrace_pod_eventsPod EventsC

Kubernetes events for one pod or workload (Explorer Events tab).

Inputs: to, pod, from, limit, +9 more.

dynatrace_pod_issuesPod IssuesC

CrashLoop / OOM / not-Ready signals: restarts plus Warning events for a pod.

Inputs: pod (required), to, from, around, +7 more.

dynatrace_pod_logsPod LogsB

Last N log lines for a pod (still time-bounded). Prefer log_summary / search_logs for filters.

Inputs: pod (required), to, from, host, +31 more.

dynatrace_pod_quotaPod CPU/Memory QuotaB

Kubernetes Explorer quota tables for any namespace: CPU (mcore usage, throttled, requests, limits, %, unused) and Memory (usage, requests, limits, %, unused). Discover cluster/namespace first; do not assume names.

Inputs: to, pod, from, sort, +10 more.

dynatrace_pod_utilizationPod UtilizationC

Kubernetes Explorer CPU and Memory quota: usage, throttled, requests, limits, % of request/limit, unused. Filter by cluster/namespace/workload/pod. Same report as dynatrace_pod_quota.

Inputs: to, pod, from, limit, +9 more.

dynatrace_query_problemsQuery Davis ProblemsA

List Davis problems. status: ACTIVE, CLOSED, or ALL. Optional search on description/id/category. Date bounds apply (default last 2h, max 30d).

Inputs: to, from, limit, around, +7 more.

dynatrace_reset_grail_budgetReset Grail BudgetA

Clear session Grail scanned-bytes budget so queries can continue.

Inputs: no named parameters.

dynatrace_search_logsSearch LogsB

Exact matching log lines only (not a dump). Filter by cluster/namespace/pod/container, loglevel, contains/regex, trace id, and date bounds. Default limit 50, max 200.

Inputs: to, pod, from, host, +31 more.

dynatrace_security_events_summarySecurity Events SummaryB

Summarize security.events by provider, type, and risk level. Always aggregated.

Inputs: to, from, around, window, +6 more.

dynatrace_service_healthService HealthC

Request count, failure count, and response time for a service/workload.

Inputs: to, from, around, window, +7 more.

dynatrace_slow_spansSlow SpansB

Highest-duration spans in the window (latency triage). Follow a row with dynatrace_get_trace.

Inputs: to, from, limit, around, +7 more.

dynatrace_triage_problemTriage ProblemA

Investigate a Davis problem: problem record, kube pods/quota, ERROR logs, OOM/CrashLoop events. Pass P-123 or paste alert text. Optional cluster/namespace/workload override extracted hints.

Inputs: to, from, around, window, +9 more.

dynatrace_triage_scopeTriage Cluster/Namespace/WorkloadA

SRE snapshot without a problem id: active Davis problems, OOM/CrashLoop events, ERROR log counts, CPU/memory quota hotspots, replica mismatch, restarts, service golden signals, failed spans. Pass the user's cluster/namespace/workload (discover first). Default window 30m.

Inputs: to, pod, from, around, +9 more.

dynatrace_verify_dqlVerify DQLB

Parse/verify a DQL statement without executing it against Grail storage.

Inputs: dql (required), connection.

dynatrace_vulnerabilitiesVulnerabilities SummaryC

Summarized vulnerability findings from Grail security.events (max 100 groups).

Inputs: to, from, around, window, +6 more.

dynatrace_workload_statusWorkload StatusC

Desired vs ready replicas for a Kubernetes workload (covers No pod ready).

Inputs: to, from, around, window, +7 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.9/5.0

    Scored across 38 tools

    Disambiguation3/5

    Several tools overlap significantly: dynatrace_pod_utilization and dynatrace_pod_quota are explicitly the same report, while dynatrace_k8s_events, dynatrace_pod_events, and dynatrace_k8s_issue_events all surface Kubernetes events with subtly different scopes. Log tools also overlap (list_exceptions vs search_logs, pod_logs vs search_logs), though descriptions provide guidance. Boundaries are mostly documented, but an agent can still misselect among event and log tools.

    Naming Consistency4/5

    All tools use the dynatrace_ prefix and snake_case, which is highly predictable. However, many names are noun phrases (pod_issues, workload_status, compliance_findings) rather than the verb_noun pattern, so the convention is consistent in style but not uniformly action-oriented. Minor deviations only.

    Tool Count2/5

    38 tools is well above the 15-tool threshold for a well-scoped server and falls into the 'too many' range. While the domain is broad, the count increases surface area and contributes to overlap, with several specialized tools that could be consolidated.

    Completeness4/5

    The server covers a wide incident-triage surface: DQL, problems, logs, K8s resources, traces, spans, security, and compliance. Gaps remain around metrics discovery (no list_metrics), entity relationships, SLOs, and broader platform resources, but generic execute_dql mitigates many of these. For the apparent observability/troubleshooting purpose, coverage is strong with minor workaroundable gaps.

    Maintenance

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers