assistant-mcp
Skill302 starsChanged 19 days agoApache-2.0View on GitHub
Connect AI coding agents (Claude Code, Cursor, VS Code, OpenAI Codex) to Grafana Cloud via the `mcp-grafana` Model Context Protocol server. Installs the server with `go install`, generates a Grafana service-account token, wires `~/.claude/settings.json` or `~/.cursor/mcp.json` with the `command` + `env` block, runs `--disable-write` for safer read-only sessions, switches to SSE transport for team-shared / VS Code setups, and verifies with `/mcp` + a `list_datasources` round-trip. Use when connecting Claude Code to Grafana, setting up MCP for Grafana, configuring the Grafana MCP server, using Grafana tools in Cursor/VS Code, querying Grafana from an AI agent, sharing the MCP server across a team — even when the user says "give my agent Grafana access", "let Claude see my metrics", or "Cursor + Grafana" without saying "MCP".
- Reads credentials
- Installs packages
In this repository54 other files it gives its agents.
- AGENTS.mdAGENTS.md
- admission-controlSkill
- app-sdk-conceptsSkill
- cue-kind-definitionSkill
- reconciler-logicSkill
- adaptive-metricsSkill
- adminSkill
- app-observabilitySkill
- cloud-integrationsSkill
- cost-managementSkill
- database-observabilitySkill
- dpm-finderSkill
- fleet-managementSkill
- frontend-session-rcaSkill
- infrastructureSkill
- loki-label-analyzerSkill
- ml-aiSkill
- oncall-irmSkill
- private-connectivitySkill
- prometheus-cardinality-troubleshooterSkill
- prometheus-label-strategySkill
- send-dataSkill
- synthetic-monitoring-checksSkill
- testingSkill
- alerting-irmSkill
- alloySkill
- beylaSkill
- dashboardingSkill
- grafana-ossSkill
- opentelemetrySkill
- promqlSkill
- skill-authoringSkill
- datasources-provisioningSkill
- k6-browser-testSkill
- k6-cloud-investigate-testSkill
- k6-docsSkill
- k6-manageSkill
- k6-perf-test-websiteSkill
- k6Skill
- k6-test-maintenanceSkill
- k6-trend-analysisSkill
- lokiSkill
- mimirSkill
- performance-rcaSkill
- profilecli-insightsSkill
- prometheusSkill
- pyroscopeSkill
- tempoSkill
- audit-and-reduce-dependenciesSkill
- check-npmSkill
- grafana-scenesSkill
- plugin-bundle-sizeSkill
- react-19-plugin-migrationSkill
- your-skill-nameSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 60
Check GRAFANA_URL has no trailing slash
- Distinctive: line 83
Verify the same way — Cursor surfaces MCP servers in its agent panel.
- Very specific: line 92
Use --disable-write for shared environments and CI.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Grafana Cloud MCP Server Setup
The Grafana MCP server exposes Grafana Cloud capabilities as tools that AI agents can call via the Model Context Protocol. Agents can then query metrics, search dashboards, manage alerts, investigate incidents, and interact with Fleet Management without leaving the coding environment.
Transports: stdio (agent spawns the server as a subprocess, simplest), or SSE (server runs independently, agents connect via HTTP — see references/sse-transport.md).
Common Workflows
Connecting Claude Code to Grafana (stdio)
# 1. Install the server
go install github.com/grafana/mcp-grafana/cmd/mcp-grafana@latest
# 2. Verify the binary
mcp-grafana --version
# If "command not found": ensure $GOPATH/bin (or $HOME/go/bin) is on PATH.- Get a service-account token: Grafana Cloud → Administration → Service Accounts → create with
Viewerrole (addEditoronly if you need writes) → generate token. Note the Grafana URL (e.g.https://myorg.grafana.net). Wire
~/.claude/settings.json(or project-local.claude/settings.json):{ "mcpServers": { "grafana": { "command": "mcp-grafana", "args": ["--disable-write"], "env": { "GRAFANA_URL": "https://myorg.grafana.net", "GRAFANA_API_KEY": "glsa_xxxx" } } } }--disable-writeis the safer default — drop it once you've verified the read path works.Restart Claude Code, then verify:
/mcpThe
grafanaserver should appear with its tool list. Then ask:What data sources are configured in my Grafana instance?A clean response = working. If the tool call fails:
- Check
GRAFANA_URLhas no trailing slash - Confirm the API key hasn't expired
- Re-run with
mcp-grafana --debugto see raw request/response
- Check
Connecting Cursor
Same Grafana token. Settings → Features → MCP Servers (or edit ~/.cursor/mcp.json):
{
"mcpServers": {
"grafana": {
"command": "mcp-grafana",
"args": ["--disable-write"],
"env": {
"GRAFANA_URL": "https://myorg.grafana.net",
"GRAFANA_API_KEY": "glsa_xxxx"
}
}
}
}Verify the same way — Cursor surfaces MCP servers in its agent panel; run a query like "list dashboards tagged kubernetes".
Sharing the server across a team (SSE)
Switch from stdio to SSE so the server runs once and many agents connect to it. Full setup with VS Code config in references/sse-transport.md.
Security considerations
- API keys belong in env vars or a secrets manager — never in committed files.
- Use
--disable-writefor shared environments and CI; only lift it on the specific machine where the agent should be allowed to mutate Grafana. - Scope service-account permissions to the minimum:
Vieweris enough for queries and dashboard reads. Only grantEditorwhen the agent needs to create dashboards or annotations. - Rotate tokens periodically via Administration → Service Accounts.
References
references/tools.md— full list of MCP tools exposed (query / dashboard / alerting / Fleet Management / annotations) and how to discover the live setreferences/sse-transport.md— SSE setup for team sharing and VS Code, with stdio-vs-SSE decision matrix + common failure modesreferences/a2a.md— Agent-to-Agent (A2A) protocol for delegating reasoning to the Grafana Assistant (vs direct tool calls via MCP)
External resources
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

