Home / MCP / OpenSearch MCP Server

OpenSearch MCP Server

Provides OpenSearch interactions for indexing, searching, and cluster management via MCP endpoints.

typescript
Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
    "mcpServers": {
        "opensearch_mcp": {
            "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"
            }
        }
    }
}

You can interact with an OpenSearch cluster through a dedicated MCP server that exposes index, document, and cluster operations. This MCP server lets you search documents, inspect mappings and settings, and monitor cluster health and stats, all via a client that speaks the MCP protocol.

How to use

Connect with an MCP client to run OpenSearch operations. Start the OpenSearch cluster, then run the MCP server client integration to issue queries and manage the cluster.

How to install

Prerequisites you need before starting:

  • Docker and Docker Compose installed on your machine
  • Claude Desktop installed if you plan to interact via Claude's interface
  • A current OpenSearch environment or a local OpenSearch cluster to connect to

1) Start the OpenSearch cluster locally with a 3-node setup and Kibana using Docker Compose.

docker-compose up -d

2) Verify you can access Kibana at the default URL.

3) Configure Claude Desktop to run the MCP server via UV by placing the following configuration in your Claude Desktop configuration file. Update the path to the OpenSearch MCP server source as needed.

{
  "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"
      }
    }
  }
}

Additional setup notes

On macOS, place the Claude configuration at ~/Library/Application Support/Claude/claude_desktop_config.json. On Windows, place it at %APPDATA%/Claude/claude_desktop_config.json. Restart Claude Desktop after saving the changes to load the new MCP server.

What you can do with the MCP server

With the OpenSearch MCP server you can perform these core operations:

  • List all indices in the OpenSearch cluster
  • Retrieve mapping configuration for a specific index
  • Get settings configuration for a specific index
  • Search documents using OpenSearch Query DSL
  • Get cluster health status
  • Get cluster statistics

Available tools

list_indices

Lists all indices present in the connected OpenSearch cluster.

get_mapping

Retrieves the index mapping for a specified index.

get_settings

Fetches the settings for a specified index.

search_documents

Executes a search against documents in an index using OpenSearch Query DSL.

get_cluster_health

Returns the health status of the OpenSearch cluster.

get_cluster_stats

Provides statistical information about the OpenSearch cluster.