Elasticsearch Service#

The Elasticsearch service provides comprehensive log storage, search, and data indexing capabilities with 14 tools for managing Elasticsearch resources.

Overview#

The Elasticsearch service in Cloud Native MCP Server enables AI assistants to manage Elasticsearch indices, documents, and clusters efficiently. It provides tools for indexing, searching, and cluster management.

Key Capabilities#

### πŸ” Advanced Search Powerful full-text search and analytics capabilities.
### πŸ—‚οΈ Index Management Complete control over Elasticsearch indices and mappings.
### πŸ“¦ Document Management Handle document indexing, retrieval, and bulk operations.
### πŸ–₯️ Cluster Management Monitor and manage Elasticsearch cluster health and performance.

Available Tools (14)#

Index Management#

  • elasticsearch-get-indices: Get all indices
  • elasticsearch-create-index: Create a new index
  • elasticsearch-delete-index: Delete an index
  • elasticsearch-get-index-settings: Get index settings
  • elasticsearch-update-index-settings: Update index settings
  • elasticsearch-get-mappings: Get index mappings
  • elasticsearch-update-mappings: Update index mappings

Document Operations#

  • elasticsearch-index-document: Index a document
  • elasticsearch-get-document: Get a document
  • elasticsearch-search: Search documents
  • elasticsearch-delete-document: Delete a document

Cluster Management#

  • elasticsearch-get-cluster-info: Get cluster information
  • elasticsearch-get-cluster-health: Get cluster health
  • elasticsearch-get-nodes: Get cluster nodes

Quick Examples#

Index a document#

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
{
  "method": "tools/call",
  "params": {
    "name": "elasticsearch-index-document",
    "arguments": {
      "index": "my-app-logs",
      "id": "1",
      "document": {
        "timestamp": "2023-10-01T12:00:00Z",
        "level": "info",
        "message": "Application started successfully"
      }
    }
  }
}

Search documents#

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
{
  "method": "tools/call",
  "params": {
    "name": "elasticsearch-search",
    "arguments": {
      "index": "my-app-logs",
      "query": {
        "match": {
          "level": "error"
        }
      }
    }
  }
}

Get cluster health#

1
2
3
4
5
6
7
{
  "method": "tools/call",
  "params": {
    "name": "elasticsearch-get-cluster-health",
    "arguments": {}
  }
}

Best Practices#

  • Use appropriate index mappings for efficient searching
  • Regularly optimize indices for performance
  • Monitor cluster health and resource usage
  • Implement proper index lifecycle management
  • Use bulk operations for efficient data ingestion

Next Steps#