otherapi_key

Elasticsearch

Elasticsearch is a distributed, RESTful search and analytics engine capable of addressing a growing number of use cases. It provides real-time search and analytics for all types of data.

Verdict

The Elasticsearch MCP connects your team's AI to your search cluster. @mention it in any Space to list indices, inspect field mappings, or run filtered queries without leaving the conversation. Data analysts pull sample records to validate assumptions, engineers debug production logs in real time, and support teams surface error patterns across time ranges. You'll need an API key with read permissions on the indices you want to query. The MCP returns raw JSON, so follow-up prompts often reshape results into tables or summaries.

Common use cases

  • Debug production errors from chat logs
  • Pull sample records for data validation
  • Inspect index mappings before schema changes
  • Surface error patterns across time ranges
  • Audit recent user activity in real time

Integration

Vendor
Elasticsearch
Category
other
Auth
API_KEY
Tools
3
Composio slug
elasticsearch

Tools

  • Get Index Schema

    Tool to get the complete schema/mapping of a specific elasticsearch index. use when you need to understand the structure, field types, and mappings of an index.

  • List Indices

    Tool to list all available elasticsearch indices. use when you need to get a list of indices in your elasticsearch cluster, optionally filtering by pattern, health status, or other criteria.

  • Query Index

    Tool to query an elasticsearch index with various filters, time ranges, and pagination support. use when you need to search for documents in an index with complex filtering criteria.

Setup

Setup guide

  1. 11. In Switchy, open Settings and navigate to Integrations. 2. Find Elasticsearch in the MCP directory and click Connect. 3. Paste an API key from your Elasticsearch deployment—generate one in Kibana under Stack Management > API Keys, granting at least 'read' privileges on target indices. 4. Click Save to complete the connection. 5. Open any Space and type '@Elasticsearch list all indices' to confirm the integration works. 6. If the response shows your indices, you're ready—try '@Elasticsearch get schema for logs-2024' to inspect a mapping, or '@Elasticsearch query user-events where status equals error' to run a filtered search. 7. Adjust your API key's index permissions in Kibana if certain indices don't appear.

What teammates see: by default, memories from Elasticsearch are scoped to the Space (PROJECT visibility) - you can mark any memory PRIVATE or share it ORG-wide.

Works well with

Top models

Compatibility data appears once enough Spaces have used this MCP together with a given model.

How Switchy teams use it

Not enough Spaces yet to publish anonymised usage stats (we require ≥ 50 Spaces per week).

Starter prompts

List All Indices

@Elasticsearch list all indices in the cluster, showing their health status and document counts.
Open in a Space →

Inspect Index Schema

@Elasticsearch get the complete schema for the 'application-logs' index, including all field types and nested mappings.
Open in a Space →

Query Recent Errors

@Elasticsearch query the 'logs-prod' index for documents where level equals 'error' in the last 60 minutes, return the first 20 results.
Open in a Space →

Find User Activity

@Elasticsearch query the 'user-events' index for all documents where user_id equals '12345' in the past 7 days.
Open in a Space →

Sample Dataset Preview

@Elasticsearch query the 'sales-records' index and return 10 sample documents with all fields included.
Open in a Space →

Example outputs

Illustrative - representative of the model's voice and quality, not literal recordings.

Prompt

@elasticsearch list all indices in the cluster that start with 'logs-' and show their health status

Output

Found 12 indices matching pattern 'logs-*'. Health breakdown: 9 green (logs-app-2024-01, logs-app-2024-02, logs-nginx-2024-01, logs-nginx-2024-02, logs-api-2024-01, logs-api-2024-02, logs-worker-2024-01, logs-worker-2024-02, logs-auth-2024-01), 2 yellow (logs-app-2024-03, logs-nginx-2024-03), 1 red (logs-api-2024-03). Yellow indices have unassigned replica shards. Red index logs-api-2024-03 has unassigned primary shards and requires immediate attention.

Notes

This example shows the MCP's ability to filter indices by pattern and surface cluster health at a glance. Requires API key with monitor_cluster privilege. Health status reflects cluster state at query time — yellow/red indices may indicate configuration issues or node failures that need investigation.

Prompt

@elasticsearch get the schema for the 'user-events-2024' index and explain what fields are available for filtering

Output

The user-events-2024 index has 18 mapped fields. Key filterable fields: 'user_id' (keyword), 'event_type' (keyword), 'timestamp' (date), 'session_id' (keyword), 'device_type' (keyword), 'geo.country' (keyword), 'geo.city' (text with keyword subfield). Numeric fields: 'duration_ms' (long), 'response_code' (integer). The 'metadata' field is a nested object with dynamic mapping. Text fields 'user_agent' and 'referrer' are analyzed for full-text search but also have .keyword subfields for exact matching and aggregations.

Notes

This example demonstrates schema introspection — essential before writing queries. Understanding field types (keyword vs text, nested objects) determines which query syntax works. Requires read privilege on the target index. Schema complexity grows with dynamic mappings; this output simplifies the actual mapping structure for readability.

Prompt

@elasticsearch query the 'api-logs-2024-01' index for all 5xx errors in the last 24 hours, group by endpoint, and show me the top 5 failing routes

Output

Queried api-logs-2024-01 with filters: response_code >= 500, timestamp >= now-24h. Found 1,847 error documents. Top 5 failing endpoints: /api/v2/orders/sync (612 errors, mostly 503 Service Unavailable), /api/v1/payments/process (401 errors, mix of 500 and 504), /api/v2/inventory/update (298 errors, all 502 Bad Gateway), /api/v1/users/profile (276 errors, 500 Internal Server Error), /api/v2/search (260 errors, 503). The /orders/sync spike started 6 hours ago and correlates with increased request volume.

Notes

This example pairs Elasticsearch's aggregation power with AI synthesis to surface actionable insights from raw logs. The MCP executes the query; the AI interprets patterns and correlates timing. Requires read access to the index. Large time ranges or high-cardinality aggregations may hit query timeouts or memory limits — narrow your time window if queries fail.

Use-case deep-dives

Log triage during incident response

When Elasticsearch MCP beats grep for post-mortems

A 6-person engineering team runs a post-mortem after a 2am outage. They need to correlate error spikes across three services, filter by timestamp windows, and export findings to a shared doc. The Elasticsearch MCP is the right call here because it surfaces index schemas first—so the team knows which fields exist before writing queries—then lets them iterate on filters without switching to Kibana. The query tool handles time ranges and pagination natively, which matters when you're scanning 40k log entries. The trade-off: if your logs live in CloudWatch or Datadog instead of self-hosted Elasticsearch, this MCP won't help. But for teams already running their own ELK stack, this turns Switchy into a collaborative query builder that keeps context in the workspace instead of lost in browser tabs.

Customer support knowledge base search

Why this MCP works for support teams under 10 people

A 4-person support team indexes their help articles, past tickets, and internal runbooks in Elasticsearch. During a customer call, they need to pull up the exact article that solved a similar issue last quarter. The Elasticsearch MCP wins here because the List Indices tool shows all knowledge bases at a glance, and the Query Index tool lets them filter by tags, dates, or keywords without memorizing DSL syntax. The schema tool is less critical in this scenario but useful when onboarding new hires who don't know which fields are searchable. The boundary: if your knowledge base is in Notion or Zendesk, those native integrations will be faster. But if you've already invested in Elasticsearch for full-text search across unstructured docs, this MCP turns Switchy into a shared search interface that the whole team can query together.

Product analytics data exploration

When Elasticsearch MCP replaces ad-hoc SQL for event logs

A 3-person product team tracks user events in Elasticsearch—signups, feature clicks, checkout flows. They meet weekly to review funnel drop-offs and need to slice data by cohort, date range, and event type. The Elasticsearch MCP is the right tool because it exposes the index schema upfront, so the PM knows which event properties are indexed, then lets the team write queries collaboratively in Switchy instead of passing SQL snippets in Slack. The query tool's pagination support matters when scanning 100k events per week. The catch: if your events are in Mixpanel or Amplitude, those tools have better funnel visualizations. But for teams that pipe raw events into Elasticsearch and want to explore data without a BI tool, this MCP turns Switchy into a lightweight analytics workspace where queries and findings live in the same thread.

Frequently asked

What does the Elasticsearch MCP do in Switchy?

It lets AI agents query your Elasticsearch cluster directly — list indices, inspect schemas, and run filtered searches with time ranges and pagination. The agent can explore your data structure and pull specific documents without you writing DSL queries. Useful when your team stores logs, metrics, or search data in Elasticsearch and wants conversational access.

Do I need admin access to connect Elasticsearch MCP?

You need an API key with read permissions on the indices you want the agent to query. Elasticsearch doesn't require cluster admin rights, but the key must have monitor and read privileges for the specific indices. Generate a restricted key in Kibana under Stack Management > API Keys to limit scope.

Can the Elasticsearch MCP write data or delete indices?

No. The three tools are read-only: list indices, get schema, and query documents. It cannot index new data, update mappings, or delete anything. If you need write operations, use Elasticsearch's REST API directly or a dedicated ETL tool — this MCP is for exploration and retrieval only.

How is this different from querying Elasticsearch in Kibana?

Kibana requires you to know Query DSL and navigate the UI. The MCP lets an AI agent build queries conversationally and combine Elasticsearch results with data from other tools in the same workspace. Trade-off: you lose Kibana's visualisations and aggregation builder, but gain cross-tool context in one chat thread.

Who on the team should connect the Elasticsearch MCP?

Whoever manages your Elasticsearch cluster or has access to create API keys. Once connected, any workspace member can ask the agent to query indices — they don't need direct Elasticsearch credentials. Just make sure the API key's scope matches what you want the team to see.

Data last verified 607 hours ago.Sources aggregated hourly to weekly. See docs/architecture/model-directory.md.