Skip to main content
Glama
Kibana Bridge MCP

Kibana Bridge MCP

by yunusemregul

Kibana Bridge MCP

npm CI node license

English | Türkçe

Let your AI assistant search Kibana / OpenSearch Dashboards logs through your logged-in browser tab. No API keys, no service accounts.

The dashboard during an AI search: a green pill in the header reads AI summarized "timeout" · 65 hits, and its popover shows the query, time range, index pattern, a hit histogram and the previous AI searches

Log platforms behind corporate SSO rarely hand out API tokens. Your browser session is the one credential you always have, so a small extension runs the searches inside your dashboard tab and an MCP server hands the results to Claude Code, Cursor, Codex or any other MCP client.

Architecture: the MCP client (Claude Code, Cursor, Codex, …) connects over Streamable HTTP / SSE on localhost:47822 to the MCP server, which connects over a WebSocket on localhost:47821 to the browser extension in your logged-in dashboard tab. All three run on your machine. The extension then sends authenticated requests to /internal/search/… on Kibana / OpenSearch, using your existing login.

Works with Kibana and OpenSearch Dashboards (including SAP BTP Cloud Logging).

Setup

Takes about two minutes. Using an AI agent with a terminal? Let it do the setup.

1. Add it to your AI client

claude mcp add --scope user kibana-logs -- npx -y kibana-bridge-mcp@latest

--scope user makes it available in all your projects (leave it out to add it to the current project only). Your client starts the server by itself whenever it needs it, and @latest keeps it up to date.

JSON config (Claude Desktop, Cursor and most other clients):

{
  "mcpServers": {
    "kibana-logs": {
      "command": "npx",
      "args": ["-y", "kibana-bridge-mcp@latest"]
    }
  }
}

Config files: Claude Desktop ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows). Cursor ~/.cursor/mcp.json.

codex mcp add kibana-logs -- npx -y kibana-bridge-mcp@latest
gemini mcp add kibana-logs npx kibana-bridge-mcp@latest
code --add-mcp '{"name":"kibana-logs","command":"npx","args":["-y","kibana-bridge-mcp@latest"]}'

Windows: many clients can't find npx on their own, so run it through cmd /c. For example claude mcp add --scope user kibana-logs -- cmd /c npx -y kibana-bridge-mcp@latest, or "command": "cmd", "args": ["/c", "npx", "-y", "kibana-bridge-mcp@latest"] in JSON.

Standalone server: run npx -y kibana-bridge-mcp@latest in a terminal and connect clients to http://localhost:47822/mcp (or /sse for older clients).

2. Install the browser extension

npx -y kibana-bridge-mcp@latest install-extension

This copies the extension folder path to your clipboard and opens your browser's extensions page. There, turn on Developer mode, click Load unpacked and paste the path.

Works in Chrome, Edge, Brave, Arc, Vivaldi and Opera. Install it in the browser you use for your dashboard.

Turn on Developer mode Click Load unpacked Kibana Log Bridge installed

In Edge, Developer mode is in the left sidebar. In the folder picker, press ⌘⇧G on macOS or use the address bar on Windows to paste the path. Add --browser brave (or chrome, edge, …) to the command to pick a browser other than your default, or --lang tr|en to set the output language.

3. Add your dashboard

Open your Kibana / OpenSearch Dashboards site, log in, click the extension icon and press ➕ Add this dashboard. The name and index pattern are detected for you. Repeat for other environments (stage, prod, …).

A small pill then appears in the dashboard header showing whether the AI is connected, and what it's searching for while it works.

4. Try it

Summarize the errors in our logs over the last 24 hours, then dig into the most common one.

Updating

The server updates by itself. When the extension is out of date, the AI tells you: re-run the install-extension command, then click reload ↻ on Kibana Log Bridge in the extensions page.

Related MCP server: es-mcp

Let your AI do the setup

Paste this into Claude Code, Codex, Cursor or any agent with a terminal:

Set up kibana-bridge-mcp for me by following https://github.com/yunusemregul/kibana-mcp#for-ai-agents

For AI agents

You can run steps 1 and 2. The browser steps need the user, because browsers don't let scripts enable Developer mode, load extensions or grant site access.

  1. Check node --version is 18 or newer, then register the server with the client you're running in (commands; use the cmd /c form on Windows).

  2. Run npx -y kibana-bridge-mcp@latest install-extension. It prints the folder path (--no-open skips opening the browser, --browser <name> picks one).

  3. Ask the user to turn on Developer mode, click Load unpacked and paste that path. Wait for them to confirm.

  4. Ask the user to open their dashboard, log in, click the Kibana Log Bridge icon (in the puzzle-piece menu if not pinned) and press ➕ Add this dashboard.

  5. Ask the user to restart the client or reconnect MCP servers (/mcp in Claude Code) so the tools load.

  6. Verify with curl -s http://localhost:47822/health. You want "connected":true and at least one name in "environments". No answer means the client hasn't started the server yet. Finish with a broad summarize_logs call.

Tools

Tool

What it does

summarize_logs

Cheap overview: hit count, time histogram, top values per field. Start here.

available_log_fields

Lists every field in matching docs, with types. Learns the schema.

search_logs

Full search with include/exclude filters and custom display fields.

get_log_context

Everything around a timestamp, optionally limited to one trace.

inspect_log

One log entry in full, as YAML.

The tools teach the AI to investigate like an engineer (summarize wide, find the noise, exclude it, narrow down), and results are compacted to keep token usage low.

  • environment: which configured dashboard to search. Defaults to the first one.

  • level: filter by log level, e.g. 'ERROR' or ['ERROR','WARN'].

  • query_dsl: a raw OpenSearch / Elasticsearch query clause for anything plain text can't express, e.g. {range: {status: {gte: 500}}}.

  • match: "wildcard" on an include/exclude filter for * and ? patterns.

  • trace_id on get_log_context to follow one trace.

  • full: true on inspect_log to skip trimming of long stack traces and annotations.

Troubleshooting

Problem

Fix

"No active browser extension connected"

Check the extension is loaded and enabled, and that your AI client is running.

"Redirected to a login page" / HTTP 401 or 403

Your dashboard session expired. Log in again in that tab and retry.

"No environments configured"

Open your dashboard and press ➕ Add this dashboard in the extension.

"Port 47821 (or 47822) is in use"

Another program has the port. Free it or set WS_PORT / MCP_PORT (see below).

Results show empty messages

Your logs use a different text field. Ask the AI to run available_log_fields.

Configuration

You don't need this for normal use. It's for tuning the server to an unusual log schema or changing ports.

Set these in the env block of your MCP client config.

Variable

Default

Purpose

MCP_PORT

47822

HTTP port for MCP clients

WS_PORT

47821

WebSocket port for the extension (also change it in the extension settings)

HOST

127.0.0.1

Bind address

DISPLAY_FIELDS

message,logs.message,msg,log,logs.request,logs.requestFirstLine

Fields used as each hit's message text, in order

SUMMARY_FIELDS

logs.level,logs.loggerName,logs.thrown.name,kubernetes.pod_name

Default fields summarize_logs counts

QUERY_FIELDS

message,logs.message,msg,log,logs.loggerName,logs.thread,logs.thrown.name,logs.thrown.message,logs.request,logs.requestFirstLine

Fields searched by query. Empty means the index defaults

LEVEL_FIELD

logs.level

Field level filters on

TRACE_ID_FIELD

logs.contextMap.traceId

Field trace_id filters on

FIELDS_STRATIFY_FIELD

kubernetes.container_name

available_log_fields samples across this field's values

SOURCE_TAG_FIELDS

kubernetes.labels.ccv2_cx_sap_com_platform-aspect,kubernetes.container_name

Source tag shown before each hit

Freeing a port: lsof -ti:47821 | xargs kill on macOS / Linux, or netstat -ano | findstr :47821 then taskkill /PID <pid> /F on Windows.

Security

  • Everything runs on your machine. Searches go only to your own dashboard, using your existing session and permissions.

  • The extension only accesses dashboards you add, and only reads.

  • The local server rejects connections from web pages. Its MCP port has no authentication, so don't expose port 47822 to other machines.

License

MIT

Available Tools

5 tools
available_log_fieldsA

Returns every populated field path (dotted) found in a sample of matching log docs, annotated with each field's type and aggregatability from the dashboard's field-caps API when available. Call this ONCE at the start of a fresh investigation to learn the schema: what aggregate_fields and display_fields paths are valid in this data. The tool samples hits stratified across kubernetes.container_name values (FIELDS_STRATIFY_FIELD env) so rare container types still contribute their fields, walks each doc's _source, and returns a deduplicated list grouped to keep kubernetes.annotations.* collapsed.

Use the result to decide which fields to summarize, exclude, include, or display. Subsequent investigation turns rarely need to re-call this because the schema is stable across queries.

Tip: pair it on the very first turn with a summarize_logs call (in parallel) so you get distributions and schema in one shot.

Inputs: query (required), level, time_to, query_dsl, +6 more.

get_log_contextA

Returns the log entries within a time window around a specific timestamp. Use this when you've found a suspicious entry (an error, a state change, etc.) and need to see what happened immediately before and after (the human equivalent of clicking 'view surrounding documents' in Kibana/Discover).

Default window is ±60 seconds (so 120s total). Narrow it with window_seconds for noisy services, widen for sparse logs.

Use trace_id (filters on logs.contextMap.traceId, TRACE_ID_FIELD env) or include_filters to scope to the same trace, pod, or service. Otherwise you'll see ALL traffic in the window, which is often too much.

Pass query only if you also want to constrain by a search term in the window; usually leave it empty.

Inputs: timestamp (required), size, level, query, +8 more.

inspect_logA

Returns the _source of one log entry as YAML. Use this when search shows a tantalizing single message and you need the full metadata: traceId, kubernetes labels, exception stack, request body, etc.

By default the output is trimmed to stay readable: the raw log string is dropped when its parsed logs.* object is present, every extendedStackTrace keeps its first 5 frames, kubernetes.annotations is collapsed to a count, and strings over 4000 chars are cut. Pass full: true to get the untouched _source.

Identifies the doc by timestamp (ISO with millisecond precision is usually unique). If multiple docs share the timestamp, pass include_filters (e.g. pod_name) to disambiguate. Only the first match is returned.

Inputs: timestamp (required), full, environment, include_filters.

search_logsA

Searches logs in Kibana / OpenSearch Dashboards via the active browser tab and returns hits.

Workflow: investigate the same way a human does in Discover:

  1. Start with summarize_logs over a wide window (e.g. 7 days) to see total hit count, time histogram, and the top values for noisy dimensions (logger, component, pod, level).

  2. Identify noise dimensions: loggers that dominate the result set with irrelevant chatter, pod tiers that don't match the service you're investigating (e.g. frontend when chasing a backend bug), etc.

  3. Call search_logs with exclude_filters listing those noisy {field, value} pairs to narrow the result set.

  4. Iterate: if the remaining hits render empty messages, the docs likely keep their text under a different field. Call available_log_fields and pass a matching display_fields fallback chain.

  5. Add more excludes or change display_fields until results are signal, not noise. Pin a specific row with timestamp_match.

Boolean AND in query: 'term1 AND term2' requires both terms.

IMPORTANT: This tool relies on a Chrome extension bridge. Do NOT attempt to open browser tabs, navigate to URLs, or use any browser automation tools if this fails. If it errors, just report the error to the user.

Inputs: query (required), size, level, time_to, +10 more.

summarize_logsA

Returns a cheap summary of a log query: total hits, time histogram, and top-N values for chosen dimensions. Use this BEFORE search_logs to see the shape of the data and decide which exclude_filters to apply. No hits are returned (size=0), so this is very cheap on tokens even over 7-day windows.

Typical first call for an investigation: summarize_logs(query, minutes_lookback: 10080). It gives you total hits per day and the noisy dimensions to exclude in the follow-up search.

Inputs: query (required), level, top_n, time_to, +8 more.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4.5/5.0

    Scored across 5 tools

    Disambiguation5/5

    Each tool targets a distinct stage of log investigation: summarize_logs returns summary statistics only, search_logs returns matching hits, get_log_context returns surrounding entries, inspect_log returns full metadata for one entry, and available_log_fields returns schema information. There is little to no functional overlap.

    Naming Consistency4/5

    Most names follow a snake_case verb_noun pattern (search_logs, get_log_context, inspect_log, summarize_logs), but available_log_fields starts with an adjective/noun rather than a verb, which is a minor inconsistency.

    Tool Count5/5

    Five tools cleanly cover schema discovery, high-level summary, targeted search, contextual viewing, and single-document inspection without redundancy. This is a well-scoped set for the server's purpose.

    Completeness5/5

    For a read-only log investigation bridge, the tools cover the full Discover-style workflow: learn fields, summarize data shape, search with filters, inspect surrounding context, and drill into a single entry. No obvious missing read operations for the domain.

    Related MCP Connectors

    Related MCP Servers

    • 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
    • -
      license
      Not graded
      quality
      Not graded
      maintenance
      Enables querying Elasticsearch logs from AI assistants using natural language, with optional SSH tunnel support.
      -
    • A
      license
      A
      quality
      A
      maintenance
      Enables AI agents to search and analyze SAP Commerce Cloud (CCv2) runtime logs via OpenSearch Dashboards using a session cookie, providing read-only tools for full-text search and error aggregation.
      3
      MIT