mcp-server-opensearch: An OpenSearch MCP Server

mcp-server-opensearch: An OpenSearch MCP Server

By ibrooksSDX GitHub

-

mcp-server-opensearch OpenSearch
Overview

What is mcp-server-opensearch?

The mcp-server-opensearch is an implementation of a Model Context Protocol (MCP) server designed to work with OpenSearch, a distributed search and analytics engine. It serves as a semantic memory layer that allows for the storage and retrieval of memories in the OpenSearch database.

How to use mcp-server-opensearch?

To use the mcp-server-opensearch, you can install it via Smithery or run it directly using the uv command. Configuration is done through a JSON file or environment variables to connect to your OpenSearch instance.

Key features of mcp-server-opensearch?

  • Seamless integration with OpenSearch for memory storage and retrieval.
  • Ability to run as a server for LLM applications.
  • Supports configuration through environment variables and JSON files.

Use cases of mcp-server-opensearch?

  1. Building AI-powered IDEs that require memory management.
  2. Enhancing chat interfaces with contextual memory.
  3. Creating custom AI workflows that need to store and retrieve data efficiently.

FAQ from mcp-server-opensearch?

  • What is the Model Context Protocol (MCP)?

MCP is an open protocol that facilitates the integration of LLM applications with external data sources and tools.

  • How do I install mcp-server-opensearch?

You can install it using the Smithery CLI or run it directly with the uv command.

  • What is OpenSearch?

OpenSearch is a distributed search and analytics engine that allows for powerful data querying and analysis.

Content

mcp-server-opensearch: An OpenSearch MCP Server

smithery badge

The Model Context Protocol (MCP) is an open protocol that enables seamless integration between LLM applications and external data sources and tools. Whether you’re building an AI-powered IDE, enhancing a chat interface, or creating custom AI workflows, MCP provides a standardized way to connect LLMs with the context they need.

This repository is an example of how to create a MCP server for OpenSearch, a distributed search and analytics engine.

Under Contruction

image1 image2

Current Blocker - Async Client from OpenSearch isn't installing

Open Search Async Client Docs

pip install opensearch-py[async]
zsh: no matches found: opensearch-py[async]

Overview

A basic Model Context Protocol server for keeping and retrieving memories in the OpenSearch engine. It acts as a semantic memory layer on top of the OpenSearch database.

Components

Tools

  1. search-openSearch
    • Store a memory in the OpenSearch database
    • Input:
      • query (json): prepared json query message
    • Returns: Confirmation message

Installation

Installing via Smithery

To install mcp-server-opensearch for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @ibrooksSDX/mcp-server-opensearch --client claude

When using uv no specific installation is needed to directly run mcp-server-opensearch.

uv run mcp-server-opensearch \
  --opensearch-url "http://localhost:9200" \
  --index-name "my_index" \

or

uv run fastmcp run demo.py:main

Testing - Local Open Search Client

image4

uv run python src/mcp-server-opensearch/test_opensearch.py

Testing - MCP Server Connection to Open Search Client

image1 image2

cd src/mcp-server-opensearch
uv run fastmcp dev demo.py

Usage with Claude Desktop

To use this server with the Claude Desktop app, add the following configuration to the "mcpServers" section of your claude_desktop_config.json:

{
  "opensearch": {
    "command": "uvx",
    "args": [
      "mcp-server-opensearch",
      "--opensearch-url",
      "http://localhost:9200",
      "--opensearch-api-key",
      "your_api_key",
      "--index-name",
      "your_index_name"
    ]
  }, "Demo": {
      "command": "uv",
      "args": [
        "run",
        "--with",
        "fastmcp",
        "--with",
        "opensearch-py",
        "fastmcp",
        "run",
        "/Users/ibrooks/Documents/GitHub/mcp-server-opensearch/src/mcp-server-opensearch/demo.py"
      ]
    }
}

Or use the FastMCP UI to install the server to Claude

uv run fastmcp install demo.py

Environment Variables

The configuration of the server can be also done using environment variables:

  • OPENSEARCH_HOST: URL of the OpenSearch server, e.g. http://localhost
  • OPENSEARCH_HOSTPORT: Port of the host of the OpenSearch server 9200
  • INDEX_NAME: Name of the index to use
No tools information available.
No content found.