GitHub - dynatrace-oss/dynatrace-mcp: MCP server for Dynatrace Observability (original) (raw)

Dynatrace MCP Server

This remote MCP server allows interaction with the Dynatrace observability platform. Bring real-time observability data directly into your development workflow.

image

Use cases

Capabilities

Quickstart

Work in progress

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.

VS Code

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

Please note: In this config, the ${workspaceFolder} variable is used. This only works if the config is stored in the current workspaces, e.g., <your-repo>/.vscode/mcp.json. Alternatively, this can also be stored in user-settings, and you can define env as follows:

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

Claude Desktop

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

Amazon Q Developer CLI

The Amazon Q Developer CLI 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.

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

Environment Variables

A Dynatrace OAuth Client is needed to communicate with your Dynatrace Environment. Please follow the documentation aboutcreating an Oauth Client in Dynatrace, and set up the following environment variables in order for this MCP to work:

In addition, depending on the features you use, the following variables can be configured:

✨ Example prompts ✨

Use these example prompts as a starting point. Just copy them into your IDE or agent setup, adapt them to your services/stack/architecture, and extend them as needed. They’re here to help you imagine how real-time observability and automation work together in the MCP context in your IDE.

Find open vulnerabilities on production, setup alert.

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.

Debug intermittent 503 errors.

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.

Correlate memory issue with logs.

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?

Trace request flow analysis.

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?

Analyze Kubernetes cluster events.

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?

Development

For development purposes, you can use VSCode and GitHub Copilot.

First, enable Copilot for your Workspace .vscode/settings.json:

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

Second, add the MCP to .vscode/mcp.json:

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

Third, create a .env file in this repository (you can copy from .env.template) and configure environment variables as described above.

Last but not least, switch to Agent Mode in CoPilot and reload tools.

Notes

This product is not officially supported by Dynatrace. Please contact us via GitHub Issues if you have feature requests, questions, or need help.