Skip to main content
Glama
mcp-search-gateway

mcp-search-gateway

by WhoisMonesh

mcp-search-gateway

Production-ready MCP server that exposes OpenSearch and Elasticsearch clusters as Model Context Protocol tools, enabling local and remote LLMs to search, index, and manage your search infrastructure.

Docker Build CI License: MIT ghcr.io

Features

  • Dual backend — supports both OpenSearch and Elasticsearch from a single image

  • 10 MCP tools — search, index, delete, list indices, cluster health (5 per backend)

  • Multi-arch Docker images — linux/amd64 + linux/arm64 via docker buildx

  • Flexible auth — basic, API key, AWS SigV4 (IAM / IRSA)

  • LLM integrations — Claude Desktop, Ollama, Vertex AI, Amazon Bedrock

  • Hardened image — non-root user, read-only FS, Trivy-scanned

  • CI/CD — GitHub Actions (GHCR) + Bitbucket Pipelines (JFrog Artifactory)

Related MCP server: Elasticsearch MCP Server

Quick Start

# 1. Clone the repo
git clone https://github.com/WhoisMonesh/mcp-search-gateway.git
cd mcp-search-gateway

# 2. Start OpenSearch + Dashboards + MCP Gateway
docker compose -f examples/docker-compose/opensearch-mcp.yml up -d

# 3. Verify health
curl http://localhost:8080/health
# {"status":"ok","backend":"opensearch"}

From source

npm install
MCP_CONFIG=config/opensearch.local.yaml npm start

Pull the image

docker pull ghcr.io/whoismonesh/mcp-search-gateway:latest

Repository Structure

mcp-search-gateway/
├── .github/
│   └── workflows/
│       ├── docker-multiarch-build.yml  # Build & push multi-arch image to GHCR
│       └── lint-test.yml               # ESLint + Jest CI
├── config/
│   ├── opensearch.local.yaml         # Local OpenSearch config
│   ├── opensearch.aws.yaml           # Amazon OpenSearch Service (IAM)
│   └── elasticsearch.local.yaml      # Local Elasticsearch config
├── docker/
│   └── Dockerfile                    # Hardened multi-stage build
├── docs/
│   ├── architecture.md               # System design & component overview
│   ├── configuration.md              # Full config reference
│   └── llm-integration.md            # LLM integration guides
├── examples/
│   └── docker-compose/
│       ├── opensearch-mcp.yml           # OpenSearch + Dashboards + MCP
│       └── elasticsearch-mcp.yml        # Elasticsearch + Kibana + MCP
├── src/
│   ├── server.js                     # MCP JSON-RPC 2.0 server
│   ├── config.js                     # YAML config loader & validator
│   ├── client.js                     # Search client adapter
│   └── tools/
│       ├── search.js                   # Search tools
│       ├── index.js                    # Index document tools
│       ├── indices.js                  # List indices tools
│       ├── cluster.js                  # Cluster health tools
│       └── delete.js                   # Delete document tools
├── bitbucket-pipelines.yml           # Bitbucket + JFrog Artifactory CI
├── package.json
└── README.md

MCP Tools

Tool

Description

opensearch_search

Execute a search query against an OpenSearch index

opensearch_index_document

Index a document into OpenSearch

opensearch_delete_document

Delete a document by ID from OpenSearch

opensearch_list_indices

List all OpenSearch indices

opensearch_cluster_health

Get OpenSearch cluster health status

elasticsearch_search

Execute a search query against an Elasticsearch index

elasticsearch_index_document

Index a document into Elasticsearch

elasticsearch_delete_document

Delete a document by ID from Elasticsearch

elasticsearch_list_indices

List all Elasticsearch indices

elasticsearch_cluster_health

Get Elasticsearch cluster health status

Configuration

Create a YAML config file and point MCP_CONFIG to it:

# config/opensearch.local.yaml
backend: opensearch
node: https://localhost:9200

auth:
  type: basic
  username: admin
  password: admin

tls:
  verify: false

See docs/configuration.md for the full reference including AWS IAM / API key auth.

LLM Integration

Claude Desktop

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "opensearch": {
      "command": "docker",
      "args": ["run", "--rm", "-i",
        "-v", "/path/to/config:/config:ro",
        "-e", "MCP_CONFIG=/config/opensearch.local.yaml",
        "ghcr.io/whoismonesh/mcp-search-gateway:latest"]
    }
  }
}

Ollama

docker run -d -p 8080:8080 \
  -e MCP_CONFIG=/config/opensearch.local.yaml \
  -e MCP_TRANSPORT=http \
  -v ./config:/config:ro \
  ghcr.io/whoismonesh/mcp-search-gateway:latest

See docs/llm-integration.md for Vertex AI and Amazon Bedrock guides.

Docker Build

The multi-arch image is built automatically on every tag push:

# Manual multi-arch build
docker buildx build \
  --platform linux/amd64,linux/arm64 \
  -t ghcr.io/whoismonesh/mcp-search-gateway:latest \
  -f docker/Dockerfile \
  --push .

CI/CD

Pipeline

Trigger

Output

GitHub Actions (docker-multiarch-build.yml)

Push to main, tags v*

Multi-arch image on GHCR

GitHub Actions (lint-test.yml)

Every PR & push

ESLint + Jest results

Bitbucket Pipelines (bitbucket-pipelines.yml)

Push to main, tags v*

Multi-arch image on JFrog Artifactory

Contributing

  1. Fork the repository

  2. Create a feature branch: git checkout -b feat/my-feature

  3. Run tests: npm test

  4. Submit a pull request

License

MIT © WhoisMonesh

Tool Schema Changelog

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

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables LLMs to interact with OpenSearch clusters to monitor cluster health, manage indices, and perform data searches. It provides a standardized interface for real-time OpenSearch operations within MCP-compatible environments like Open WebUI.
      -
    • A
      license
      B
      quality
      F
      maintenance
      Enables interaction with OpenSearch clusters, providing tools to list indices, retrieve mappings, search using query DSL, and get shard information.
      4
      1
      Apache 2.0
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables AI assistants to interact with OpenSearch clusters for searching indices, retrieving mappings, and managing shards through the MCP protocol.
      Apache 2.0