
Research
Security News
The Growing Risk of Malicious Browser Extensions
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
github.com/sonirico/mcp-elasticsearch
A Model Context Protocol (MCP) server that provides Elasticsearch integration capabilities to AI assistants and other MCP clients. This server enables querying Elasticsearch clusters through a standardized interface.
List all Elasticsearch indices with optional pattern filtering.
Parameters:
pattern
(string, optional): Index pattern filter (default: "*")Returns:
Get field mappings for one or more Elasticsearch indices.
Parameters:
index
(string, required): Index name or patternReturns:
Execute Elasticsearch search queries with full DSL support.
Parameters:
index
(string, required): Index name or pattern to searchquery
(string, optional): Elasticsearch query DSL as JSON (default: "{}")size
(number, optional): Maximum documents to return (default: 10, max: 10000)sort
(string, optional): Sort specification as JSONtrack_total_hits
(boolean, optional): Track total hit count (default: true)Returns:
ES_URL
: Elasticsearch cluster URL (required)ES_API_KEY
: API key for authentication (optional)ES_USERNAME
: Username for basic authentication (optional)ES_PASSWORD
: Password for basic authentication (optional)MCP_ES_SERVER_NAME
: Server name (default: "mcp-elasticsearch π")MCP_ES_LOG_LEVEL
: Log level (debug, info, warn, error, fatal)MCP_ES_LOG_FORMAT
: Log format (json, console)MCP_ES_LOG_OUTPUT
: Log output (stdout, stderr)You must provide either:
ES_API_KEY
ES_USERNAME
and ES_PASSWORD
# Clone and build
git clone <repository>
cd mcp-elasticsearch
go mod download
go build -o bin/mcp-elasticsearch .
# Install to system
sudo install bin/mcp-elasticsearch /usr/local/bin/
# With API key
ES_URL="https://your-cluster.com" ES_API_KEY="your-api-key" mcp-elasticsearch
# With basic auth
ES_URL="https://your-cluster.com" ES_USERNAME="user" ES_PASSWORD="pass" mcp-elasticsearch
# With custom logging
ES_URL="https://your-cluster.com" ES_API_KEY="key" MCP_ES_LOG_LEVEL=debug mcp-elasticsearch
Add to your Claude configuration:
{
"mcpServers": {
"elasticsearch": {
"command": "mcp-elasticsearch",
"env": {
"ES_URL": "https://your-cluster.com",
"ES_API_KEY": "your-api-key",
"MCP_ES_LOG_LEVEL": "info"
}
}
}
}
Update your config.json
:
{
"mcpServers": {
"elasticsearch-go": {
"command": "/usr/local/bin/mcp-elasticsearch",
"env": {
"ES_URL": "https://atani.es.eu-west-1.aws.found.io",
"ES_API_KEY": "your-api-key",
"MCP_ES_LOG_LEVEL": "info"
}
}
}
}
{
"tool": "list_indices",
"parameters": {
"pattern": "*"
}
}
{
"tool": "list_indices",
"parameters": {
"pattern": "logs-*"
}
}
{
"tool": "get_index_mappings",
"parameters": {
"index": "logs-apm.error-*"
}
}
{
"tool": "search",
"parameters": {
"index": "logs-*",
"query": "{\"match\": {\"service.name\": \"broker-api-b2b\"}}",
"size": 50
}
}
{
"tool": "search",
"parameters": {
"index": "logs-*",
"query": "{\"bool\": {\"must\": [{\"term\": {\"service.name\": \"broker-api-b2b\"}}, {\"range\": {\"@timestamp\": {\"gte\": \"now-24h\"}}}]}}",
"size": 0,
"aggs": "{\"error_types\": {\"terms\": {\"field\": \"error.type.keyword\", \"size\": 10}}}"
}
}
{
"tool": "search",
"parameters": {
"index": "logs-*",
"query": "{\"match\": {\"log.level\": \"ERROR\"}}",
"sort": "[{\"@timestamp\": {\"order\": \"desc\"}}]",
"size": 20
}
}
# Install dependencies
go mod download
# Format code
gofmt -w .
# Run tests
go test -v ./...
# Build
go build -o bin/mcp-elasticsearch .
# Run with debug logging
MCP_ES_LOG_LEVEL=debug go run .
The server provides detailed error messages for common issues:
MIT License - See LICENSE file for details.
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.