================== /// MCP /// /// GRA /// ================== [server:online] [protocol:ready]
grafana/mcp-grafana
by grafana
Go implementation of a Model-Context-Protocol (MCP) server that exposes Grafana, Prometheus, Loki and related APIs as structured MCP tools.
1.3k
111
Open SourceInstallation
1. Prerequisites:
• Go 1.20+ installed and added to your PATH.
• Git for cloning the repository.
• (Optional) Docker if you prefer container-based deployment.
2. Clone the repository
git clone https://github.com/grafana/mcp-grafana.git
cd mcp-grafana
3. Build from source
# Compile the MCP server binary
go build -o bin/mcp-server ./cmd/server
4. Run locally
# Start the server with default settings
./bin/mcp-server --config ./conf/sample.yaml
5. Configuration
• Copy conf/sample.yaml and edit the following keys:
- server.http.listen_addr (default :8080)
- storage.path (folder for local state)
• Environment variables override any value in the YAML file. For example:
export MCP_LISTEN=:9090
export MCP_STORAGE=/var/lib/mcp
6. Docker usage (optional)
docker build -t grafana/mcp-grafana .
docker run -p 8080:8080 -v $(pwd)/conf:/etc/mcp grafana/mcp-grafana
7. Systemd example (production)
[Service]
ExecStart=/usr/local/bin/mcp-server --config /etc/mcp/server.yaml
Restart=always
8. Verify
curl http://localhost:8080/health
# Returns {"status":"ok"}
Documentation
License: Apache License 2.0
Updated 7/30/2025