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

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

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: test_opensearch_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 11.3 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.0.tar.gz
Algorithm Hash digest
SHA256 1ed5005e16e76215cebd79c9093f40699bca5ff9818affe747696051b9552cf7
MD5 21a185d6506c519fd6d6b685a77f451f
BLAKE2b-256 74f38b0f4a178e1a72ccb0f7ffabfad76367c927340a8ed68627846531d05195

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for test_opensearch_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 44c6b733cb73812a7ea122358e57ee910fee3f7dc1cf48655188ab092a66a350
MD5 bd1c56398aca48b32b6d3dd7bee9dbea
BLAKE2b-256 79e0820a7372e0abd6a5b4119ad6ff79f68171e5b3523017009ae6f24692ef14

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