Skip to main content
Glama
mcp-opensearch

mcp-opensearch

by dmayan-ss

mcp-opensearch

Read-only MCP server for exploring and searching OpenSearch 2 clusters. Ideal for log analysis, index exploration, and query execution.

Tools

Tool

Description

ping

Check connectivity — returns cluster name and version

cluster_health

Cluster health status (green/yellow/red), node and shard counts

list_indices

List indices with health, doc count, and size. Optional pattern filter

get_index_mapping

Show field types and structure for an index

search

Execute queries using OpenSearch Query DSL (JSON)

count

Count documents matching an optional query

list_aliases

List all index aliases

get_document

Retrieve a specific document by ID

Related MCP server: openobserve-community-mcp

Installation — Claude Desktop Extension

  1. Build the extension package:

npx @anthropic-ai/mcpb pack .
  1. In Claude Desktop, go to Settings → Extensions and upload mcpopensearch.mcpb.

  2. Configure via the UI:

    • OpenSearch URL — e.g. http://your-opensearch:9200

    • Username / Password — optional, for basic auth

Installation — Claude Code

Add to your .claude/settings.json:

{
  "mcpServers": {
    "opensearch": {
      "command": "uv",
      "args": ["--directory", "/path/to/mcpopensearch", "run", "server.py"],
      "env": {
        "OPENSEARCH_URL": "http://localhost:9200",
        "OPENSEARCH_USERNAME": "",
        "OPENSEARCH_PASSWORD": ""
      }
    }
  }
}

Environment Variables

Variable

Default

Description

OPENSEARCH_URL

http://localhost:9200

OpenSearch cluster URL

OPENSEARCH_USERNAME

(none)

Basic auth username

OPENSEARCH_PASSWORD

(none)

Basic auth password

Query Examples

Search for errors in the last hour:

{
  "query": {
    "bool": {
      "must": [
        {"match": {"level": "ERROR"}},
        {"range": {"@timestamp": {"gte": "now-1h"}}}
      ]
    }
  },
  "sort": [{"@timestamp": "desc"}]
}

Count documents by status code:

{
  "query": {"match_all": {}},
  "aggs": {"status_codes": {"terms": {"field": "response_code"}}}
}

License

MIT

Available Tools

8 tools
cluster_healthA

Get the cluster health status including node count, shard info, and overall status (green/yellow/red).

Inputs: no named parameters. Returns: result

countA

Count documents in an index, optionally filtered by a query.

Args: index: Index name or pattern (e.g. 'logs-*'). query_body: Optional JSON string with a query filter (e.g. '{"query": {"match": {"level": "ERROR"}}}').

Inputs: index (required), query_body. Returns: result

get_documentB

Retrieve a specific document by its ID.

Args: index: Name of the index containing the document. doc_id: The document ID.

Inputs: index (required), doc_id (required). Returns: result

get_index_mappingA

Get the field mapping (schema) for an index, showing all fields and their types.

Args: index: Name of the index (e.g. 'filebeat-2024.01.15' or 'logs-*').

Inputs: index (required). Returns: result

list_aliasesA

List all index aliases in the cluster, showing which indices they point to.

Inputs: no named parameters. Returns: result

list_indicesA

List indices in the cluster with their health, doc count, and size.

Args: pattern: Optional index name pattern to filter (e.g. 'filebeat-', 'logs-').

Inputs: pattern. Returns: result

pingA

Check connectivity to the OpenSearch cluster. Returns cluster name and version.

Inputs: no named parameters. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 8 tools

    Disambiguation4/5

    Tools target distinct resources/actions: cluster health, index listing, mappings, search, count, aliases, and document retrieval. Ping and cluster_health both relate to health but are clearly differentiated, as are search and count; no tools appear to duplicate each other.

    Naming Consistency3/5

    Names are consistently lowercase snake_case, but conventions vary: bare verbs (ping, search, count), list_* (list_indices, list_aliases), get_* (get_document, get_index_mapping), and one noun-phrase tool (cluster_health). This is readable but not a uniform verb_noun pattern.

    Tool Count5/5

    Eight tools fit a focused OpenSearch query and observability server well. There is no bloat or redundancy, and each tool covers a meaningful operation.

    Completeness3/5

    The set covers health, index listing/mapping, search, count, aliases, and document retrieval, but lacks write operations and common admin reads like index settings or cluster/node stats. For a read-only observability tool it is workable, but as a general OpenSearch surface it has notable gaps.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      An MCP server that enables interaction with Elasticsearch and OpenSearch clusters for searching documents and managing indices. It provides tools for cluster health monitoring, index configuration, and general API requests.
      16
      Apache 2.0
    • A
      license
      B
      quality
      D
      maintenance
      A read-only MCP server for OpenObserve Community Edition that works over the REST API. Provides tools for searching logs, traces, stream schemas, and dashboards - no Enterprise license required.
      8
      73 PyPI
      16
      GPL 3.0
    • A
      license
      Not graded
      quality
      F
      maintenance
      A read-only MCP server for Elasticsearch 7.10 clusters, providing tools for cluster info, health, index listing, and Query DSL search with Google OAuth and Bearer token authentication.
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      A read-only MCP server that enables AI assistants to search, aggregate, and explore OpenSearch log data through 12 tools for connectivity, index discovery, search, and aggregations.
      17
      MIT