# Elasticsearch extension for Gemini CLI

> Lets Gemini CLI explore, search and query your Elasticsearch data with ES|QL, through Elastic's Agent Builder MCP server.

Elastic's official extension for Gemini CLI connects the agent to your Elasticsearch data. It brings in the Elastic Agent Builder MCP server, so Gemini CLI can list your indices, read their mappings, find documents and run ES|QL queries from plain-language questions. It also adds /elastic commands that call those tools directly.

What you can do with it
- List your indices, aliases and data streams, or find the relevant ones from a description
- See an index's mapping and the fields it holds
- Search documents with full-text or structured queries, and fetch one by its ID
- Turn a question into an ES|QL query and run it, with the results as a table
- Count, aggregate and summarise data, such as the top error codes in your logs this week
- Run a tool directly with /elastic:list-indices, /elastic:explore-indices, /elastic:get-mapping, /elastic:search-dsl and /elastic:search-esql

How it connects
Install it with gemini extensions install https://github.com/elastic/gemini-cli-elasticsearch. The extension reaches Elastic Agent Builder's MCP server through mcp-remote, using two variables you set in your shell: ELASTIC_MCP_URL, copied from Kibana (Agents > View all tools > Manage MCP > Copy MCP Server URL), and ELASTIC_API_KEY, an encoded Elasticsearch API key. The MCP server needs Elastic Serverless, or Elasticsearch and Kibana 9.3 or later, with Agent Builder enabled.

Agent Skills
The extension includes a skills.js script that installs Elastic's Agent Skills for Elasticsearch, Kibana, Observability, Security and Elastic Cloud from the elastic/agent-skills repository. The skills call Elasticsearch's REST API directly, so they need ELASTIC_URL and your API key but not Kibana. Where a skill overlaps with the MCP tools, you can turn the server off with /mcp disable elastic-agent-builder.

Good to know
- The extension is experimental.
- Elastic suggests an API key with read privileges only, such as feature_agentBuilder.read.
- The tools come from Agent Builder, so tools you add or change in Kibana show up in Gemini CLI too.

- Type: Plugin
- Made by: elastic
- Category: Databases
- Formats: Extensions
- Version: 0.3.0
- Source: https://github.com/elastic/gemini-cli-elasticsearch
- Page: https://pluginboard.ai/plugins/elasticsearch-gemini-extension

## Works with

- Gemini CLI

## Install

### Gemini CLI

Run in your terminal:

```shell
gemini extensions install https://github.com/elastic/gemini-cli-elasticsearch
```

---
From Pluginboard (https://pluginboard.ai).
