Blog Post

Apps on Azure Blog
5 MIN READ

Get started with Dynatrace MCP server in Azure SRE Agent

dbandaru's avatar
dbandaru
Icon for Microsoft rankMicrosoft
Feb 05, 2026

Connect Azure SRE Agent to Dynatrace using the official MCP server integration for real-time observability data.

Overview

Dynatrace provides a hosted MCP server that enables Azure SRE Agent to interact with the Dynatrace observability platform via SSE (Server-Sent Events) transport. Query logs, investigate problems, analyze security vulnerabilities, and execute DQL (Dynatrace Query Language), and generate timeseries forecasts directly from your SRE Agent conversations.

Key capabilities

CapabilityDescription
Create DQL queryGenerate DQL queries from natural language prompts
Explain DQL queryGet plain English explanations of DQL queries
Ask DynatraceAsk general Dynatrace questions (workflows, alerts, etc.)
Run DQL queryExecute DQL and get results (up to 1000 records)
Query problemsList active or closed Davis Problems
Get problem by IDGet detailed problem information
Get vulnerabilitiesList open security vulnerabilities by risk level
Timeseries forecastPredict future values using statistical models

NOTE: This is the official Dynatrace-hosted MCP server. For the community OSS version, see the alternate configuration section.


Prerequisites

  • Azure SRE Agent resource
  • Dynatrace Platform account (SaaS)
  • Platform Token or OAuth Client with required scopes
  • Your Dynatrace environment URL (e.g., https://abc12345.apps.dynatrace.com)

Step 1: Get your Dynatrace credentials

Create a Platform Token

  1. Go to My Platform Tokens
  2. Click + Create token
  3. Add the token name, expiration date, and required scopes (see below). For more details on creating platform tokens click here
  4. Copy the generated token

Required scopes

ToolRequired Scopes
MCP Gateway accessmcp-gateway:servers:invoke, mcp-gateway:servers:read
Create DQL querydavis-copilot:nl2dql:execute
Explain DQL querydavis-copilot:dql2nl:execute
Ask Dynatracedavis-copilot:conversations:execute
Run DQL querystorage:buckets:read
Query problemsstorage:buckets:read, storage:events:read
Get vulnerabilitiesstorage:security.events:read
Timeseries forecastdavis:analyzers:read, davis:analyzers:execute

IMPORTANT: The mcp-gateway:servers:invoke and mcp-gateway:servers:read scopes are required for SSE transport to the Dynatrace-hosted MCP server.


Step 2: Add the MCP connector

  1. Navigate to your Azure SRE Agent at sre.azure.com
  2. Select your agent from the list
  3. In the left navigation, expand Builder > Connectors
  4. Select Add connector
  5. In "Choose a connector", select MCP server (User provided connector)
  6. Click Next and configure:

For Streamable-HTTP connection (Dynatrace-hosted MCP):

FieldValue
Namedynatrace-mcp
Connection typeStreamable-HTTP
URLhttps://abc12345.apps.dynatrace.com/platform-reserved/mcp-gateway/v0.1/servers/dynatrace-mcp/mcp
Authentication methodBearer token
TokenYour Dynatrace Platform Token

TIP: Replace abc12345 with your Dynatrace tenant name from your environment URL.

  1. Click Next to review, then Add to save

Equivalent mcp.json configuration

For reference, here's the equivalent configuration in mcp.json format (used by VS Code and other MCP clients):

{
  "mcpServers": {
    "dynatrace-mcp": {
      "url": "https://abc12345.apps.dynatrace.com/platform-reserved/mcp-gateway/v0.1/servers/dynatrace-mcp/mcp",
      "transport": "streamable-http",
      "headers": {
        "Authorization": "Bearer YOUR_PLATFORM_TOKEN"
      }
    }
  }
}

Step 3: Create a Dynatrace subagent

Create a specialized agent focused on Dynatrace observability:

  1. In the left navigation, select Builder > Subagent builder
  2. Click + Create
  3. Switch to the YAML tab and paste this configuration:
api_version: azuresre.ai/v1
kind: AgentConfiguration
spec:
  name: DynatraceExpert
  system_prompt: |
    You are a Dynatrace observability expert with access to real-time monitoring data via the Dynatrace MCP server.
    
    ## Capabilities
    
    You can help users with:
    - Creating DQL queries from natural language descriptions
    - Explaining existing DQL queries in plain English
    - Running DQL queries to fetch logs, events, and metrics
    - Investigating active and closed Davis Problems
    - Analyzing security vulnerabilities by risk level
    - Getting Kubernetes cluster events
    - Generating timeseries forecasts
    
    ## Best Practices
    
    When working with DQL:
    - Use the Create DQL query tool to generate queries from natural language
    - Use the Explain DQL query tool to help users understand complex queries
    - Start with smaller timeframes (last 1h or 12h) to optimize query performance
    - Always explain what data your queries will return
    
    When investigating problems:
    - First query problems to understand the active issue landscape
    - Get detailed problem info including root cause analysis
    - Correlate with related logs and events
  agent_type: Autonomous
  enable_skills: true
  1. Click Create to save the subagent
  2. Click on the newly created subagent named "DynatraceExpert" and scroll down to the Tools section
  3. Under Tools select "Choose Tools"
  4. Filter for the "MCP Tool" and select your Dynatrace MCP Server Tools
  5. Click Save

Step 4: Test the integration

  1. Open a new chat session with your SRE Agent
  2. Try these example prompts:

DQL queries

Create a DQL query to find all error logs from the last hour

Explain this DQL query: fetch logs | filter loglevel == "ERROR" | limit 10

Run a DQL query to show me the top 10 slowest requests in the last 24 hours

Problem investigation

List active problems in my Dynatrace environment

Get details for problem P-12345

Query problems from the last 7 days that are now closed

Available tools

ToolDescriptionRequired Scopes
Create DQL queryGenerate DQL from natural languagedavis-copilot:nl2dql:execute
Explain DQL queryGet plain English explanation of DQLdavis-copilot:dql2nl:execute
Ask DynatraceGeneral Dynatrace questions and guidancedavis-copilot:conversations:execute
Run DQL queryExecute DQL and get results (max 1000 records)storage:buckets:read
Query problemsList active or closed Davis Problemsstorage:buckets:read, storage:events:read
Get problem by IDGet detailed problem informationstorage:buckets:read, storage:events:read
Get vulnerabilitiesList open security vulnerabilities by riskstorage:security.events:read
Get K8s cluster eventsGet events for Kubernetes clustersstorage:buckets:read
Timeseries forecastPredict future values using statistical modelsdavis:analyzers:read, davis:analyzers:execute

Troubleshooting

Connection issues

ErrorCauseSolution
401 UnauthorizedInvalid or expired tokenGenerate a new Platform Token
403 ForbiddenMissing scopesAdd mcp-gateway:servers:invoke and mcp-gateway:servers:read scopes
Could not connectWrong tenant URLVerify your tenant name in the URL
TimeoutNetwork issuesCheck network access to *.apps.dynatrace.com

Verify your token

Test your token with this curl command:

curl -X GET https://abc12345.apps.dynatrace.com/platform/management/v1/environment -H Authorization: Bearer YOUR_PLATFORM_TOKEN -H accept: application/json

Alternate: OSS MCP server

Dynatrace also provides an open-source MCP server with additional capabilities like entity management, workflows, and document creation. This version uses Stdio transport and requires Node.js.

NOTE: The OSS MCP server is community-supported. For help, use GitHub Issues.

Setup in Azure SRE Agent

  1. Navigate to Builder > Connectors > Add connector
  2. Select MCP server and click Next
  3. Configure the Stdio connection:
FieldValue
Namedynatrace-mcp-oss
Connection typeStdio
Commandnpx
Arguments-y, @dynatrace-oss/dynatrace-mcp-server@latest
Environment variablesSee table below

Environment variables:

KeyValue
DT_ENVIRONMENTYour Dynatrace environment URL
DT_PLATFORM_TOKENYour Platform Token with required scopes
DT_GRAIL_QUERY_BUDGET_GB100 (optional, limits query costs)
  1. Click Next to review, then Add to save

Equivalent mcp.json configuration

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

OSS server scopes

FeatureRequired Scopes
Read logsstorage:logs:read
Read metricsstorage:metrics:read
Read entitiesstorage:entities:read
Workflowsautomation:workflows:read, automation:workflows:write
Documentsdocument:documents:read, document:documents:write
Slackapp-settings:objects:read

Related content

Updated Feb 05, 2026
Version 2.0
No CommentsBe the first to comment