Skip to content

Open Elastic Search Usage Guide

Overview

This guide shows how to use the Open Elastic Search with different MCP clients and integration methods.

Tool Discovery

# Start interactive mode
mcp_platform interactive

# List available tools
mcpp> tools open-elastic-search
# Discover tools using CLI
mcp_platform tools open-elastic-search
from mcp_platform.client import MCPClient

async def discover_tools():
    client = MCPClient()
    tools = client.list_tools("open-elastic-search")
    for tool in tools:
        print(f"Tool: {tool['name']} - {tool['description']}")

Available Tools

list_indices

Description: List all indices.

Parameters: - No parameters required

get_index

Description: Returns information (mappings, settings, aliases) about one or more indices.

        Args:
            index: Name of the index

Parameters: - index (string) (required): No description

create_index

Description: Create a new index.

        Args:
            index: Name of the index
            body: Optional index configuration including mappings and settings

Parameters: - index (string) (required): No description - body (string) (optional): No description

delete_index

Description: Delete an index.

        Args:
            index: Name of the index

Parameters: - index (string) (required): No description

search_documents

Description: Search for documents.

        Args:
            index: Name of the index
            body: Search query

Parameters: - index (string) (required): No description - body (object) (required): No description

index_document

Description: Creates or updates a document in the index.

        Args:
            index: Name of the index
            document: Document data
            id: Optional document ID

Parameters: - index (string) (required): No description - document (object) (required): No description - id (string) (optional): No description

get_document

Description: Get a document by ID.

        Args:
            index: Name of the index
            id: Document ID

Parameters: - index (string) (required): No description - id (string) (required): No description

delete_document

Description: Delete a document by ID.

        Args:
            index: Name of the index
            id: Document ID

Parameters: - index (string) (required): No description - id (string) (required): No description

delete_by_query

Description: Deletes documents matching the provided query.

        Args:
            index: Name of the index
            body: Query to match documents for deletion

Parameters: - index (string) (required): No description - body (object) (required): No description

get_cluster_health

Description: Returns basic information about the health of the cluster.

Parameters: - No parameters required

get_cluster_stats

Description: Returns high-level overview of cluster statistics.

Parameters: - No parameters required

list_aliases

Description: List all aliases.

Parameters: - No parameters required

get_alias

Description: Get alias information for a specific index.

        Args:
            index: Name of the index

Parameters: - index (string) (required): No description

put_alias

Description: Create or update an alias for a specific index.

        Args:
            index: Name of the index
            name: Name of the alias
            body: Alias configuration

Parameters: - index (string) (required): No description - name (string) (required): No description - body (object) (required): No description

delete_alias

Description: Delete an alias for a specific index.

        Args:
            index: Name of the index
            name: Name of the alias

Parameters: - index (string) (required): No description - name (string) (required): No description

general_api_request

Description: Perform a general HTTP API request. Use this tool for any Elasticsearch/OpenSearch API that does not have a dedicated tool.

        Args:
            method: HTTP method (GET, POST, PUT, DELETE, etc.)
            path: API endpoint path
            params: Query parameters
            body: Request body

Parameters: - method (string) (required): No description - path (string) (required): No description - params (string) (optional): No description - body (string) (optional): No description

Usage Examples

# Start interactive mode
mcp_platform interactive

# Deploy the template (if not already deployed)
mcpp> deploy open-elastic-search

# List available tools after deployment
mcpp> tools open-elastic-search

Then call tools:

mcpp> call open-elastic-search list_indices
mcpp> call open-elastic-search get_index '{"index": "example_value"}'
mcpp> call open-elastic-search create_index '{"index": "example_value", "body": "example_value"}'
# Deploy the template
mcp_platform deploy open-elastic-search

# Check deployment status
mcp_platform status

# View logs
mcp_platform logs open-elastic-search

# Stop the template
mcp_platform stop open-elastic-search
import asyncio
from mcp_platform.client import MCPClient

async def use_open_elastic_search():
    client = MCPClient()

    # Start the server
    deployment = client.start_server("open-elastic-search", {})

    if deployment["success"]:
        deployment_id = deployment["deployment_id"]

        try:
            # Discover available tools
            tools = client.list_tools("open-elastic-search")
            print(f"Available tools: {[t['name'] for t in tools]}")

            # Call list_indices
            result = client.call_tool("open-elastic-search", "list_indices", {})
            print(f"list_indices result: {result}")

            # Call get_index
            result = client.call_tool("open-elastic-search", "get_index", {'index': 'example_value'})
            print(f"get_index result: {result}")

        finally:
            # Clean up
            client.stop_server(deployment_id)
    else:
        print("Failed to start server")

# Run the example
asyncio.run(use_open_elastic_search())

Integration Examples

Add this configuration to your Claude Desktop configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "open-elastic-search": {
      "command": "python",
      "args": ["-m", "mcp_platform", "connect", "open-elastic-search", "--stdio"],
      "env": {
        "LOG_LEVEL": "info"
      }
    }
  }
}

Install the MCP extension and add this to your VS Code settings (.vscode/settings.json):

{
  "mcp.servers": {
    "open-elastic-search": {
      "command": "python",
      "args": ["-m", "mcp_platform", "connect", "open-elastic-search", "--stdio"],
      "env": {
        "LOG_LEVEL": "info"
      }
    }
  }
}
# Get connection details for other integrations
mcp_platform connect open-elastic-search --llm claude
mcp_platform connect open-elastic-search --llm vscode

Configuration

For template-specific configuration options, see the main template documentation. Common configuration methods:

# Deploy with environment variables
mcp_platform deploy open-elastic-search --env KEY=VALUE
# Deploy with configuration
mcp_platform deploy open-elastic-search --config key=value

# Deploy with nested configuration
mcp_platform deploy open-elastic-search --config category__property=value
# Deploy with config file
mcp_platform deploy open-elastic-search --config-file config.json

Troubleshooting

Common Issues

  1. Template not found: Ensure the template name is correct

    mcp_platform list  # List available templates
    

  2. Connection issues: Check if the server is running

    mcp_platform status
    

  3. Tool discovery fails: Try refreshing the tool cache

    mcpp> tools open-elastic-search --refresh
    

Debug Mode

Enable debug logging for troubleshooting:

# Interactive CLI with debug
LOG_LEVEL=debug mcp_platform interactive
# Deploy with debug logging
mcp_platform deploy open-elastic-search --config log_level=debug

For more help, see the main documentation or open an issue in the repository.