mshegolev/kibana-mcp
kibana-mcp
Claude 및 모든 MCP 호환 에이전트를 통해 Kibana / Elasticsearch 로그 검색, 집계, 인덱스 탐색 및 대시보드 브라우징을 수행하는 MCP 서버입니다.
왜 다른 Kibana MCP인가?
기존 통합 방식은 브라우저 수준의 자격 증명이 있는 실행 중인 Kibana 인스턴스가 필요하며, 종종 안정적인 REST API 대신 Kibana UI를 래핑합니다. 이 서버는 다음과 같은 특징이 있습니다:
로그 쿼리를 위해 Elasticsearch REST API에 직접 연결 (더 빠르고, Kibana UI 변경에도 안정적임)
직접적인 ES URL이 구성되지 않은 경우 Kibana 콘솔 프록시로 대체 (추가 방화벽 규칙 불필요)
ApiKey 인증(에이전트에 최적), 기본 인증 및 익명 액세스 지원
모든 MCP 클라이언트와 작동하도록 구조화된 JSON(
outputSchema)과 마크다운 텍스트를 모두 반환읽기 전용 — 모든 도구는
readOnlyHint: true를 포함하며, 데이터를 수정하지 않음
Related MCP server: Elastic MCP Server
도구
도구 | API | 설명 |
|
| 상태, 문서 수, 크기를 포함한 사용 가능한 인덱스 탐색 |
|
| 시간 범위, 정렬, 크기를 포함한 전체 텍스트 로그 검색 |
|
| count/avg/sum/min/max 메트릭을 사용한 용어 그룹화 |
|
| 검색 및 페이지 매김을 포함한 저장된 대시보드 목록 |
|
| 패널 분석을 포함한 단일 대시보드 가져오기 |
설치
pip install kibana-mcp또는 uvx를 사용하여 직접 실행:
uvx kibana-mcp구성
환경 변수
변수 | 필수 | 설명 |
| 예 | Kibana 기본 URL (예: |
| 아니요 | 직접적인 ES 엔드포인트. 설정하지 않으면 ES 요청이 Kibana 콘솔 프록시를 통함 |
| 아니요 | ES API 키 ( |
| 아니요 | HTTP 기본 인증 사용자 이름 (API 키가 설정되지 않은 경우 사용) |
| 아니요 | HTTP 기본 인증 비밀번호 |
| 아니요 |
|
인증 우선순위: ApiKey > 기본 인증 > 익명.
.env.example을 .env로 복사하고 값을 입력하세요.
MCP 클라이언트 구성 (Claude Desktop / claude.app)
{
"mcpServers": {
"kibana": {
"command": "uvx",
"args": ["kibana-mcp"],
"env": {
"KIBANA_URL": "https://kibana.example.com",
"KIBANA_API_KEY": "your-api-key-here"
}
}
}
}또는 더 나은 성능을 위해 직접 ES 액세스 사용:
{
"mcpServers": {
"kibana": {
"command": "uvx",
"args": ["kibana-mcp"],
"env": {
"KIBANA_URL": "https://kibana.example.com",
"ELASTICSEARCH_URL": "https://es.example.com:9200",
"KIBANA_API_KEY": "your-api-key-here"
}
}
}
}Docker
docker run --rm -i \
-e KIBANA_URL=https://kibana.example.com \
-e KIBANA_API_KEY=your-key \
ghcr.io/mshegolev/kibana-mcp사용 예시
로그 검색
Find the last 50 ERROR logs from the API service in the last hour→ kibana_search_logs(index="logs-*", query="level:ERROR AND service:api", size=50, time_from="2026-04-18T09:00:00Z")
Show 500 HTTP errors sorted oldest first for incident replay→ kibana_search_logs(index="nginx-*", query="status:500", sort_order="asc", size=100)
집계
How many logs per log level in the last hour?→ kibana_aggregate_logs(index="logs-*", group_by="level", time_from="2026-04-18T09:00:00Z")
What is the average response time per service?→ kibana_aggregate_logs(index="logs-*", group_by="service.keyword", metric="avg", metric_field="response_time_ms")
인덱스 탐색
What log indices are available?→ kibana_list_indices()
Show me all filebeat indices→ kibana_list_indices(pattern="filebeat-*")
대시보드
Find the infrastructure dashboard→ kibana_list_dashboards(search="infrastructure")
What panels does dashboard X have?→ kibana_get_dashboard(dashboard_id="<id from list_dashboards>")
성능 특성
로그 검색 (
kibana_search_logs): 직접 ES URL 사용 시 일반적으로 50-500ms; Kibana 콘솔 프록시를 통할 경우 100-200ms 추가집계 (
kibana_aggregate_logs):size:0쿼리 — 히트가 전송되지 않으며, 일반적으로 10-100ms인덱스 목록: 단일
_cat/indices호출, O(index_count) 응답, 일반적으로 100ms 미만대시보드 API: Kibana 저장 객체 API, 일반적으로 50-200ms; 지연 시간은 네트워크가 아닌 Kibana 측에서 발생
에이전트가 빈번하게 로그를 검색하는 경우
ELASTICSEARCH_URL을 직접 설정하세요 — 프록시 오버헤드가 제거됩니다.
개발
git clone https://github.com/mshegolev/kibana-mcp
cd kibana-mcp
pip install -e '.[dev]'
pytest tests/ -v
ruff check src tests
ruff format src tests라이선스
MIT — LICENSE를 참조하세요.
Available Tools
5 toolskibana_aggregate_logsARead-onlyIdempotent
Aggregate logs using a terms grouping and optional metric.
Wraps POST {ES_URL}/{index}/_search with size:0 (no hits returned)
and a terms aggregation on group_by. This is the efficient way to
get counts, averages, or sums grouped by a field value.
When more than 20 buckets are rendered in the text output, a truncation
hint is appended — use the structured buckets field for the full list.
Examples:
- Use when: "How many logs per log level in the last hour?"
→ index='logs-*', group_by='level',
time_from='2026-04-18T09:00:00Z'.
- Use when: "What is the average response time per service?"
→ group_by='service.keyword', metric='avg',
metric_field='response_time_ms'.
- Use when: "Top 10 HTTP status codes today."
→ group_by='http.response.status_code', size=10.
- Don't use when: You need raw log content/messages — use
kibana_search_logs which returns full _source objects.
- Don't use when: You need time-series (histogram per interval) —
that requires a date_histogram aggregation not supported here.
Returns:
dict with total_documents / took_ms / buckets (list).
Inputs: index (required), group_by (required), query, metric, +5 more. Returns: total_documents, took_ms, index, group_by, +4 more
kibana_get_dashboardARead-onlyIdempotent
Fetch a single Kibana dashboard with panel details.
Calls GET {KIBANA_URL}/api/saved_objects/dashboard/{id}.
Returns the dashboard metadata and a summary of contained panels
(visualisations, controls, maps, etc.).
Examples:
- Use when: "What panels does the 'Infrastructure Overview' dashboard have?"
→ obtain the ID from kibana_list_dashboards, then call with
dashboard_id=<id>.
- Use when: "Give me the description and panel count of dashboard X."
→ single call, no search needed if you have the ID.
- Use when: Verifying that a dashboard ID from a URL or bookmark is valid.
- Don't use when: You don't have the dashboard ID — call
kibana_list_dashboards first with a search term.
- Don't use when: You need log data shown in the dashboard —
dashboards contain visualisation config only. Use
kibana_search_logs / kibana_aggregate_logs for actual data.
Returns:
dict with id / title / description / panels_count /
panels (list) / updated_at.
Inputs: dashboard_id (required). Returns: id, title, description, panels_count, +2 more
kibana_list_dashboardsARead-onlyIdempotent
List Kibana saved dashboards.
Calls GET {KIBANA_URL}/api/saved_objects/_find?type=dashboard.
The kbn-xsrf: true header is always sent to satisfy Kibana's CSRF
guard. Use this to discover dashboard IDs before calling
kibana_get_dashboard.
Pagination: if has_more is True, call again with page + 1.
Examples:
- Use when: "What Kibana dashboards are available?"
→ default params.
- Use when: "Find the infrastructure dashboard."
→ search='infrastructure'.
- Use when: "List all dashboards — page 2."
→ page=2.
- Don't use when: You already have a dashboard ID — use
kibana_get_dashboard directly (one fewer round trip).
- Don't use when: You need log content — dashboards contain
visualisation config, not raw log data. Use kibana_search_logs.
Returns:
dict with total / page / page_size / has_more /
dashboards (list of {id, title, description, updated_at}).
Inputs: search, page, page_size. Returns: total, page, page_size, has_more, +2 more
kibana_list_indicesARead-onlyIdempotent
List available Elasticsearch indices.
Calls GET {ES_URL}/_cat/indices?format=json and returns a structured
list of indices with health, status, document count, and storage size.
Use this first to discover which index names / patterns exist before
calling kibana_search_logs or kibana_aggregate_logs.
Examples:
- Use when: "What log indices are available in Elasticsearch?"
→ default params, pattern='*'.
- Use when: The user mentions a service name but not the index.
Try pattern='logs-myservice-*' to narrow down.
- Use when: "How many documents in the access-log index?"
→ pattern='access-log*', check docs_count.
- Don't use when: You already know the index name — pass it directly
to kibana_search_logs (saves one round trip).
- Don't use when: You need to search log content — that's
kibana_search_logs.
Returns:
dict with keys indices_count / pattern / include_system /
indices (list of {index, health, status, docs_count, store_size_bytes, size_human}).
Inputs: pattern, include_system. Returns: indices_count, pattern, include_system, indices
kibana_search_logsARead-onlyIdempotent
Search logs using Elasticsearch Query String Syntax.
Wraps POST {ES_URL}/{index}/_search with a bool/must query.
Returns the top matching log entries with their _source fields.
When more than 20 hits are rendered in the text output, a truncation
hint is appended — use the structured hits field for the full list.
Examples:
- Use when: "Show me the last 20 ERROR logs from the API service."
→ index='logs-*', query='level:ERROR AND service:api'.
- Use when: "Find 'connection refused' errors in the last hour."
→ query='message:"connection refused"',
time_from='2026-04-18T09:00:00Z', time_to='2026-04-18T10:00:00Z'.
- Use when: "Show me 500 errors sorted oldest first for replay."
→ query='status:500', sort_order='asc'.
- Don't use when: You want counts / statistics per field value —
use kibana_aggregate_logs instead (size:0 aggregation is
much cheaper than retrieving full log documents).
- Don't use when: You need more than 500 docs — ES caps size at
500 via this tool; use scroll API directly for bulk export.
Returns:
dict with total / returned / took_ms / hits (list).
Inputs: index (required), query (required), time_field, time_from, +3 more. Returns: total, returned, took_ms, index, +5 more
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool has a distinct purpose: log aggregation, dashboard retrieval, dashboard listing, index listing, and log search. Descriptions explicitly clarify when not to use each tool, leaving no ambiguity.
All tools follow a consistent 'kibana_verb_noun' pattern (e.g., aggregate_logs, get_dashboard). The naming is uniform and predictable across the entire set.
Five tools is well-suited for the domain of Kibana log analysis and dashboard exploration. Each tool earns its place without being excessive or insufficient.
The tool set covers the primary read operations: index discovery, log search, log aggregation, dashboard list, and dashboard details. Missing write/update capabilities, but for a focused read-only MCP, this is reasonable and does not leave critical gaps.
Maintenance
Related MCP Connectors
Search APIs, MCP servers and agents; score a website's agent-readiness. Read-only, no auth.
Free, no-key MCP server: token estimates, JSON Schema conversion, MCP configs, tool search.
One OAuth connector for your team's remote MCP servers, with Tool Packs, guardrails and logs.
Governed MCP gateway: one endpoint for your tools, with credential custody and audit log.
Related MCP Servers
- AlicenseBqualityDmaintenanceAn MCP server that enables interaction with Elasticsearch and OpenSearch clusters for searching documents and managing indices. It provides tools for cluster health monitoring, index configuration, and general API requests.16Apache 2.0
- AlicenseAqualityDmaintenanceA read-only MCP server that gives AI assistants natural language access to Elasticsearch/Kibana logs for querying and analysis.71MIT
- AlicenseAqualityDmaintenanceRead-only MCP server for exploring and searching OpenSearch clusters, enabling log analysis, index exploration, and query execution.8MIT
- AlicenseBqualityDmaintenanceSmall production-oriented MCP server for diagnosing incidents from Elasticsearch logs with unknown schema. It provides tools for log discovery, retrieval, and issue diagnosis.6MIT