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.3.tar.gz (11.4 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.3-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: test_opensearch_mcp-0.1.3.tar.gz
  • Upload date:
  • Size: 11.4 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.3.tar.gz
Algorithm Hash digest
SHA256 85fac10a70485b7185062fe521aa0032608ac45021b4cfcbb2ed15c070205ab2
MD5 cc6d29bad2a95fd2bf2eb1823a5df3bb
BLAKE2b-256 620e8aec66a38072d10fda48845b6aeff0365eaefd3abda8858a02415e2d35c8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for test_opensearch_mcp-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1ef333d0548ad58936cc06da51f29b3e1f29d2c7d1e527827d8ce14c62c8cc43
MD5 6efb30acb3e401f96ea65abba1055df2
BLAKE2b-256 89f5fafae3662ca14c99749ffdcc9abe7f866103027e1e3b2911e67c0e83ac92

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