Elasticsearch MCP Server
Integrates with Elastic products, providing semantic search capabilities via ELSER and kNN, hybrid search, and automatic index setup for Elasticsearch.
Supports managed Elastic Cloud clusters with API key authentication, enabling semantic search and index management.
Provides tools for interacting with Elasticsearch, including semantic search (ELSER, kNN), hybrid search, index management, and document indexing, optimized for Elasticsearch Serverless and Elastic Cloud.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Elasticsearch MCP ServerSearch for 'machine learning trends' using ELSER in my news index"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Elasticsearch Web API
A FastAPI-based web server that exposes Elasticsearch semantic search and data retrieval capabilities through a simple REST API. This project connects directly to your Elasticsearch cluster (including Elastic Cloud and Serverless) and allows you to build custom search applications effortlessly.
🚀 Features
Semantic Search: Use native Elasticsearch semantic capabilities directly through a REST API.
REST API First: Fully functional web API with built-in Swagger documentation.
Data Retrieval: Easily pull raw documents from any index.
Python Integration: Includes a helper script (
multi_index_search.py) demonstrating how to interact with the API using Python.
🛠️ Quickstart
1. Configure Environment
Edit the .env file with your Elasticsearch connection details:
ELASTICSEARCH_HOSTS=https://your-cluster-url.es.aws.elastic.cloud:443
ELASTICSEARCH_API_KEY=your_api_key_here2. Start the Web API
Start the web server using the pre-configured executable in your virtual environment:
.\venv\Scripts\elasticsearch-api.exeOnce running, you can access:
API Health Check:
http://localhost:8000/pingInteractive Documentation (Swagger UI):
http://localhost:8000/docs
3. Run the Example Script
A demo script (multi_index_search.py) is provided to show how to communicate with the API. While the server is running, open a new terminal and execute:
.\venv\Scripts\python.exe multi_index_search.pyThis script will:
Connect to the local API via
http://localhost:8000/callRetrieve records from the
company_detailsindex.Perform native semantic searches on the
om_poc_v2index using natural language queries.Print the matched products with their relevance scores, prices, categories, and descriptions!
🔍 Core Endpoints
GET /ping: Verify your cluster connection.GET /tools: List all available internal tools.POST /call: The primary dynamic endpoint. Pass a tool name (likees_raw_search) and its arguments (like index and query DSL body) to interact with the Elasticsearch cluster.
⚠️ Requirements
Python 3.11+
Elasticsearch 8.8+ (including Serverless)
Valid API Keys and a running cluster defined in your
.envfile.
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Dhananjayrbiraris/mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server