Skip to main content
Glama
RakeshSingh-21

Dynatrace MCP Server

README.md
# Dynatrace MCP Server

This project implements a Model Context Protocol (MCP) server that provides an interface to interact with Dynatrace Grail and API endpoints.

## Features

- **DQL Execution:** Execute arbitrary Dynatrace Query Language (DQL) queries.
- **Log Retrieval:** Fetch and filter application logs.
- **Problem Reporting:** Get current active problems from Dynatrace.
- **Metric Querying:** Query metrics using DQL.


## Prerequisites

- Python 3.14+
- A Dynatrace environment with API access tokens.

## Setup

1. **Environment Variables:** Create a `.env` file in the root directory with the following variables:
   ```text
   DYNATRACE_URL=<your-dynatrace-url>
   DYNATRACE_API_TOKEN=<your-api-token>
   DYNATRACE_PLATFORM_URL=<your-platform-url>
   DYNATRACE_PLATFORM_TOKEN=<your-platform-token>
   DYNATRACE_LOG_INGEST_TOKEN=<your-log-ingest-token>
   ```

2. **Dependencies:** Install the required dependencies:
   ```bash
   pip install -r requirements.txt
   ```

## Usage

Start the MCP server:
```bash
python server.py
```


## Add this into gemini/settings.json
```
"mcpServers": {
   "dynatrace": {
   "command": "D:\\Dynatrace_MCP\\venv\\Scripts\\python.exe",
   "args": [
      "D:\\Dynatrace_MCP\\server.py"
   ]
   }
}

```
## After that run gemini CLI