This guide walks you through connecting Elasticsearch to Mastra AI using the Composio tool router. By the end, you'll have a working Elasticsearch agent that can list indices, run queries against an index, inspect index schemas, and check your cluster connection through natural language commands.
This guide will help you understand how to give your Mastra AI agent real control over a Elasticsearch account through Composio's Elasticsearch MCP server.
Before we dive in, let's take a quick look at the key ideas and tools involved.
For exact tool slugs and parameter tables, see the tool catalog in the Composio docs.






