Elasticsearch MCP Server

Elasticsearch MCP Server

elasticsearch-mcp-server-fynnianb•byfynnianb

An MCP server for Elasticsearch that lets AI assistants search exceptions, analyze patterns and query logs across multiple teams and environments.

License: MIT•Runtime: Awaiting documentation review•Category: databases storage

WHAT IT DOES

  • •Searches exceptions with filtering by message, query, service, severity, time range or timeframe, with optional frequency sorting.
  • •Performs deep analysis of a specific exception with cause and solution suggestions.
  • •Analyzes exception patterns, frequency trends and service health over time.
  • •Searches general application logs and tests Elasticsearch connections per team and environment.

BEST FOR

  • •Investigating which exceptions are increasing in frequency over a recent time window.
  • •Finding the most frequent exceptions for a specific service while debugging.
  • •Searching application logs for specific messages or services during troubleshooting.

ABOUT ELASTICSEARCH-MCP-SERVER-FYNNIANB

Elasticsearch MCP Server is cataloged as an MCP server attributed to fynnianb. An MCP server for Elasticsearch that lets AI assistants search exceptions, analyze patterns and query logs across multiple teams and environments. It is categorized under databases storage. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: MIT. Check the source repository's current license and terms before using, modifying or distributing this software.

能力检查器

能力定义尚未审核。未核验的采集内容不会作为可信接口展示。

Tools (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Resources (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Prompts (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for Elasticsearch MCP Server are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

Can the server work with multiple teams and environments?

Yes, it supports multiple teams each with their own Elasticsearch clusters, and separate development, staging and production environments per team.

Which transport protocols does the server support?

It supports both HTTP+SSE and STDIO transport protocols.

Which authentication methods are supported for Elasticsearch?

It supports API keys and username/password authentication.

上游原版 README

在 GitHub 查看同一版本原文

README.md · 39291238ff63 · 采集于 2026-11-13 12:02:39 UTC

保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。

当前显示最后一次成功采集的文档快照,请以来源页面为准。

Elasticsearch MCP Server

A Model Context Protocol (MCP) server for Elasticsearch integration with multi-team and multi-environment support. This server allows AI assistants to search exceptions, analyze patterns, and query logs across different teams and environments in a secure and organized way.

Features

  • Multi-Team Support: Configure multiple teams with their own Elasticsearch clusters
  • Multi-Environment Support: Support for development, staging, production environments per team
  • Exception Search: Flexible exception search with filtering and frequency sorting
  • Exception Analysis: Deep analysis of specific exceptions with cause and solution suggestions
  • Trend Analysis: Analyze exception patterns, frequency trends, and service health
  • Log Search: Search application logs with various filters
  • Connection Testing: Test Elasticsearch connections for teams and environments
  • Flexible Authentication: Support for API keys and username/password authentication
  • HTTP and STDIO Transport: Support for both HTTP+SSE and STDIO transport protocols

Installation

npm install

Configuration

Environment Variables

  • LOG_LEVEL: Logging level (default: info) - handled directly by the logger
  • HTTP_PATH_PREFIX: HTTP path prefix (default: /)
  • TEAMS_CONFIG_PATH: Path to teams configuration file (optional)
  • PORT: HTTP server port (default: 3000)

Teams Configuration

Create a teams-config.json file based on teams-config.example.json:

{
  "server": {
    "name": "elasticsearch-mcp",
    "version": "1.0.0"
  },
  "teams": {
    "team-alpha": {
      "teamId": "team-alpha",
      "teamName": "Team Alpha",
      "defaultEnvironment": "production",
      "environments": {
        "staging": {
          "node": "https://alpha-staging-es.company.com",
          "apiKey": "your-api-key"
        },
        "production": {
          "node": "https://alpha-prod-es.company.com",
          "apiKey": "your-api-key"
        }
      },
      "indexPatterns": {
        "exceptions": ["alpha-logs-*", "alpha-exceptions-*"],
        "applications": ["alpha-apm-*", "alpha-metrics-*"],
        "logs": ["alpha-app-logs-*"]
      },
      "maxSearchResults": 50,
      "allowedOperations": ["search_exceptions", "analyze_exception", "analyze_trends", "search_logs", "test_connection"]
    }
  }
}

Configuration Options

  • teamId: Unique identifier for the team
  • teamName: Human-readable team name
  • defaultEnvironment: Default environment to use when none specified
  • environments: Elasticsearch connection configurations per environment
    • node: Elasticsearch cluster URL
    • apiKey: API key for authentication (optional)
    • username/password: Basic authentication (optional)
    • maxRetries: Maximum retry attempts (default: 3)
    • requestTimeout: Request timeout in milliseconds (default: 30000)
  • indexPatterns: Index patterns for different data types
    • exceptions: Patterns for exception/error logs
    • applications: Patterns for application metrics/APM data
    • logs: Patterns for general application logs
  • maxSearchResults: Maximum number of results to return (default: 50)
  • allowedOperations: List of allowed operations for this team (optional)

Usage

STDIO Mode (for MCP clients)

npm run dev
# or
npm start

HTTP Mode (for web interfaces)

npm run start-http
# or
npm run dev -- --http

The HTTP server will be available at:

  • SSE endpoint: GET http://localhost:3000/sse
  • Messages endpoint: POST http://localhost:3000/messages
  • Health check: GET http://localhost:3000/health

Available Tools

1. search_exceptions 🔍

Flexible exception search with advanced filtering and sorting capabilities.

Parameters:

  • environment (optional): The environment to search in
  • message (optional): Filter by exception message content
  • query (optional): Search term for exception message or stack trace
  • service (optional): Filter by service name
  • severity (optional): Filter by log severity level
  • timeRange (optional): Custom time range
    • start: Start time in ISO format
    • end: End time in ISO format
  • timeframe (optional): Predefined time frame (1h, 6h, 12h, 24h, 7d)
  • limit (optional): Number of results to return (default: 20, max: 100)
  • sortByFrequency (optional): Sort by frequency (most frequent first)

Use Cases:

  • "Welche Exceptions passen zu diesem Commit/Pull Request?"
  • "Zeige mir alle Database-Exceptions der letzten 6 Stunden"
  • "Finde die häufigsten Exceptions im User-Service"

2. analyze_exception 🔬

Deep analysis of a specific exception with causes and solution suggestions.

Parameters:

  • environment (optional): The environment to analyze
  • exceptionMessage (required): The specific exception message to analyze
  • timeframe (optional): Time frame for analysis (default: 24h)

Use Cases:

  • "Analysiere diese Exception: 'NullPointerException in UserService'"
  • "Was ist die Ursache für 'Connection timeout' Fehler?"

Analyze exception patterns, frequency trends, and service health over time.

Parameters:

  • environment (optional): The environment to analyze
  • timeRange (optional): Custom time range for analysis
  • timeframe (optional): Predefined time frame (default: 24h)
  • analysisType (optional): Type of analysis (exceptions, services, both)
  • services (optional): List of specific services to analyze

Use Cases:

  • "Welche Exceptions sind in den letzten 24h häufiger aufgetreten?"
  • "Welche Services werfen in letzter Zeit mehr Exceptions?"
  • "Zeige mir die Exception-Trends für das Payment-System"

4. search_logs 📋

Search general application logs with filtering capabilities.

Parameters:

  • environment (optional): The environment to search in
  • message (optional): Filter by log message content
  • service (optional): Filter by service name
  • timeRange (optional): Time range for search (defaults to last 1 hour)

Use Cases:

  • "Zeige mir alle Logs vom User-Service der letzten Stunde"
  • "Suche nach Logs mit 'payment failed'"

5. test_connection 🔌

Test Elasticsearch connection for a team and environment.

Parameters:

  • environment (optional): The environment to test

Use Cases:

  • "Teste die Verbindung zu Production"
  • "Ist Elasticsearch erreichbar?"

🚀 Common Prompts & Use Cases

Exception Investigation

"Welche Exceptions sind in den letzten 24h häufiger aufgetreten?"
→ Uses: analyze_trends with analysisType="exceptions"

"Mir ist diese Exception 'OutOfMemoryError' aufgefallen, finde mehr über sie heraus"
→ Uses: analyze_exception with exceptionMessage="OutOfMemoryError"

"Welche Exceptions passen zu diesem API-Endpoint /users/profile?"
→ Uses: search_exceptions with query="/users/profile"

Service Health Monitoring

"Welche Services werfen in letzter Zeit mehr Exceptions?"
→ Uses: analyze_trends with analysisType="services"

"Zeige mir alle Exceptions vom Payment-Service der letzten 6 Stunden"
→ Uses: search_exceptions with service="payment-service" and timeframe="6h"

Debugging & Troubleshooting

"Suche nach Database-Connection-Errors der letzten 24h"
→ Uses: search_exceptions with query="database connection" and timeframe="24h"

"Analysiere die häufigsten Exceptions im User-Service"
→ Uses: search_exceptions with service="user-service" and sortByFrequency=true

🛠️ Development

Code Quality

This project maintains high code quality standards:

# Run all quality checks
npm run check

# Individual checks
npm run typecheck    # TypeScript type checking
npm run lint         # ESLint code analysis
npm run format:check # Prettier formatting check

# Auto-fix issues
npm run lint:fix     # Fix ESLint issues
npm run format       # Format code with Prettier

Building

# Build the project
npm run build

# Clean build artifacts
npm run clean

Scripts Overview

  • npm run dev - Start development server with hot reload
  • npm run build - Build for production
  • npm run start - Build and start production server
  • npm run cli - Run the CLI tool
  • npm run check - Run all quality checks

Architecture

The server is built with a modular architecture:

  • ConfigManager: Handles team configuration loading and validation
  • ElasticsearchService: Manages Elasticsearch connections and queries
  • MCP Tools: Individual tools for different operations (5 optimized tools)
  • HTTP Server: Provides HTTP+SSE transport for web interfaces
  • STDIO Transport: Provides STDIO transport for MCP clients

Tool Design Philosophy

The tools are designed with these principles:

  • Short, memorable names (11-17 characters)
  • Clear separation of concerns (search vs. analyze vs. trends)
  • Flexible parameters to support various use cases
  • No functional duplication between tools

Security Considerations

  • Store sensitive credentials (API keys, passwords) securely
  • Use environment variables for sensitive configuration
  • Consider network security for Elasticsearch connections
  • Implement proper access controls per team
  • Use the allowedOperations configuration to restrict team capabilities

Error Handling

The server includes comprehensive error handling:

  • Configuration validation on startup
  • Connection error handling with retries
  • Graceful degradation for unavailable services
  • Detailed logging for troubleshooting

License

MIT

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Run linting and formatting
  6. Submit a pull request

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for Elasticsearch MCP Server from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/elasticsearch-mcp-server-fynnianb)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

下载与拉取统计

来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。

尚无已审核的包 / 镜像标识,暂不展示下载统计。

Related databases storage MCP Servers

Alternative and complementary servers in the same category

View all in databases storage →
AIStor MCP server
mcp-server-aistor•minio

This is a Model Context Protocol (MCP) server for interacting with AIStor object stores.

Repository stats unavailable
Databases & Storage
InfluxDB v2 MCP Server
influxdb-mcp-server•idoru

A Model Context Protocol (MCP) server that exposes access to an InfluxDB v2 instance using the InfluxDB OSS API v2.

Repository stats unavailable
Databases & Storage