Get the FREE Ultimate OpenClaw Setup Guide →

opensearch

OpenSearch MCP Server: Open-source search cluster management component

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio seohyunjun-opensearch-mcp-server uv --directory path/to/src/opensearch_mcp_server run opensearch-mcp-server \
  --env DASHBOARDS_HOST="https://localhost:5601" \
  --env OPENSEARCH_HOST="https://localhost:9200" \
  --env OPENSEARCH_PASSWORD="test123" \
  --env OPENSEARCH_USERNAME="opensearch"

How to use

This MCP server provides an OpenSearch integration through the MCP (Model Context Protocol) interface. It exposes a set of tools for interacting with an OpenSearch cluster: index operations (list_indices, get_mapping, get_settings), document operations (search_documents), and cluster operations (get_cluster_health, get_cluster_stats). You can run the server locally using Claude Desktop by configuring UV to point at your local source and then issuing natural language commands that map to these tools, such as listing indices, querying documents with OpenSearch’s query DSL, or checking cluster health. The included usage example shows how to connect Claude Desktop to a local OpenSearch cluster using environment variables for credentials and connection details. Once running, you can perform actions like listing all indices, retrieving mappings or settings for a specific index, searching documents with a DSL query, and inspecting cluster health and statistics.

To interact with the server, ensure the MCP server is running and that Claude Desktop is configured with the opensearch MCP server entry. Commands issued through Claude will be translated to the corresponding MCP tool invocations (e.g., list_indices -> OPENSEARCH /indices, search_documents with a query, etc.).

How to install

Prerequisites:

  • OpenSearch cluster running (e.g., via Docker Compose from the repository's guidance).
  • Node.js environment not required if you use Claude with UV as described, but you will need Claude Desktop and its MCP integration.

Install OpenSearch cluster (example from the repository):

  • git clone <repo>
  • docker-compose up -d

Install and configure Claude Desktop MCP integration:

  • Ensure Claude Desktop is installed.
  • Add a new MCP server entry as shown in the example configuration below (adjust paths and credentials as needed).

Configuration example (for Claude Desktop):

{
  "mcpServers": {
    "opensearch": {
      "command": "uv",
      "args": [
        "--directory",
        "path/to/src/opensearch_mcp_server",
        "run",
        "opensearch-mcp-server"
      ],
      "env": {
        "OPENSEARCH_HOST": "https://localhost:9200",
        "OPENSEARCH_USERNAME": "opensearch",
        "OPENSEARCH_PASSWORD": "test123",
        "DASHBOARDS_HOST": "https://localhost:5601"
      }
    }
  }
}

Notes:

  • You may need to adapt the directory path to where you have the OpenSearch MCP server source checked out.
  • Ensure the OpenSearch cluster is reachable at the host/port you specify in OPENSEARCH_HOST.

Additional notes

Environment variables control how the MCP server authenticates with OpenSearch and where to access the Dashboards UI. Common issues include network connectivity to OpenSearch (verify TLS and credentials), OpenSearch CORS settings if using dashboards, and ensuring the OpenSearch cluster is running (docker-compose up -d). If you modify the host or credentials, update the corresponding OPENSEARCH_* variables and reload Claude Desktop. The server exposes a focused set of tools; if a tool is not returning expected results, check the OpenSearch endpoint being targeted (indices vs mappings vs health) and verify permissions for the provided user.

Related MCP Servers

Sponsor this space

Reach thousands of developers