Assistant mcp

From grafana/skills · View interactive version

Assistant mcp is an AI agent skill from the GitHub repository grafana/skills. 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` + `

How to use this skill

Skill file

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.
  1. Get a service-account token: Grafana Cloud → Administration → Service Accounts → create with Viewer role (add Editor only if you need writes) → generate token. Note the Grafana URL (e.g. https://myorg.grafana.net).
  1. Wire ~/.claude/settings.json (or project-local .claude/settings.json):

```json

{

"mcpServers": {

"grafana": {

"command": "mcp-grafana",

"args": ["--disable-write"],

"env": {

"GRAFANA_URL": "https://myorg.grafana.net",

"GRAFANA_API_KEY": "glsa_xxxx"

}

}

}

}

```

--disable-write is the safer default — drop it once you've verified the read path works.

  1. Restart Claude Code, then verify:

```

/mcp

```

The grafana server 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:

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

References

External resources

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.