Elasticsearch MCP Server for Cloudflare Workers
Test Elasticsearch tools directly in your browser. Select a tool and provide inputs to see the results.
Create a free account to test Elasticsearch tools interactively. No credit card required.
elasticsearch_get_index_templateGet index templates. Args: - name: Optional template name or pattern Returns: Index template definitions.
elasticsearch_get_aliasesGet index aliases. Args: - index: Optional index name(s) to get aliases for - alias: Optional alias name(s) to get - format: Response format Returns: Alias information for matching indices.
elasticsearch_update_aliasesAtomically add, remove, or update index aliases. Args: - actions: Array of alias actions to perform atomically Each action is one of: - { "add": { "index": "...", "alias": "...", "filter": {...}, "is_write_index": true/false } } - { "remove": { "index": "...", "alias": "..." } } - { "remove_index": { "index": "..." } } Example: [ { "add": { "index": "logs-2024-01", "alias": "logs-current" } }, { "remove": { "index": "logs-2023-12", "alias": "logs-current" } } ] Returns: Acknowledgment of the update.
elasticsearch_add_aliasAdd an alias to an index. Args: - index: Index name(s) to add alias to - alias: Alias name - filter: Optional filter query for the alias - routing: Optional routing value - is_write_index: Whether this is the write index for the alias Returns: Acknowledgment.
elasticsearch_remove_aliasRemove an alias from an index. Args: - index: Index name(s) - alias: Alias name to remove Returns: Acknowledgment.
elasticsearch_alias_existsCheck if an alias exists for an index. Args: - index: Index name - alias: Alias name Returns: Boolean indicating whether the alias exists.
elasticsearch_cat_indicesList all indices with their health, status, document count, and size. Args: - index: Optional index name or pattern to filter - health: Filter by health status ('green', 'yellow', 'red') - format: Response format ('json' or 'markdown') Returns: List of indices with details.
elasticsearch_cat_nodesList all nodes in the cluster with resource usage. Returns: List of nodes with IP, heap, RAM, CPU, load, and role information.
elasticsearch_cat_shardsList all shards with their state and node assignment. Args: - index: Optional index name to filter - format: Response format Returns: List of shards with index, shard number, type, state, docs, and node.
elasticsearch_cat_aliasesList all aliases. Args: - alias: Optional alias name or pattern to filter - format: Response format Returns: List of aliases with their target indices and configuration.
elasticsearch_cat_healthGet cluster health in a compact format. Returns: Cluster health status with node and shard counts.
elasticsearch_cat_countGet document count for indices. Args: - index: Optional index name to count documents for Returns: Document count.
elasticsearch_mgetGet multiple documents by ID from Elasticsearch. Args: - docs: Array of document identifiers with _index and _id - index: Default index (optional, can be specified per doc) Returns: Array of documents with their sources.
elasticsearch_cluster_healthGet the health status of the Elasticsearch cluster. Args: - index: Optional index(es) to limit health check to - level: Detail level ('cluster', 'indices', or 'shards') - wait_for_status: Wait until cluster reaches this status ('green', 'yellow', 'red') - timeout: How long to wait for the status (e.g., "30s") - format: Response format ('json' or 'markdown') Returns: Cluster health information including status, nodes, and shards.
elasticsearch_cluster_statsGet comprehensive cluster statistics. Returns information about: - Indices: count, docs, store size - Nodes: count by role, versions, OS, JVM - Memory and disk usage Returns: Cluster statistics.
elasticsearch_nodes_infoGet information about cluster nodes. Args: - node_id: Optional node ID(s) to get info for (all nodes if not specified) Returns: Node information including version, roles, OS, JVM, and plugins.
elasticsearch_nodes_statsGet statistics for cluster nodes. Args: - node_id: Optional node ID(s) to get stats for Returns: Node statistics including CPU, memory, disk, indexing, and search metrics.
elasticsearch_allocation_explainExplain why a shard is unassigned or allocated to its current node. Args: - index: Optional index name - shard: Optional shard number - primary: Optional boolean to specify primary/replica If no args provided, explains the first unassigned shard found. Returns: Explanation of shard allocation decisions.
elasticsearch_index_documentIndex (create or update) a document in Elasticsearch. Args: - index: The index name - document: The document to index (JSON object) - id: Optional document ID (auto-generated if not provided) - refresh: Whether to refresh the index after indexing ('true', 'false', or 'wait_for') - pipeline: Optional ingest pipeline to run Returns: Index response with document ID, version, and result.
elasticsearch_get_documentGet a document by ID from Elasticsearch. Args: - index: The index name - id: The document ID - source_includes: Optional array of fields to include - source_excludes: Optional array of fields to exclude Returns: The document with metadata and source.
elasticsearch_delete_documentDelete a document by ID from Elasticsearch. Args: - index: The index name - id: The document ID - refresh: Whether to refresh the index after deletion Returns: Delete response with result.
elasticsearch_update_documentUpdate a document in Elasticsearch using partial doc or script. Args: - index: The index name - id: The document ID - doc: Partial document to merge (use this OR script) - script: Script to run for update (use this OR doc) - upsert: Document to insert if it doesn't exist - refresh: Whether to refresh after update - retry_on_conflict: Number of retries on version conflict Returns: Update response with result.
elasticsearch_bulkExecute bulk operations (index, create, update, delete) in Elasticsearch. Args: - operations: Array of bulk operations (alternating action and optional source lines) Each operation is an object like: { "index": { "_index": "test", "_id": "1" } } Followed by source document for index/create/update operations - index: Default index for operations - refresh: Refresh policy - pipeline: Ingest pipeline Example operations: [ { "index": { "_index": "test", "_id": "1" } }, { "field1": "value1" }, { "delete": { "_index": "test", "_id": "2" } }, { "update": { "_index": "test", "_id": "3" } }, { "doc": { "field2": "value2" } } ] Returns: Bulk response with results for each operation.
elasticsearch_delete_by_queryDelete documents matching a query in Elasticsearch. Args: - index: The index name (or comma-separated list) - query: The query to match documents for deletion (Elasticsearch Query DSL) - refresh: Whether to refresh after deletion - conflicts: How to handle version conflicts ('abort' or 'proceed') - wait_for_completion: Whether to wait for the operation to complete Returns: Delete by query response with deletion stats.
elasticsearch_update_by_queryUpdate documents matching a query in Elasticsearch. Args: - index: The index name (or comma-separated list) - query: The query to match documents for update (Elasticsearch Query DSL) - script: Optional script to run for each matched document - refresh: Whether to refresh after update - conflicts: How to handle version conflicts ('abort' or 'proceed') - wait_for_completion: Whether to wait for the operation to complete Returns: Update by query response with update stats.
elasticsearch_reindexReindex documents from one index to another. Args: - source_index: Source index name(s) - dest_index: Destination index name - query: Optional query to filter source documents - pipeline: Optional ingest pipeline for destination - refresh: Whether to refresh destination after reindex - wait_for_completion: Whether to wait for the operation to complete Returns: Reindex response with stats.
elasticsearch_create_indexCreate a new index in Elasticsearch. Args: - index: The index name - settings: Optional index settings (shards, replicas, analysis, etc.) - mappings: Optional field mappings - aliases: Optional aliases to create with the index Returns: Create index response with acknowledgment.
elasticsearch_delete_indexDelete one or more indices. Args: - index: Index name(s) to delete (comma-separated or array) Returns: Delete response with acknowledgment.
elasticsearch_get_indexGet index information including settings, mappings, and aliases. Args: - index: Index name(s) to get Returns: Index information.
elasticsearch_index_existsCheck if an index exists. Args: - index: Index name to check Returns: Boolean indicating whether the index exists.
elasticsearch_get_mappingGet field mappings for one or more indices. Args: - index: Index name(s) Returns: Field mappings for each index.
elasticsearch_put_mappingUpdate field mappings for an index. Note: You can only add new fields or update specific field properties. You cannot change the type of an existing field. Args: - index: Index name(s) - mappings: Mapping definition with properties Returns: Acknowledgment.
elasticsearch_get_settingsGet settings for one or more indices. Args: - index: Index name(s) - include_defaults: Whether to include default settings Returns: Index settings.
elasticsearch_put_settingsUpdate settings for an index. Note: Some settings can only be changed on a closed index. Args: - index: Index name(s) - settings: Settings to update Returns: Acknowledgment.
elasticsearch_refreshRefresh an index to make recent changes searchable. Args: - index: Index name(s) to refresh (optional, all indices if not specified) Returns: Refresh result with shard info.
elasticsearch_flushFlush an index to persist changes to disk. Args: - index: Index name(s) to flush (optional, all indices if not specified) Returns: Flush result with shard info.
elasticsearch_forcemergeForce merge index segments to reduce their number. Useful for read-only indices to optimize storage and search performance. Args: - index: Index name(s) to merge (optional, all indices if not specified) - max_num_segments: Target number of segments per shard - only_expunge_deletes: Only expunge deleted documents Returns: Force merge result.
elasticsearch_close_indexClose an index to prevent read/write operations. Closed indices consume minimal resources but cannot be searched or written to. Args: - index: Index name(s) to close Returns: Close result with acknowledgment.
elasticsearch_open_indexOpen a closed index to allow read/write operations. Args: - index: Index name(s) to open Returns: Open result with acknowledgment.
elasticsearch_clone_indexClone an index to a new index. The source index must be set to read-only first. Args: - source: Source index name - target: Target index name - settings: Optional settings for the new index - aliases: Optional aliases for the new index Returns: Clone result with acknowledgment.
elasticsearch_shrink_indexShrink an index to a new index with fewer shards. The source index must be set to read-only and relocated to a single node. Args: - source: Source index name - target: Target index name - settings: Optional settings for the new index - aliases: Optional aliases for the new index Returns: Shrink result with acknowledgment.
elasticsearch_split_indexSplit an index to a new index with more shards. The source index must be set to read-only. Args: - source: Source index name - target: Target index name - settings: Optional settings for the new index (must include target shard count) - aliases: Optional aliases for the new index Returns: Split result with acknowledgment.
elasticsearch_searchSearch for documents in Elasticsearch. Args: - index: Index name(s) to search (comma-separated for multiple) - query: Elasticsearch Query DSL (e.g., { "match": { "title": "search" } }) - size: Number of results to return (default: 10) - from: Offset for pagination (default: 0) - sort: Sort specification (e.g., [{ "date": "desc" }, "_score"]) - source: Fields to include/exclude (_source filtering) - aggs: Aggregations to compute - highlight: Highlight configuration - track_total_hits: Whether to track total hits accurately - format: Response format ('json' or 'markdown') Returns: Search results with hits and optional aggregations.
elasticsearch_msearchExecute multiple searches in a single request. Args: - searches: Array of search definitions, each with optional index and body Example: [ { "index": "index1", "body": { "query": { "match_all": {} } } }, { "index": "index2", "body": { "query": { "term": { "status": "active" } } } } ] Returns: Array of search responses.
elasticsearch_countCount documents matching a query. Args: - index: Index name(s) to count - query: Optional query to filter documents Returns: Document count.
elasticsearch_explainExplain why a document matches (or doesn't match) a query. Args: - index: Index name - id: Document ID - query: Query to explain Returns: Explanation of the match.
elasticsearch_field_capsGet field capabilities across indices. Args: - index: Index name(s) to check - fields: Field names or patterns to check (e.g., ["*", "title", "date*"]) - include_unmapped: Include unmapped fields Returns: Field capabilities per field per index.
elasticsearch_search_scroll_startStart a scrolling search for large result sets. Args: - index: Index name(s) to search - query: Elasticsearch Query DSL - size: Number of results per scroll batch - scroll: How long to keep the scroll context alive (e.g., "1m", "5m") - sort: Sort specification Returns: First batch of results and a scroll_id for continuation.
elasticsearch_search_scroll_continueContinue a scrolling search. Args: - scroll_id: The scroll ID from the previous search - scroll: How long to keep the scroll context alive Returns: Next batch of results.
elasticsearch_search_scroll_clearClear one or more scroll contexts. Args: - scroll_ids: Scroll ID(s) to clear Returns: Clear result.
elasticsearch_pit_openOpen a point-in-time for consistent search results. Args: - index: Index name to create PIT for - keep_alive: How long to keep the PIT alive (e.g., "1m", "5m") Returns: PIT ID for use in subsequent searches.
elasticsearch_pit_closeClose a point-in-time. Args: - pit_id: The PIT ID to close Returns: Close result.
elasticsearch_put_index_templateCreate or update an index template. Args: - name: Template name - index_patterns: Array of index patterns this template applies to - template: Template settings, mappings, and aliases - composed_of: Optional component templates to compose - priority: Optional priority for conflicting patterns Returns: Acknowledgment.
elasticsearch_delete_index_templateDelete an index template. Args: - name: Template name to delete Returns: Acknowledgment.
elasticsearch_get_index_template{
"name": "example_name"
}elasticsearch_get_aliases{
"alias": "example_alias",
"index": "example_index",
"format": "example_format"
}elasticsearch_update_aliases{
"actions": true
}