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 testing-opensearch-mcp-server-py 0.2.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 testing-opensearch-mcp-server-py 0.2.0
File Size Uploaded
testing_opensearch_mcp_server_py-0.2.0.tar.gz 18.7 kB Details

Built distribution (wheel)

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

Total release size: 40.2 kB

Release files / testing_opensearch_mcp_server_py-0.2.0.tar.gz

Download URL testing_opensearch_mcp_server_py-0.2.0.tar.gz
Size 18.7 kB
Tags Source
SHA-256 checksum
How to use checksums
b5383424021426aa2f1d6ed433000c5cfa8eaafb61fbc57fb0214fc4f561cb48
BLAKE2b-256 checksum
How to use checksums
731f68b883987f4eb461caa6df350689bf5ed2f7ec3a2ad105eac5230d55dd64
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.16

Release files / testing_opensearch_mcp_server_py-0.2.0-py3-none-any.whl

Download URL testing_opensearch_mcp_server_py-0.2.0-py3-none-any.whl
Size 21.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5ac432de58f2a41193255d8b849379a121def2fe96c6feaee2a4cb501b845aa2
BLAKE2b-256 checksum
How to use checksums
6e2bacf074441c6589e7f4a2eeee6ef8d3b01b3d2d2c53ba53e63937b2c4278c
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.2.0 This release

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