mcp-elasticsearch
README.md
# mcp-elasticsearch
Elasticsearch MCP Server (Model Context Protocol) - **read-only search only**.
## Features
Only exposes read-only operations:
- `list_indices` - List all indices
- `get_mapping` - Get index mapping
- `search` - Execute search/aggregation query
## Supports two transport modes
### 1. stdio (for local/standalone deployment)
```bash
python -m mcp_elasticsearch --transport stdio --url http://localhost:9200
```
### 2. sse (for remote/containerized deployment)
```bash
python -m mcp_elasticsearch --transport sse --host 0.0.0.0 --port 8002 --url http://elasticsearch:9200 [--api-key your-secret-key]
```
## Environment variables
All command line arguments can also be set via environment variables:
- `TRANSPORT` - `stdio` or `sse` (default: `stdio`)
- `HOST` - bind host for sse mode (default: `0.0.0.0`)
- `PORT` - bind port for sse mode (default: `8002`)
- `ELASTICSEARCH_URL` - Elasticsearch URL
- `API_KEY` - Optional API key for client authentication
## Docker
```dockerfile
FROM python:3.11-slim
WORKDIR /app
COPY pyproject.toml poetry.lock ./
RUN poetry install --no-dev --no-root
COPY mcp_elasticsearch/ ./mcp_elasticsearch/
EXPOSE 8002
CMD ["python", "-m", "mcp_elasticsearch"]
```
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo issues