|
| 1 | +--- |
| 2 | +title: Configure an Azure Managed Grafana remote MCP server |
| 3 | +description: Discover MCP tools for Azure Managed Grafana. Query Application Insights, Azure Data Explorer, and more with secure authentication and easy setup. |
| 4 | +#customer intent: As a developer, I want to configure my application to interact with the AMG-MCP endpoint so that I can programmatically manage my Azure Managed Grafana instance. |
| 5 | +author: weng5e |
| 6 | +ms.author: wuweng |
| 7 | +ms.reviewer: malev |
| 8 | +ms.date: 03/09/2026 |
| 9 | +ms.topic: concept-article |
| 10 | +ms.service: azure-managed-grafana |
| 11 | +--- |
| 12 | + |
| 13 | +# Configure an Azure Managed Grafana remote MCP server |
| 14 | + |
| 15 | +Every Azure Managed Grafana instance includes a built-in Model Context Protocol (MCP) server endpoint called AMG-MCP. The AMG-MCP endpoint allows tools and applications to interact programmatically with the Grafana instance using the MCP. The AMG-MCP endpoint uses the same authentication mechanism as the Grafana instance, supporting both Entra ID and the Grafana service account token. |
| 16 | + |
| 17 | +## Endpoint path |
| 18 | + |
| 19 | +The AMG-MCP endpoint path format is `https://<grafana-endpoint>/api/azure-mcp`. For example, the endpoint could look like: `https://my-grafana-<guid>.<location>.grafana.azure.com/api/azure-mcp`. |
| 20 | + |
| 21 | +## Available MCP tools |
| 22 | + |
| 23 | +AMG-MCP provides the following tools for interacting with Azure Managed Grafana: |
| 24 | + |
| 25 | +| Tool Name | Description | |
| 26 | +|-----------|-------------| |
| 27 | +| `amgmcp_insights_get_failures` | Get Failures insights. Returns failure summary data from Application Insights, such as failed requests, failed dependencies, and exceptions. | |
| 28 | +| `amgmcp_insights_get_agents` | Get GenAI agent insights. Returns GenAI agent related information from Application Insights, such as agent invocations, token usage, and latency. Queries data following 'OpenTelemetry for Generative AI' Semantic Conventions. | |
| 29 | +| `amgmcp_kusto_get_metadata` | Get the metadata for connected Azure Data Explorer (Kusto) clusters. Lists all Azure Data Explorer data sources, and for each data source, gets the clusterUrl, databases and schema. | |
| 30 | +| `amgmcp_kusto_query` | Query data in Azure Data Explorer (Kusto) cluster. | |
| 31 | +| `amgmcp_mssql_get_metadata` | Get the metadata for all connected Microsoft SQL Server data sources. Lists the databases, tables, and column schemas for each Microsoft SQL Server data source. | |
| 32 | +| `amgmcp_mssql_query` | Query data in a Microsoft SQL Server data source. | |
| 33 | +| `amgmcp_query_application_insights_trace` | Query Application Insights Trace through Grafana Azure Monitor data source. When trace data is stored in multiple Application Insights, this tool aggregates the data. | |
| 34 | +| `amgmcp_query_azure_subscriptions` | List all the Azure subscriptions that the Grafana Azure Monitor data source can access. | |
| 35 | +| `amgmcp_query_resource_graph` | Query Azure Resource Graph (ARG) through Grafana Azure Monitor data source. | |
| 36 | +| `amgmcp_query_resource_log` | Query Azure Resource Log through Grafana Azure Monitor data source. | |
| 37 | +| `amgmcp_query_resource_metric` | Query Azure Resource Metric values through Grafana Azure Monitor data source. | |
| 38 | +| `amgmcp_query_resource_metric_definition` | Query Azure Resource Metric Definitions through Grafana Azure Monitor data source. | |
| 39 | +| `amgmcp_dashboard_search` | Search for Grafana dashboards by a query string. Returns a list of matching dashboards with details like title, UID, folder, tags, and URL. | |
| 40 | +| `amgmcp_datasource_list` | List all Grafana data sources. | |
| 41 | + |
| 42 | +## MCP configuration |
| 43 | + |
| 44 | +To connect to the AMG-MCP endpoint, you need to configure your MCP client with the appropriate settings. AMG-MCP supports two authentication methods: |
| 45 | + |
| 46 | +- [**Grafana service account token:**](#grafana-service-account-token) A token generated from your Grafana instance (format: `glsa_xxx`) |
| 47 | +- [**Entra ID token:**](#entra-id-token) An Azure AD/Entra ID token (e.g., from a managed identity or service principal) |
| 48 | + |
| 49 | +### Grafana service account token |
| 50 | + |
| 51 | +Use a Grafana service account token for authentication. Start by creating a token: |
| 52 | + |
| 53 | +1. In the Grafana instance UI, navigate to **Administration > Service accounts**. |
| 54 | +1. [Create a new service account using the appropriate permissions.](./how-to-service-accounts.md#create-a-service-account) |
| 55 | +1. [Generate a token](./how-to-service-accounts.md#add-a-service-account-token) |
| 56 | +1. Copy the Grafana service account token (format: `glsa_xxx`) and paste into your configuration settings: |
| 57 | + |
| 58 | + ```json |
| 59 | + { |
| 60 | + "my-grafana-mcp-server": { |
| 61 | + "disabled": false, |
| 62 | + "timeout": 60, |
| 63 | + "type": "streamableHttp", |
| 64 | + "url": "https://my-grafana-d5ggtqegcr2safcp.wcus.grafana.azure.com/api/azure-mcp", |
| 65 | + "headers": { |
| 66 | + "Authorization": "Bearer glsa_xxxxxxxxxxxxxxxxxxxxxxxx_xxxxxxx" |
| 67 | + } |
| 68 | + } |
| 69 | + } |
| 70 | + ``` |
| 71 | + |
| 72 | +### Entra ID token |
| 73 | + |
| 74 | +Use an Entra ID token (Azure AD token) for authentication. This approach is useful when using managed identities or service principals. |
| 75 | + |
| 76 | +1. Use the Azure CLI to obtain an Entra ID token associated with the Azure Managed Grafana resource ID: |
| 77 | + |
| 78 | + ```bash |
| 79 | + az account get-access-token --resource ce34e7e5-485f-4d76-964f-b3d2b16d1e4f --query accessToken -o tsv |
| 80 | + ``` |
| 81 | + |
| 82 | +1. Alternatively, use a managed identity to acquire a token programmatically with the Azure Managed Grafana audience `ce34e7e5-485f-4d76-964f-b3d2b16d1e4f`. |
| 83 | + |
| 84 | + ```json |
| 85 | + { |
| 86 | + "my-grafana-mcp-server": { |
| 87 | + "disabled": false, |
| 88 | + "timeout": 60, |
| 89 | + "type": "streamableHttp", |
| 90 | + "url": "https://my-grafana-d5ggtqegcr2safcp.wcus.grafana.azure.com/api/azure-mcp", |
| 91 | + "headers": { |
| 92 | + "Authorization": "Bearer <entra-id-token>" |
| 93 | + } |
| 94 | + } |
| 95 | + } |
| 96 | + ``` |
| 97 | + |
| 98 | +## Examples |
| 99 | + |
| 100 | +The following examples further demonstrate configuring AMG-MCP in your settings. |
| 101 | + |
| 102 | +### Example 1: Visual Studio Code configuration |
| 103 | + |
| 104 | +To configure MCP for Visual Studio Code, use configuration settings similar to the following example. |
| 105 | + |
| 106 | +```json |
| 107 | +{ |
| 108 | + "<your-grafana-mcp-server-name>": { |
| 109 | + "type": "http", |
| 110 | + "url": "https://<grafana-endpoint>/api/azure-mcp", |
| 111 | + "headers": { |
| 112 | + "Authorization": "Bearer <token>" |
| 113 | + } |
| 114 | + } |
| 115 | +} |
| 116 | +``` |
| 117 | + |
| 118 | +**Configuration parameters:** |
| 119 | + |
| 120 | +| Parameter | Description | |
| 121 | +|-----------|-------------| |
| 122 | +| `type` | Transport type. Use `http` for remote MCP endpoints. | |
| 123 | +| `url` | The AMG-MCP endpoint URL: `https://<grafana-endpoint>/api/azure-mcp` | |
| 124 | +| `headers.Authorization` | Bearer token - either a Grafana service account token or an Entra ID token. | |
| 125 | + |
| 126 | +### Example 2: Cline configuration |
| 127 | + |
| 128 | +To configure MCP for Cline, use configuration settings similar to the following example. |
| 129 | + |
| 130 | +```json |
| 131 | +{ |
| 132 | + "<your-grafana-mcp-server-name>": { |
| 133 | + "disabled": false, |
| 134 | + "timeout": 60, |
| 135 | + "type": "streamableHttp", |
| 136 | + "url": "https://<grafana-endpoint>/api/azure-mcp", |
| 137 | + "headers": { |
| 138 | + "Authorization": "Bearer <token>" |
| 139 | + } |
| 140 | + } |
| 141 | +} |
| 142 | +``` |
| 143 | + |
| 144 | +**Configuration parameters:** |
| 145 | + |
| 146 | +| Parameter | Description | |
| 147 | +|-----------|-------------| |
| 148 | +| `disabled` | Set to `false` to enable the MCP server connection. | |
| 149 | +| `timeout` | Connection timeout in seconds. | |
| 150 | +| `type` | Transport type. Use `streamableHttp` for remote MCP endpoints. | |
| 151 | +| `url` | The AMG-MCP endpoint URL: `https://<grafana-endpoint>/api/azure-mcp` | |
| 152 | +| `headers.Authorization` | Bearer token - either a Grafana service account token or an Entra ID token. | |
| 153 | + |
| 154 | + |
| 155 | +## Limitation |
| 156 | + |
| 157 | +Currently, AMG-MCP endpoint is included with Azure Managed Grafana instances only in Azure Public Cloud, not in sovereign clouds. |
| 158 | + |
| 159 | +## Troubleshooting |
| 160 | + |
| 161 | +If you encounter any issues, open an issue in the [Azure Managed Grafana GitHub repo](https://aka.ms/managed-grafana/issues). |
| 162 | + |
| 163 | +## Next steps |
| 164 | + |
| 165 | +> [!div class="nextstepaction"] |
| 166 | +> [Configure MCP for AI Foundry agents](./how-to-configure-mcp-for-ai-foundry.md) |
| 167 | +> |
| 168 | +> [!div class="nextstepaction"] |
| 169 | +> [Enable zone redundancy](./how-to-enable-zone-redundancy.md) |
0 commit comments