by opensearch-project
A Model Context Protocol server that lets AI assistants interact with OpenSearch clusters to perform searches, retrieve mappings, manage shards, and execute a wide range of cluster‑level operations via stdio or streaming transports.
OpenSearch MCP Server enables AI models and agents to communicate with an OpenSearch cluster using a standardized protocol. It exposes common OpenSearch operations as tools that can be called programmatically, supporting both command‑line (stdio) and streaming (SSE/HTTP) interfaces.
pip install opensearch-mcp-server-py
python -m opensearch_mcp_server).ListIndexTool, SearchIndexTool, ClusterHealthTool—by providing the required parameters (e.g., opensearch_url, index, query).OPENSEARCH_DISABLED_CATEGORIES=core_tools).Q: Which transport should I use? A: Use stdio for local testing or scripting; choose SSE/Streamable HTTP for web‑based or remote clients.
Q: How can I enable the additional tools?
A: Set the OPENSEARCH_TOOL_FILTER environment variable or adjust the tool configuration in USER_GUIDE.md to include the desired categories.
Q: Do I need an AWS account? A: No, the server works with any OpenSearch cluster, but IAM authentication is available for AWS‑hosted deployments.
Q: How is security handled? A: Provide credentials via basic auth headers or configure IAM role‑based access; the server forwards these to the underlying OpenSearch endpoint.
Q: Can I customize the tool list?
A: Yes, tools are organized into categories; you can disable the whole core_tools category or create custom categories, respecting the naming rule that core_tools is reserved.
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:
Opensearch-mcp-server-py can be installed from PyPI via pip:
pip install opensearch-mcp-server-py
By default, only core tools are enabled to provide essential OpenSearch functionality:
Core tools are grouped under the core_tools category and can be disabled at once using OPENSEARCH_DISABLED_CATEGORIES=core_tools. Avoid creating custom categories with this name as they will override the built-in category.
The following tools are available but disabled by default. To enable them, see the Tool Filter section in the User Guide.
ListIndexTool
opensearch_url (optional): The OpenSearch cluster URL to connect toindex (optional): The name of the index to get detailed information for. If provided, returns detailed information about this specific index instead of listing all indices.IndexMappingTool
opensearch_url (optional): The OpenSearch cluster URL to connect toindex (required): The name of the index to retrieve mappings forSearchIndexTool
opensearch_url (optional): The OpenSearch cluster URL to connect toindex (required): The name of the index to search inquery (required): The search query in OpenSearch Query DSL formatGetShardsTool
opensearch_url (optional): The OpenSearch cluster URL to connect toindex (required): The name of the index to get shard information forClusterHealthTool
opensearch_url (optional): The OpenSearch cluster URL to connect toindex (optional): Limit health reporting to a specific indexCountTool
opensearch_url (optional): The OpenSearch cluster URL to connect toindex (optional): The name of the index to count documents inbody (optional): Query in JSON format to filter documentsExplainTool
opensearch_url (optional): The OpenSearch cluster URL to connect toindex (required): The name of the index to retrieve the document fromid (required): The document ID to explainbody (required): Query in JSON format to explain against the documentMsearchTool
opensearch_url (optional): The OpenSearch cluster URL to connect toindex (optional): Default index to search inbody (required): Multi-search request body in NDJSON formatGetClusterStateTool
opensearch_url (optional): The OpenSearch cluster URL to connect tometric (optional): Limit the information returned to the specified metrics. Options include: _all, blocks, metadata, nodes, routing_table, routing_nodes, master_node, versionindex (optional): Limit the information returned to the specified indicesGetSegmentsTool
opensearch_url (optional): The OpenSearch cluster URL to connect toindex (optional): Limit the information returned to the specified indices. If not provided, returns segments for all indicesCatNodesTool
opensearch_url (optional): The OpenSearch cluster URL to connect tometrics (optional): A comma-separated list of metrics to display. Available metrics include: id, name, ip, port, role, master, heap.percent, ram.percent, cpu, load_1m, load_5m, load_15m, disk.total, disk.used, disk.avail, disk.used_percentGetNodesTool
opensearch_url (optional): The OpenSearch cluster URL to connect tonode_id (optional): A comma-separated list of node IDs or names to limit the returned information. Supports node filters like _local, _master, master:true, data:false, etc. Defaults to _all.metric (optional): A comma-separated list of metric groups to include in the response. Options include: settings, os, process, jvm, thread_pool, transport, http, plugins, ingest, aggregations, indices. Defaults to all metrics.GetIndexInfoTool
opensearch_url (optional): The OpenSearch cluster URL to connect toindex (required): The name of the index to get detailed information for. Wildcards are supported.GetIndexStatsTool
opensearch_url (optional): The OpenSearch cluster URL to connect toindex (required): The name of the index to get statistics for. Wildcards are supported.metric (optional): Limit the information returned to the specified metrics. Options include: _all, completion, docs, fielddata, flush, get, indexing, merge, query_cache, refresh, request_cache, search, segments, store, warmer, bulkGetQueryInsightsTool
opensearch_url (optional): The OpenSearch cluster URL to connect toGetNodesHotThreadsTool
opensearch_url (optional): The OpenSearch cluster URL to connect toGetAllocationTool
opensearch_url (optional): The OpenSearch cluster URL to connect toGetLongRunningTasksTool
opensearch_url (optional): The OpenSearch cluster URL to connect tolimit (optional): The maximum number of tasks to return. Default is 10.More tools coming soon. Click here
For detailed usage instructions, configuration options, and examples, please see the User Guide.
Interested in contributing? Check out our:
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.
This project is licensed under the Apache v2.0 License.
Copyright 2020-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Please log in to share your review and rating for this MCP.
Explore related MCPs that share similar capabilities and solve comparable challenges
by exa-labs
Provides real-time web search capabilities to AI assistants via a Model Context Protocol server, enabling safe and controlled access to the Exa AI Search API.
by perplexityai
Enables Claude and other MCP‑compatible applications to perform real‑time web searches through the Perplexity (Sonar) API without leaving the MCP ecosystem.
by MicrosoftDocs
Provides semantic search and fetch capabilities for Microsoft official documentation, returning content in markdown format via a lightweight streamable HTTP transport for AI agents and development tools.
by elastic
Enables natural‑language interaction with Elasticsearch indices via the Model Context Protocol, exposing tools for listing indices, fetching mappings, performing searches, running ES|QL queries, and retrieving shard information.
by graphlit
Enables integration between MCP clients and the Graphlit platform, providing ingestion, extraction, retrieval, and RAG capabilities across a wide range of data sources and connectors.
by mamertofabian
Fast cross‑platform file searching leveraging the Everything SDK on Windows, Spotlight on macOS, and locate/plocate on Linux.
by cr7258
Provides Elasticsearch and OpenSearch interaction via Model Context Protocol, enabling document search, index management, cluster monitoring, and alias operations.
by kagisearch
Provides web search and video summarization capabilities through the Model Context Protocol, enabling AI assistants like Claude to perform queries and summarizations.
by liuyoshio
Provides natural‑language search and recommendation for Model Context Protocol servers, delivering rich metadata and real‑time updates.