Grafana

Merge lets you securely connect your agents to Grafana and thousands of tools instantly

Available tools

View all tools by creating a free accountSee more tools

How to set up
Merge Agent Handler

In an mcp.json file, add the configuration below, and restart Cursor.

Learn more in the official documentation ↗

1{
2  "mcpServers": {
3    "agent-handler": {
4      "url": "https://ah-api.merge.dev/api/v1/tool-packs/{TOOL_PACK_ID}/registered-users/{REGISTERED_USER_ID}/mcp",
5      "headers": {
6        "Authorization": "Bearer yMt*****"
7      }
8    }
9  }
10}
Copy Code

Open your Claude Desktop configuration file and add the server configuration below. You'll also need to restart the application for the changes to take effect.

Make sure Claude is using the Node v20+.

Learn more in the official documentation ↗

1{
2  "mcpServers": {
3    "agent-handler": {
4      "command": "npx",
5      "args": [
6        "-y",
7        "mcp-remote@latest",
8        "https://ah-api.merge.dev/api/v1/tool-packs/{TOOL_PACK_ID}/registered-users/{REGISTERED_USER_ID}/mcp",
9        "--header",
10        "Authorization: Bearer ${AUTH_TOKEN}"
11      ],
12      "env": {
13        "AUTH_TOKEN": "yMt*****"
14      }
15    }
16  }
17}
Copy Code
Copied!

Open your Windsurf MCP configuration file and add the server configuration below.
Click on the refresh button in the top right of the Manage MCP server page or in the top right of the chat box in the box icon.

Learn more in the official documentation ↗

1{
2    "mcpServers": {
3      "agent-handler": {
4        "command": "npx",
5        "args": [
6          "-y",
7          "mcp-remote@latest",
8          "https://ah-api.merge.dev/api/v1/tool-packs/<tool-pack-id>/registered-users/<registered-user-id>/mcp",
9          "--header",
10          "Authorization: Bearer ${AUTH_TOKEN}"
11        ],
12        "env": {
13          "AUTH_TOKEN": "<ah-production-access-key>"
14        }
15      }
16    }
17  }
Copy Code

In Command Palette (Cmd+Shift+P on macOS, Ctrl+Shift+P on Windows), run "MCP: Open User Configuration".

You can then add the configuration below and press "start" right under servers. Enter the auth token when prompted.

Learn more in the official documentation ↗

1{
2  "inputs": [
3    {
4      "type": "promptString",
5      "id": "agent-handler-auth",
6      "description": "Agent Handler AUTH_TOKEN", // "yMt*****" when prompt
7      "password": true
8    }
9  ],
10  "servers": {
11    "agent-handler": {
12      "type": "stdio",
13      "command": "npx",
14      "args": [
15        "-y",
16        "mcp-remote@latest",
17        "https://ah-api.merge.dev/api/v1/tool-packs/{TOOL_PACK_ID}/registered-users/{REGISTERED_USER_ID}/mcp",
18        "--header",
19        "Authorization: Bearer ${input:agent-handler-auth}"
20      ]
21    }
22  }
23}
Copy Code

FAQ on integrating with Grafana’s API

Heading

What is a Grafana MCP?

A Grafana MCP is a server that exposes Grafana data and functionality to your agents through callable tools. Your agents can use those tools to query dashboards, manage alert rules, create annotations, search data sources, and more.

Grafana offers an official MCP server, but you can also use one from a third-party platform, like Merge Agent Handler.

How can I use the Grafana MCP server?

The use cases naturally depend on the agent you've built, but here are a few common ones:

  • Incident context retrieval: When a new incident is opened in PagerDuty or Jira, an agent can search Grafana for the relevant dashboard and pull recent annotations, giving on-call engineers immediate visual context without leaving their terminal
  • Automated post-incident annotation: After an incident is marked resolved in your incident management tool, an agent can create a Grafana annotation on the affected dashboard at the exact timestamp, so the event is permanently visible in the metrics timeline
  • Alert rule auditing: An agent can pull all active alert rules across a Grafana organization, flag ones that haven't fired in over 90 days or have misconfigured contact points, and post a weekly hygiene report to a Slack channel
  • On-call morning briefing: At the start of each shift, an agent can compile all firing alert rules, recent annotations, and data source health into a structured summary and deliver it to the on-call engineer via their preferred channel

What are popular tools for Grafana's MCP server?

Here are some of the most commonly used tools:

  • list_alert_rules: retrieves all alert rules configured in a Grafana organization, including state, severity, and assigned contact points. Useful for agents that audit alert coverage or check firing conditions before escalating an incident
  • search_dashboards: searches across all Grafana dashboards by keyword, folder, or tag. Call this when an agent needs to locate the right dashboard to pull context for an active alert or incident
  • get_dashboard: fetches the full configuration and panel metadata for a specific dashboard. Good for workflows that need to surface dashboard details or validate panel structure programmatically
  • create_annotation: adds a timestamped annotation to a dashboard, which agents can use to mark deployments, incidents, or configuration changes directly on the metrics timeline
  • create_alert_rule: creates a new alert rule with defined thresholds, evaluation intervals, and contact points. Use this when an agent needs to provision monitoring for a new service or environment automatically
  • list_datasources: returns all data sources connected to a Grafana instance, including type and connection status. Helpful when an agent needs to verify data source availability before running a query or building a dashboard

What makes Merge Agent Handler's Grafana MCP server better than alternative Grafana MCP servers?

Here's why teams choose Merge Agent Handler's Grafana MCP server over building their own or using another:

  • Enterprise-grade security and DLP: Merge Agent Handler includes built-in data loss prevention controls that let you block or redact sensitive fields before they reach an agent. For Grafana, this means you can prevent alert thresholds, on-call contact details, and infrastructure topology from being surfaced to an agent that only needs read access to dashboards
  • Managed authentication and credentials: Merge stores and refreshes Grafana credentials on your behalf. You never pass raw API keys into an agent or deal with key rotation breaking an on-call workflow at 2am
  • Real-time observability and audit trail: Every tool call made against Grafana is logged with timestamp, tool name, input parameters, and response metadata. You can see exactly which dashboards an agent searched, which alert rules it read, and which annotations it created, without adding any instrumentation
  • Tool Packs and controlled access: Tool Packs let you scope exactly which Grafana tools an agent can reach. A read-only incident context agent gets dashboard search and annotation listing. A provisioning agent gets alert rule creation. Neither gets access to the other's tools

How can I start using Merge Agent Handler's Grafana MCP server?

You can take the following steps:

1. Create or log into your Merge Agent Handler account.

2. Install the Merge CLI by running pipx install merge-api, then run merge configure to link the CLI to your Merge account and merge login to authenticate your session.

3. Register the Agent Handler MCP server with Claude Code by running claude mcp add --transport http agent-handler https://ah-api.merge.dev/mcp, then open Claude Code and run /mcp to confirm agent-handler appears with a connected status.

4. Select agent-handler from the MCP list. This opens a browser window where you select which integrations to authenticate. Choose Grafana and complete the auth flow. Merge stores and manages the credentials going forward.

5. Open a Claude Code session and start querying Grafana data directly. The first time you use a Grafana tool, a Magic Link may appear to complete connector authentication.

If you want to connect Merge Agent Handler's Grafana MCP with internal or customer-facing agentic products, you can follow the steps in our docs.

Explore other MCP servers built and managed by Merge

View Docs
OneDrive GCC High
OneDrive GCC High
OneNote
OneNote
OpenRouter
OpenRouter
Oracle HCM
Oracle HCM
Oracle Sales Cloud
Oracle Sales Cloud
Oracle SCM
Oracle SCM
Ordinal
Ordinal
Otter.ai
Otter.ai
Oura
Oura
Outlook
Outlook
Outlook GCC High
Outlook GCC High
Paddle
Paddle
PagerDuty
PagerDuty
PandaDoc
PandaDoc
PayPal
PayPal
Peec AI
Peec AI
Pendo
Pendo
Pipedrive
Pipedrive
PitchBook
PitchBook
Plaid
Plaid
PlanetScale
PlanetScale
Plaud
Plaud
Podium
Podium
Port
Port

Ready to try it out?

Whether you're an engineer experimenting with agents or a product manager looking to add tools, you can get started for free now