MCP Server para consulta de logs do Grafana via Loki API
Project description
pack-mcp-grafana
MCP Server para consulta de logs do Grafana via Loki API com autenticação por Service Account Token.
Instalação
pip install pack-mcp-grafana
Configuração
Defina as variáveis de ambiente antes de executar:
export GRAFANA_URL="https://grafana.sua-empresa.com"
export GRAFANA_SA_TOKEN="glsa_xxxxxxxxxxxx"
# Opcional: UID do datasource Loki (default: "loki")
export GRAFANA_LOKI_DATASOURCE_UID="loki"
Para gerar o token: Administration → Users and access → Service Accounts → Add token (permissão Viewer).
Uso
python -m mcp_grafana
Ou via entry point:
pack-mcp-grafana
Ferramentas MCP
| Ferramenta | Descrição |
|---|---|
grafana_query_logs |
Consulta logs de um serviço via Loki |
grafana_list_datasources |
Lista datasources disponíveis no Grafana |
grafana_analyze_logs |
Analisa logs com contagens, distribuição por nível e top erros |
Configuração no Kiro / Claude Desktop
{
"mcpServers": {
"mcp-grafana": {
"command": "pack-mcp-grafana",
"env": {
"GRAFANA_URL": "https://grafana.sua-empresa.com",
"GRAFANA_SA_TOKEN": "glsa_xxxxxxxxxxxx"
}
}
}
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pack_mcp_grafana-0.1.0.tar.gz.
File metadata
- Download URL: pack_mcp_grafana-0.1.0.tar.gz
- Upload date:
- Size: 16.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
488158416ddf00b67fa7dc217d9b41588e6a8920079eda32aa976d17f183fd5b
|
|
| MD5 |
c6b790ebe19d2ab7108054e987d4a574
|
|
| BLAKE2b-256 |
84cac4f5f92fd1e5d542fd15fc6b19c9f75730c9060542bd9b25317382613221
|
File details
Details for the file pack_mcp_grafana-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pack_mcp_grafana-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3bbdc9c2d809006d1ac74b88c0efc1b9a370c4933f234b407f1752c44391b2cb
|
|
| MD5 |
2b3b44efad5c615824190fe814f1383c
|
|
| BLAKE2b-256 |
6dbe8bf7be4002fa952c5a8b4c45d5189e8ce50e6e82cc018b86c8a1f0f1845c
|