Skip to main content

Add your description here

Project description

OpenSearch MCP Server

A minimal Model Context Protocol (MCP) server for OpenSearch exposing 4 tools over stdio and sse server.

Available tools

  • list_indices: Lists all indices in OpenSearch.
  • get_index_mapping: Gets the mapping for specified index.
  • search_index: Searches an index using a query.
  • get_shards: Gets information about shards in OpenSearch cluster.

More tools coming soon

Installation

Install from PyPI:

pip install test-opensearch-mcp

Configuration

Authentication Methods:

  • Basic Authentication
export OPENSEARCH_URL="<your_opensearch_domain_url>"
export OPENSEARCH_USERNAME="<your_opensearch_domain_username>"
export OPENSEARCH_PASSWORD="<your_opensearch_domain_password>"
  • IAM Role Authentication
export OPENSEARCH_URL="<your_opensearch_domain_url>"
export AWS_REGION="<your_aws_region>"
export AWS_ACCESS_KEY="<your_aws_access_key>"
export AWS_SECRET_ACCESS_KEY="<your_aws_secret_access_key>"
export AWS_SESSION_TOKEN="<your_aws_session_token>"

Usage

Running with Python:

  • Stdio Server
python -m mcp_server_opensearch
  • SSE Server
python -m mcp_server_opensearch --transport sse

Running with UV:

Note: These commands must be run from the src directory of the project.

  • Stdio Server
uv run python -m mcp_server_opensearch 
  • SSE Server
uv run python -m mcp_server_opensearch --transport sse

Claude Desktop Integration

Using the Published PyPI Package

{
    "mcpServers": {
        "opensearch-mcp-server": {
            "command": "uvx",
            "args": [
                "test-opensearch-mcp"
            ],
            "env": {
                // Required
                "OPENSEARCH_URL": "<your_opensearch_domain_url>",

                // For Basic Authentication
                "OPENSEARCH_USERNAME": "<your_opensearch_domain_username>",
                "OPENSEARCH_PASSWORD": "<your_opensearch_domain_password>",

                // For IAM Role Authentication
                "AWS_REGION": "<your_aws_region>",
                "AWS_ACCESS_KEY": "<your_aws_access_key>",
                "AWS_SECRET_ACCESS_KEY": "<your_aws_secret_access_key>",
                "AWS_SESSION_TOKEN": "<your_aws_session_token>"
            }
        }
    }
}

Using the Installed Package (via pip):

{
    "mcpServers": {
        "opensearch-mcp-server": {
            "command": "python",  // Or full path to python with PyPI package installed
            "args": [
                "-m",
                "mcp_server_opensearch"
            ],
            "env": {
                // Required
                "OPENSEARCH_URL": "<your_opensearch_domain_url>",

                // For Basic Authentication
                "OPENSEARCH_USERNAME": "<your_opensearch_domain_username>",
                "OPENSEARCH_PASSWORD": "<your_opensearch_domain_password>",

                // For IAM Role Authentication
                "AWS_REGION": "<your_aws_region>",
                "AWS_ACCESS_KEY": "<your_aws_access_key>",
                "AWS_SECRET_ACCESS_KEY": "<your_aws_secret_access_key>",
                "AWS_SESSION_TOKEN": "<your_aws_session_token>"
            }
        }
    }
}

Using Local Clone:

{
    "mcpServers": {
        "opensearch-mcp-server": {
            "command": "uv", # Or full path to uv
            "args": [
                "--directory",
                "path/to/the/clone/mcp-server",
                "run",
                "--",
                "python",
                "-m",
                "mcp_server_opensearch"
            ],
            "env": {
                // Required
                "OPENSEARCH_URL": "<your_opensearch_domain_url>",

                // For Basic Authentication
                "OPENSEARCH_USERNAME": "<your_opensearch_domain_username>",
                "OPENSEARCH_PASSWORD": "<your_opensearch_domain_password>",

                // For IAM Role Authentication
                "AWS_REGION": "<your_aws_region>",
                "AWS_ACCESS_KEY": "<your_aws_access_key>",
                "AWS_SECRET_ACCESS_KEY": "<your_aws_secret_access_key>",
                "AWS_SESSION_TOKEN": "<your_aws_session_token>"
            }
        }
    }
}

Development

Environment Setup:

  1. Create & activate a virtual environment
uv venv 
source .venv/bin/activate
  1. Install dependencies
uv sync # Install from uv.lock

Managing Dependencies:

  • Add new dependencies:
uv add <package-name>

Note: This automatically updates the pyproject.toml, uv.lock, and installs in virtual environment

  • Update after manual pyproject.toml changes:
uv lock 
uv sync

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

test_opensearch_mcp-0.1.2.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

test_opensearch_mcp-0.1.2-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

Details for the file test_opensearch_mcp-0.1.2.tar.gz.

File metadata

  • Download URL: test_opensearch_mcp-0.1.2.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.0

File hashes

Hashes for test_opensearch_mcp-0.1.2.tar.gz
Algorithm Hash digest
SHA256 e324ab89362ddb90045e73c0ad811fe4dcd5bf976fbc30e364a4846953ff9b7f
MD5 cf098a25f16fd2e627bf470e4a6711de
BLAKE2b-256 cb3cf8952c4bccd7a41db4e0ce14687f36b3b896ae44ca78f1e8a4b2bf4e5ea8

See more details on using hashes here.

File details

Details for the file test_opensearch_mcp-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for test_opensearch_mcp-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6a007472ac8695335725a857eca4cb4e66a92b58e0393bddc94ace8023512c8a
MD5 dc1161556a55cb3007abd1f949a032a3
BLAKE2b-256 9e7111146438ef5f6710cd9c45ce6b4801789136b2500e9baa4aecc5f64f2f65

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page