Grafana Integration
The Grafana integration allows MCP Express to run Grafana alerting actions so non-developer users can list rules, inspect active alerts, and manage silences with LLM and mcp tools.
Capabilities
- Alert Rule Visibility: List configured Grafana alert rules.
- Firing Alert Visibility: Get currently firing alerts.
- Silence Management: List, create, and delete alerting silences.
- Secure Token Authentication: Use a Grafana service account token for authentication.
Integration
To connect MCP Express to Grafana, configure authentication and alerting permissions before enabling alert management tools. This integration provides secure access to list alert rules, inspect firing alerts, and manage silences using a Grafana service account token.
Once connected, you can automate alert monitoring and silence workflows, keeping all operations scoped to the configured Grafana instance.
Connection Parameters
| Parameter | Technical Description | Required |
|---|---|---|
| Grafana URL | Base URL for your Grafana instance. | Yes |
| Grafana Token | Grafana service account token used to authenticate API requests. This integration requires a service account token. | Yes |
Service Account Required: You must create a dedicated Grafana service account with alerting permissions enabled. Personal user tokens are not recommended for production automation.
Best Practice: Use a dedicated service account for this integration only. Grant only alerting permissions and rotate tokens regularly.
Create a Grafana Service Account Token
Create a dedicated service account and token before configuring MCP Express:
If your Grafana UI differs from the steps below, refer to the official documentation: Service accounts.
- In Grafana, go to Administration > Users and access > Service accounts.
- Select New service account.
- Enter a name such as
mcp-express-alertingand save. - Assign the alerting permission to this service account.
- Open the service account and create a token.
- Copy the generated token and use it for the
Grafana Tokenfield in your mcp-express configuration.
Configuration
Once the Grafana connection is validated, configuration defines how MCP Express exposes alerting operations as callable tools. Each action requires the base connection parameters and may require additional action-specific parameters at runtime.
Action Configuration
Use action configuration to define which alerting operation the tool performs and which parameters are resolved at runtime.
Supported Actions
The following actions are supported by the Grafana integration:
- List Alert Rules: List all configured Grafana alert rules.
- Get Firing Alerts: Retrieve currently firing alerts, with optional label filters.
- List Silences: List all configured alerting silences.
- Create Silence: Create a new silence for a specific alert rule.
- Delete Silence: Delete an existing silence by ID.
Common Runtime Parameters
Use the following parameters according to the configured action:
| Parameter | Required | Description |
|---|---|---|
alert_rule_uid | Some | The UID of the alert rule. Required for Create Silence. |
id | Some | The silence ID. Required for Delete Silence. |
created_by | Some | User or team identifier creating the silence. Required for Create Silence. |
comment | Some | Reason for the silence. Required for Create Silence. |
Governance Controls
When configuring actions:
- Restrict
Create SilenceandDelete Silenceactions to approved operators only. - Validate all silence parameters before execution.
Use the built-in testing utility to verify required attribute presence, parameter types, and permission behavior before production use.
Security & Patterns
Use these controls to run Grafana alerting actions safely in production. The primary goals are to keep alerting access scoped, minimize token exposure, and prevent unintended silence mutations.
Guardrails & Restricted Operations
Restrict each tool to approved actions and alert rule scopes. Avoid exposing unrestricted silence creation or deletion when use cases only need focused alerting visibility.
Allowing unconstrained runtime selection of operations such as Create silence or Delete Silence can lead to unintended alert silences or alert gaps. Enforce allowlists for operations or disable these tools if not required.
Fully Dynamic AI Operations
Dynamic alert workflows can let the model choose which silences to create, which alerts to filter, or which rules to inspect at runtime. This improves flexibility but increases risk of unintended silences, alert fatigue, or access beyond intended operational boundaries.
Only enable dynamic silence operations when action allowlists, duration caps, and approval workflows are all enforced.
Token Handling
- Treat
Grafana Tokenas a secret. Never share it in tickets, chats, screenshots, or prompts. - Store tokens in secure secret storage and rotate them on a schedule.
- Use dedicated service account tokens for MCP Express only.
- Use a dedicated service account with alerting-only permissions.
- Do not use personal user tokens for production automation.
- Immediately revoke any token you suspect is exposed.
Operational Patterns
- Short Silence Durations: Keep silence durations short and always include a clear
commentexplaining why. - Identify Silence Creators: Use
created_byvalues that clearly identify your on-call team or runbook identity. - Regular Audits: Review active silences regularly using
List silenceto ensure no orphaned silences. - Alert Rule Review: Periodically review active alert rules using
List alert ruleto keep your alerting strategy current.
Data Governance & Scopes
- Use a service account token with only alerting permissions enabled.
- Separate read-only alert visibility tools from write-capable silence workflows to keep audits clear.
- Validate alert rule UIDs and silence IDs before execution.
Common Setup Risks
- Token authentication failures: Invalid, expired, revoked, or under-scoped tokens cause authentication failures.
- Missing or wrong field types: Missing required fields or incorrect field types result in validation errors.
- Permission gaps: Service account missing alerting permissions will fail on alert operations.