This page provides an overview of the Dynatrace Model Context Protocol (MCP) server and how you can use it to maximize your efficiency and quickly complete a variety of tasks, such as generating, executing or explaining a DQL query, with the help of an MCP client (external agent).
Currently, the MCP server supports the following use cases:
The Dynatrace MCP server is a server that hosts tools that can be used to fulfill specific use cases. An external agent, such as GitHub CoPilot VS Code integration or Claude desktop, can then make use of the MCP server and its tools to execute a series of calls when fulfilling a user request.
To learn more about MCP servers, see What is the Model Context Protocol (MCP)?.
Dynatrace provides a dynatrace-mcp server that hosts a collection of tools designed for external connections. It currently hosts the following tools:
You can connect to an MCP server via a URL by using the following address:
https://{environment-name}.apps.dynatrace.com/platform-reserved/mcp-gateway/v0.1/servers/dynatrace-mcp/mcp
You can setup connections by using VS Code and its chat integration, or by using any other tool of your choice.
Every request to the MCP server needs a bearer token in the authorization header. You can authenticate in one of the following ways:
The MCP server doesn't support CIMD, public OAuth clients, or dynamic client registration yet. To authenticate via an OAuth client, you must use a confidential OAuth client and provide both its client ID and client secret. For more information about creating an OAuth client with the Authorization code grant type, see OAuth clients.
Regardless of the authentication method, the bearer token works only within the scope of your user permissions. To use the Dynatrace MCP server, you need to have all of the necessary permissions. For more information, see Platform tokens or OAuth clients, depending on the type of authentication you use.
In addition to the tool permissions mentioned in Server and server tools, both the user and the token must have the following permissions to access and invoke server tools:
mcp-gateway:servers:invokemcp-gateway:servers:readYou can connect the Dynatrace MCP server to VS Code by using the MCP client support available through GitHub Copilot Chat or any MCP‑enabled extension. Additionally, you need to set up authentication, configure VS Code, and validate the setup.
To set up a proper configuration and connect the Dynatrace MCP server to the VS Code, follow the steps below:
To configure VS Code for using Dynatrace MCP server:
Open your workspace in VS Code.
In the .vscode folder, create or open mcp.json file in your project. The resulting path should look like this: .vscode/mcp.json.
Add an MCP server configuration. The configuration depends on how you want to authenticate.
Add a configuration similar to the one below, providing the bearer token in the authorization header:
{"servers": {"dynatrace-mcp": {"url": "https://{environment-name}.apps.dynatrace.com/platform-reserved/mcp-gateway/v0.1/servers/dynatrace-mcp/mcp","headers": {"Authorization": "Bearer YOUR_BEARER_TOKEN_HERE"}}}}
Replace:
{environment-name} with your Dynatrace environment identifier.YOUR_BEARER_TOKEN_HERE with the token you generated earlier.Save your file changes.
Select Start above the server name. If you configured an OAuth client, enter your client ID and client secret when VS Code prompts you.
When you authenticate with a bearer token, VS Code doesn't automatically refresh it. After the token expires, you need to generate a new one and update your configuration accordingly. When you authenticate via an OAuth client, VS Code refreshes the access token automatically.
For a more detailed guide on how to set up a VS Code configuration, see the official Visual Studio Code guide.
To confirm the connection works:
ctrl+# to open the list of contexts.dynatrace-mcp (All tools).Show me last 10 logs.
Ensure that both the user and the token have the storage:logs:read permission. Otherwise, you won't be able to see any logs.
If your configuration is correct, you will receive a response from the Dynatrace MCP server.