opensearch-mcp-server-py

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 such as searching indices and retrieving mappings.

GitHub Stars

49

User Rating

Not Rated

Favorites

0

Views

30

Forks

31

Issues

12

Installation
Difficulty
Intermediate
Estimated Time
10-20 minutes
Requirements
Python 3.6 or higher

Installation

Installation

Prerequisites

Python: 3.6 or higher

Installation Steps

1. Install from PyPI

bash
pip install opensearch-mcp-server-py

Troubleshooting

Common Issues

Issue: Installation fails Solution: Check the Python version and ensure pip is up to date.

Configuration

Configuration

Basic Configuration

Starting the Server

bash
python -m opensearch_mcp_server

Environment Variables

Set the following environment variables as needed:
bash
export MCP_SERVER_PORT=3000

Security Settings

Manage API keys and credentials securely.
Set access restrictions to the server.

Examples

Examples

Basic Usage

Starting the Server

bash
python -m opensearch_mcp_server

Calling a Tool

python
import requests

response = requests.post('http://localhost:3000/mcp/call', json={
    'tool': 'SearchIndexTool',
    'parameters': {'query': 'example query'}
})
print(response.json())

Use Cases

Utilizing AI assistants to search indices in an OpenSearch cluster.
Using tools to retrieve mapping information for a specific index.
Employing ClusterHealthTool to perform health checks on the cluster.
Searching indices based on specific conditions for data analysis.
Creating scripts to perform operations on multiple indices in batch processing.

Additional Resources