Skip to main content
Glama
kibana-console-mcp

kibana-console-mcp

by fff-fm-404

kibana-console-mcp

An MCP server and CLI for searching logs in a Kibana 8.17 deployment, going through the Dev Tools console proxy (POST /api/console/proxy) so it needs only the Kibana host and Kibana credentials.

Built for a viewer-level role with no Elasticsearch cluster privileges, on a cluster of 63 data streams and ~35 billion log documents.

Option

Works on Kibana 8.17?

Kibana Agent Builder MCP (/api/agent_builder/mcp)

❌

Added in Kibana 9.2.0

elastic/mcp-server-elasticsearch

✅

Needs a reachable Elasticsearch endpoint; deprecated upstream

this server

✅

Only needs Kibana

Quick start

npm install
cp .env.example .env    # fill in KIBANA_URL, KIBANA_SPACE, a credential
npm run smoke           # checks the live cluster, step by step

Then wire it into Claude Code — no env block needed, the server reads .env:

claude mcp add kibana -- node /path/to/kibana-console-mcp/src/index.js

Full instructions, including how to get a credential when the signed-in user cannot create an API key: docs/SETUP.md.

Related MCP server: Kibana MCP Server

Ask it something

Four tools answer most questions in a single request.

es_overview { "window": "1h" }                            what is going on
es_patterns { "window": "1h", "filter": "EXCEPTION" }     what is in these logs
es_why      { "window": "30m", "baseline": "24h" }        why did it spike
es_find     { "text": "connection refused" }              where is this happening
  38700  action EXCEPTION actionDescription esb.pty.customerBillUpdated additionalInfo postpaidEarn …
  15700  appName nlp-openapi-bff appResult Http Exception appResultCode appResultHttpStatus …
    800  action EXCEPTION actionDescription SharedRedemptionService.getCampaignByFilters LogTime failed

The same thing from a shell:

node scripts/kq.js overview 1h
node scripts/kq.js patterns 1h EXCEPTION
node scripts/kq.js why 30m 24h
node scripts/kq.js find "connection refused" 1h

More, with real output: docs/PLAYBOOK.md.

Tools

Tool

Purpose

es_overview

Start here. Volume, errors, unusual containers, sample lines — one _msearch

es_find

Phrase → count, namespaces, containers, time shape, samples

es_patterns

Millions of lines → a dozen message templates with counts

es_why

What is statistically unusual in a window versus a baseline

es_trace

Timeline for one correlation id across services

es_search

Query DSL search with size/from/sort/source/aggs

es_count

Count matching documents

es_esql

ES|QL query, allowlist-checked, returned as rows or a matrix

es_get_mappings

Field mappings, falling back to _field_caps

es_list_indices

Index discovery: _cat/indices, falling back to _resolve/index

kbn_list_data_views

Index discovery through Kibana, needs no cluster privilege

kbn_find_saved_objects

Dashboards, visualizations, index patterns, lens objects

kbn_status

Connectivity, Kibana version, active guardrails

es_request

Escape hatch for any other Elasticsearch path

Safety

Read-only by default, with a glob allowlist enforced on every tool — including es_esql and es_request, where the target hides inside a query string — and MSISDN/secret masking on results and errors.

These logs contain customer PII. Anything a tool returns enters the model's context permanently. docs/SECURITY.md covers what is in them and what cookie authentication costs.

Speed

Measured against the live cluster. The intuitive answers were mostly wrong: window width dominates (24h costs 13× 1h), fan-out barely matters (63 streams cost 1.6× one), filter context makes no difference, and LIKE "*x*" times out at 30 seconds. docs/PERFORMANCE.md has the numbers and what the server does about them.

Development

npm run check    # lint + the test suite + stdio selftest. No credentials, no network.
npm run smoke    # the only command that touches the live cluster.

CLAUDE.md

Conventions and non-negotiables for agents working here (AGENTS.md is a symlink to it)

docs/ARCHITECTURE.md

How it works, and the proxy quirks it absorbs

docs/CLUSTER.md

This deployment: version, role, data shape, feature availability

docs/TROUBLESHOOTING.md

Error → cause → fix

docs/TOOLS.md

Every tool and parameter, generated from the server

CHANGELOG.md

What changed, including every audit finding

TODO.md

Work that is deliberately unfinished, and why

Available Tools

14 tools
es_countCount documentsA

Count documents matching a query. Cheaper than a search when only the total matters.

Inputs: index (required), query.

es_esqlRun ES|QL queryA

Run an ES|QL query and return a columns/values table. Usually the fastest way to aggregate, e.g. FROM logs-* | WHERE status >= 500 | STATS n = COUNT(*) BY host. For text matching use MATCH(field, "phrase") or QSTR("field: phrase") — a leading-wildcard LIKE/RLIKE cannot use the index and is rejected.

Inputs: query (required), filter.

es_findFind log lines and where they come fromA

One-shot log search: given a phrase, returns the match count, which namespaces and containers produce it, how it is distributed over time, and a sample of lines — in a single Elasticsearch request. Prefer this as the FIRST call for "where/when/how often is X happening", instead of a discovery call followed by a search: it answers all three questions at once and costs one round trip.

Inputs: text (required), size, index, window.

es_get_mappingsGet index mappingsA

Return the field mappings for an index or index pattern. Read this before writing a query so field names and types are correct. Falls back to _field_caps when the credential may not read _mapping directly.

Inputs: index (required).

es_list_indicesList indicesA

List Elasticsearch indices matching a pattern. Uses _cat/indices when the credential has the "monitor" cluster privilege, and falls back to _resolve/index (index-level privileges only) when it does not. Start here when you do not know which index holds the data; if both routes are forbidden, use kbn_list_data_views.

Inputs: pattern.

es_overviewFirst look at a windowA

Everything needed to start an investigation, in one request: log volume and its shape over time, error count and rate, which namespaces and containers the errors come from, which containers are statistically unusual versus a baseline, and a few sample error lines. Call this FIRST for "what is going on", "is anything wrong", or the start of an incident; then narrow with es_patterns, es_why or es_trace.

Inputs: size, index, window, baseline, +1 more.

es_patternsSummarise logs into message patternsA

Collapse a window of raw log lines into the handful of message templates behind them, with a count for each. Use this to answer "what is in these logs" or "what changed" without reading individual lines — it turns millions of documents into a short list. Runs over a random sample, so counts are approximate.

Inputs: size, index, filter, window, +1 more.

es_requestRaw Elasticsearch requestA

Escape hatch for Elasticsearch APIs the other tools do not cover, e.g. "_cluster/health", "_cat/aliases?format=json", "_resolve/index/logs-*". In read-only mode only GET/HEAD and search-shaped POST paths are permitted.

Inputs: path (required), body, method.

es_traceTrace a correlation idA

Follow one correlation id — sessionId, transactionId, x-request-id, MSISDN — across every service that logged it, returned as a compact timeline. Prefer this over es_search for "what happened to this request": it parses each JSON log line down to time/pod/level/action/detail instead of returning whole documents.

Inputs: id (required), size, index, window.

es_whyExplain a change in log volumeA

Compare a window against a wider baseline and report which namespaces, containers and pods are statistically over-represented in it. Use this for "why did logs spike", "what changed at 14:00", or to narrow an incident to a service before reading any lines. Ranked by p-value, so ordinary background noise is filtered out.

Inputs: size, index, filter, window, +1 more.

kbn_find_saved_objectsFind Kibana saved objectsA

Search Kibana saved objects in the active space — dashboards, visualizations, index patterns, saved searches, lens objects.

Inputs: page, type, search, perPage.

kbn_list_data_viewsList Kibana data viewsA

List the Kibana data views (index patterns) available in the active space. This works with Kibana-level privileges only, so it is the reliable way to discover which indices are queryable when Elasticsearch cluster APIs are forbidden.

Inputs: no named parameters.

kbn_statusKibana statusA

Check connectivity and report the Kibana version, the active space, and the current read-only / index-allowlist settings of this MCP server.

Inputs: no named parameters.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.2/5.0

    Scored across 14 tools

    Disambiguation5/5

    Each tool targets a clearly distinct operation: querying (es_search, es_count, es_esql), discovery (es_list_indices, es_get_mappings, kbn_list_data_views), investigation (es_trace, es_find, es_patterns, es_why, es_overview), and administrative access (kbn_status, kbn_find_saved_objects, es_request). Overlapping-looking tools like es_find vs es_search are explicitly differentiated by purpose and guidance in their descriptions.

    Naming Consistency4/5

    The set follows a mostly consistent convention: es_ for Elasticsearch operations and kbn_ for Kibana operations, with verb_noun pairs like es_get_mappings, es_list_indices, kbn_find_saved_objects. A few tools use noun/adverb style names (es_patterns, es_why, es_overview), which breaks the verb-led pattern but remains predictable and readable.

    Tool Count5/5

    14 tools is well-scoped for a Kibana/Elasticsearch investigation console. Each tool covers a distinct capability — from low-level search, to aggregations, to incident-analysis helpers, to saved-object access — without feeling bloated or redundant.

    Completeness5/5

    The tool surface is comprehensive for its read-only investigation purpose: it covers index discovery, field mappings, query execution (DSL, count, ES|QL), log pattern analysis, trace following, statistical comparisons, overview generation, saved object lookup, and a general escape hatch for unlisted Elasticsearch APIs. No obvious dead ends remain.

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Provides seamless access to Kibana and Periscope logs through a unified API with KQL and SQL querying, AI-powered log analysis, and support for searching across 1.3+ billion logs in 9 indexes.
      1
      -
    • A
      license
      B
      quality
      D
      maintenance
      Enables AI assistants to interact with Kibana dashboards, visualizations, and Elasticsearch data through read-only resources and executable tools for searching logs, exporting dashboards, and querying data.
      7
      4
      MIT
    • F
      license
      Not graded
      quality
      C
      maintenance
      Enables querying and searching logs from Kibana (ELK stack) via MCP, with support for project-based data views, trace ID correlation, and log expansion.
      -