Skip to main content

OpenSearch logo

OpenSearch MCP Server

opensearch-mcp-server-py is a Model Context Protocol (MCP) server for OpenSearch that enables AI assistants to interact with OpenSearch clusters. It provides a standardized interface for AI models to perform operations like searching indices, retrieving mappings, and managing shards through both stdio and streaming (SSE/Streamable HTTP) protocols.

Key features:

  • Seamless integration with AI assistants and LLMs through the MCP protocol
  • Support for both stdio and streaming server transports (SSE and Streamable HTTP)
  • Built-in tools for common OpenSearch operations
  • Easy integration with Claude Desktop and LangChain
  • Secure authentication using basic auth or IAM roles

Installing opensearch-mcp-server-py

Opensearch-mcp-server-py can be installed from PyPI via pip:

pip install opensearch-mcp-server-py

Available Tools

  • ListIndexTool: Lists all indices in OpenSearch.
  • IndexMappingTool: Retrieves index mapping and setting information for an index in OpenSearch.
  • SearchIndexTool: Searches an index using a query written in query domain-specific language (DSL) in OpenSearch.
  • GetShardsTool: Gets information about shards in OpenSearch.
  • ClusterHealthTool: Returns basic information about the health of the cluster.
  • CountTool: Returns number of documents matching a query.
  • ExplainTool: Returns information about why a specific document matches (or doesn't match) a query.
  • MsearchTool: Allows to execute several search operations in one request.

Tool Parameters

  • ListIndexTool

    • opensearch_url (optional): The OpenSearch cluster URL to connect to
  • IndexMappingTool

    • opensearch_url (optional): The OpenSearch cluster URL to connect to
    • index (required): The name of the index to retrieve mappings for
  • SearchIndexTool

    • opensearch_url (optional): The OpenSearch cluster URL to connect to
    • index (required): The name of the index to search in
    • query (required): The search query in OpenSearch Query DSL format
  • GetShardsTool

    • opensearch_url (optional): The OpenSearch cluster URL to connect to
    • index (required): The name of the index to get shard information for
  • ClusterHealthTool

    • opensearch_url (optional): The OpenSearch cluster URL to connect to
    • index (optional): Limit health reporting to a specific index
  • CountTool

    • opensearch_url (optional): The OpenSearch cluster URL to connect to
    • index (optional): The name of the index to count documents in
    • body (optional): Query in JSON format to filter documents
  • ExplainTool

    • opensearch_url (optional): The OpenSearch cluster URL to connect to
    • index (required): The name of the index to retrieve the document from
    • id (required): The document ID to explain
    • body (required): Query in JSON format to explain against the document
  • MsearchTool

    • opensearch_url (optional): The OpenSearch cluster URL to connect to
    • index (optional): Default index to search in
    • body (required): Multi-search request body in NDJSON format

More tools coming soon. Click here

User Guide

For detailed usage instructions, configuration options, and examples, please see the User Guide.

Contributing

Interested in contributing? Check out our:

Code of Conduct

This project has adopted the Amazon Open Source Code of Conduct. For more information see the Code of Conduct FAQ, or contact opensource-codeofconduct@amazon.com with any additional questions or comments.

License

This project is licensed under the Apache v2.0 License.

Copyright 2020-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.

Metadata

Release files for test-opensearch-mcp-server-py 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for test-opensearch-mcp-server-py 0.3.0
File Size Uploaded
test_opensearch_mcp_server_py-0.3.0.tar.gz 18.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for test-opensearch-mcp-server-py 0.3.0
File Interpreter ABI Platform
test_opensearch_mcp_server_py-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 40.1 kB

Release files / test_opensearch_mcp_server_py-0.3.0.tar.gz

Download URL test_opensearch_mcp_server_py-0.3.0.tar.gz
Size 18.6 kB
Tags Source
SHA-256 checksum
How to use checksums
8b8de4c9b4980e0dacc0c084c520a563393c473a94f9f373373c013264888555
BLAKE2b-256 checksum
How to use checksums
f2678b3437008b47d95e23420262919106f99c021d4b08a07f656748866674e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.16

Release files / test_opensearch_mcp_server_py-0.3.0-py3-none-any.whl

Download URL test_opensearch_mcp_server_py-0.3.0-py3-none-any.whl
Size 21.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
129236fc0f4dd9a3c3b515aacd77c0e797dee66e21f00a5d3855f368b439bd65
BLAKE2b-256 checksum
How to use checksums
5789c33b98041f18df650547c923a10548873c23065ffb6e0ce97b169b018b16
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.16

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page