An MCP (Model Context Protocol) server that integrates Claude with Dynatrace Managed for environment monitoring, problem analysis, and infrastructure diagnostics.
- Problem monitoring — retrieve and analyze active problems with severity filtering
- Entity search & details — search hosts, services, and applications by name, tag, or health state
- Metric analysis — time series data, trend analysis, and AI-powered metric recommendations
- Event tracking — monitor system events and deployments
- SLO monitoring — check Service Level Objectives status and compliance
- Host inventory — list all monitored hosts with CPU, memory, OS, and network zone info
- Analysis guidelines — built-in rules for interpreting severity, detecting false positives, and investigation order
- MCP Resources — analysis guidelines exposed as
dynatrace://guidelines/analysis - Tool annotations — all tools declare
readOnlyHint=truefor MCP-compliant safety metadata
- Python 3.10+
- Access to a Dynatrace Managed instance
- API token with required permissions
git clone https://github.com/YOUR_USERNAME/DynatraceManagedMCPServer.git
cd DynatraceManagedMCPServerpython -m venv .venv
source .venv/bin/activate # Linux/Mac
# or
.venv\Scripts\activate # WindowsOption A: pip install (editable)
pip install -e .Option B: requirements.txt
pip install -r requirements.txtIn your Dynatrace Managed instance:
- Go to Settings > Integration > Dynatrace API
- Click Generate token
- Name the token (e.g., "MCP Server")
- Select the following permissions:
problems.readentities.readmetrics.readevents.readnetworkZones.readsettings.read
- Copy the generated token
Copy the example file and fill in your credentials:
cp .env.example .envEdit .env with your values:
DYNATRACE_URL=https://your-dynatrace-managed-instance.com
DYNATRACE_ENVIRONMENT_ID=your-environment-id
DYNATRACE_TOKEN=dt0c01.XXXXXXXX.YYYYYYYY# Using the package module (recommended — run from src/)
cd src && python -m dynatrace_mcp_server
# Or using the compatibility shim (from repo root)
python dynatrace_mcp_server.py
# Or on Windows
run_server.batIf configured correctly, the server will start without errors and wait for MCP connections.
| OS | Path |
|---|---|
| Windows | %APPDATA%\Claude\claude_desktop_config.json |
| Mac | ~/Library/Application Support/Claude/claude_desktop_config.json |
| Linux | ~/.config/Claude/claude_desktop_config.json |
{
"mcpServers": {
"dynatrace": {
"command": "python",
"args": ["-m", "dynatrace_mcp_server"],
"cwd": "/path/to/DynatraceManagedMCPServer/src",
"env": {
"DYNATRACE_URL": "https://your-instance.com",
"DYNATRACE_ENVIRONMENT_ID": "your-environment-id",
"DYNATRACE_TOKEN": "dt0c01.XXXXXXXX.YYYYYYYY"
}
}
}
}This approach uses a .env file for credentials and a startup script:
Windows:
{
"mcpServers": {
"dynatrace": {
"command": "C:\\path\\to\\DynatraceManagedMCPServer\\run_server.bat",
"args": [],
"env": {}
}
}
}Mac/Linux:
{
"mcpServers": {
"dynatrace": {
"command": "/path/to/DynatraceManagedMCPServer/run_server.sh",
"args": [],
"env": {}
}
}
}{
"mcpServers": {
"dynatrace": {
"command": "python",
"args": ["/path/to/dynatrace_mcp_server.py"],
"env": {
"DYNATRACE_URL": "https://your-instance.com",
"DYNATRACE_ENVIRONMENT_ID": "your-environment-id",
"DYNATRACE_TOKEN": "dt0c01.XXXXXXXX.YYYYYYYY"
}
}
}
}Restart Claude Desktop after changing the configuration.
All tools declare readOnlyHint=true — they only read data from Dynatrace, never modify it.
| Tool | Description |
|---|---|
get_problems |
Get problems with filtering by status (open/closed/all) and severity level |
get_problem_details |
Detailed problem analysis including evidence, root cause, and affected entities |
search_entities |
Search entities by name/pattern with filters for type, tag, health state, management zone |
get_entity_details |
Detailed entity info including properties, relationships, tags, and management zones |
list_entity_types |
List all available entity types in the environment |
get_events |
Get events filtered by type and entity selector |
get_slos |
Get SLO status, target values, and actual values |
test_connection |
Verify Dynatrace API connectivity |
suggest_optimal_metrics |
AI-powered metric recommendations for performance, capacity, or reliability analysis |
analyze_metric_trends |
Automated trend analysis with anomaly detection |
get_time_series_data |
Raw time series data for custom analysis |
get_monitored_hosts |
List all monitored hosts with CPU, memory, OS, and network zone details |
get_analysis_guidelines |
Built-in rules for severity interpretation and false positive detection |
| URI | Description |
|---|---|
dynatrace://guidelines/analysis |
Analysis guidelines markdown — accessible via MCP resources/read |
After configuring the server, you can ask Claude questions like:
- "What are the currently active problems in Dynatrace?"
- "Analyze problem P-2602848 in detail"
- "Check the health of host XYZ"
- "Show CPU metrics for application servers over the last 12 hours"
- "Are there any SLO violations?"
- "List all monitored hosts and their memory usage"
- "What events occurred in the last 6 hours?"
- "Suggest the best metrics to analyze for this service's performance"
DynatraceManagedMCPServer/
├── dynatrace_mcp_server.py # Compatibility shim
├── pyproject.toml # Package metadata & build config
├── requirements.txt # Pinned dependencies
├── run_server.bat # Windows launcher
├── run_server.sh # Linux/Mac launcher
├── analysis_guidelines.md # Severity rules & investigation order
├── DYNATRACE_METRICS.md # Metric reference
└── src/
└── dynatrace_mcp_server/
├── __init__.py # Version string
├── __main__.py # Entry point (python -m)
├── server.py # MCP server core + resource exposure
├── config.py # Env vars & named constants
├── client.py # Dynatrace API client
├── utils.py # Shared helpers
└── tools/
├── __init__.py # Tool registry aggregation
├── problems.py # get_problems, get_problem_details
├── entities.py # search_entities, get_entity_details, list_entity_types
├── metrics.py # suggest_optimal_metrics, analyze_metric_trends, get_time_series_data
├── events.py # get_events
├── slos.py # get_slos
├── hosts.py # get_monitored_hosts
└── diagnostics.py # test_connection, get_analysis_guidelines
- Verify the API token is valid and has the required permissions
- Make sure the Dynatrace URL is correct (no trailing
/)
- Check that the Dynatrace instance is reachable from your network
- Verify your firewall allows outbound HTTPS connections
- Ensure all dependencies are installed:
pip install -e .orpip install -r requirements.txt - Verify Python version is 3.10+
- Check error logs in the console
- Verify the PYTHONPATH includes the
srcdirectory - Check that environment variables are set
- Restart Claude Desktop after configuration changes
- Never commit API tokens to a repository
- Use environment variables or
.envfiles for credentials - Rotate API tokens regularly
- Limit token permissions to the minimum required
- Add
.envto.gitignore(already included)