---
title: "Azure Application Insights MCP"
type: "MCP Server"
slug: "azure-insights-mcp"
icon: "query_stats"
category: "Observability"
tags: ["Azure", "Application Insights", "KQL", "Telemetry", "Read-Only"]
installs: "0"
author: "Medisolv Platform Team"
authorInitial: "M"
lastUpdated: "2026-04-06"
popularity: "5.0/5"
reviewCount: "New"
platformTags: ["Python 3.11+", "Internal"]
installLabel: "mcp.json"
installCredentials:
  - key: NEXT_PUBLIC_APPINSIGHTS_CONNECTION_STRING
    label: "Application Insights Connection String"
    placeholder: "<APPINSIGHTS_CONNECTION_STRING>"
    description: "Connection string for the target Application Insights resource. It must include ApplicationId=<guid>."
    secret: true
  - key: APPINSIGHTS_API_KEY
    label: "Application Insights API Key"
    placeholder: "<APPINSIGHTS_API_KEY>"
    description: "API key with Read telemetry permission from Azure Portal → Application Insights → API Access."
    secret: true
securityBadges:
  - label: "Data Access"
    status: "Read-Only Telemetry"
  - label: "Secrets"
    status: "Azure API Key Required"
---

Read-only access to Azure Application Insights telemetry for debugging, performance analysis, and production troubleshooting with KQL-backed MCP tools.

## When to Use

Use this MCP when your agent needs to investigate runtime behavior, errors, or slow operations using live Application Insights data.

- Run ad hoc KQL queries against Application Insights without leaving your AI workspace
- Investigate recent exceptions, slow requests, and performance regressions
- Search for custom events tied to tRPC queries, Snowflake calls, or cache activity
- Summarize user session behavior and identify high-latency flows
- Validate that telemetry is flowing and the current API key/configuration is healthy

## Prerequisites

- **Python 3.11+** and `pip` installed
- An **Application Insights connection string** that includes `ApplicationId=<guid>`
- An **Application Insights API key** with **Read telemetry** permission

Upgrade `pip` and install the Azure Artifacts keyring helpers from public PyPI:

```powershell
pip install keyring artifacts-keyring
```

Then install the MCP package locally before configuring Augment. This avoids first-run timeouts caused by downloading packages during MCP startup:

```powershell
pip install azure-insights-mcp --index-url https://pypi.org/simple --extra-index-url "https://medisolv.pkgs.visualstudio.com/ai-discovery-portal/_packaging/ai-discovery/pypi/simple/"
```

To create an Application Insights API key:

- Go to **Azure Portal → Application Insights → API Access**
- Click **Create API Key**
- Enable **Read telemetry**
- Copy the generated value into `APPINSIGHTS_API_KEY`

## Installation

After you install the package locally, add the following MCP configuration to your AI tool. The placeholders below are the values the portal will prompt for when you click **Install in Auggie**.

```json
{
  "mcpServers": {
    "azure-insights": {
      "command": "python",
      "args": ["-m", "azure_insights_mcp.server"],
      "env": {
        "NEXT_PUBLIC_APPINSIGHTS_CONNECTION_STRING": "<APPINSIGHTS_CONNECTION_STRING>",
        "APPINSIGHTS_API_KEY": "<APPINSIGHTS_API_KEY>"
      }
    }
  }
}
```

This configuration assumes the same `python` on your `PATH` is the one where you ran `python -m pip install --user azure-insights-mcp ...`. If you use multiple Python installations, replace `"python"` with the full path to the correct interpreter.


## Example Prompts

> "Check Application Insights for the last 24 hours and show me the most common exceptions."

> "Find slow tRPC queries over 1 second and summarize the worst offenders."

> "Search for telemetry related to cache misses in the last 6 hours."

> "Verify whether the Application Insights MCP is configured correctly before we troubleshoot production errors."

## Troubleshooting

| Error | Likely Cause | Fix |
| --- | --- | --- |
| `APPINSIGHTS_API_KEY not configured` | Env var missing | Add `APPINSIGHTS_API_KEY` to the MCP `env` block |
| `Could not extract Application ID from connection string` | Connection string missing `ApplicationId` | Use the full connection string from Azure Portal |
| `401 Unauthorized` from Application Insights tools | API key invalid or expired | Recreate the API key in Application Insights |
| `403 Forbidden` | API key lacks permissions | Create a key with **Read telemetry** permission |

## Security Notes

- This MCP is **read-only**. It does not modify telemetry, infrastructure, or application state.
- Never commit production connection strings or API keys.
- Scope API keys to the minimum permissions required and rotate them when they expire.

