OpenSearch MCP Server
Published
At a glance
- Category
- Databases
- GitHub repository
- opensearch-project/opensearch-mcp-server-py
- Watch out for
- Write operations are allowed by default (OPENSEARCH_SETTINGS_ALLOW_WRITE is true), and GenericOpenSearchApiTool can call any endpoint, so disable writes or restrict categories for production clusters.
The OpenSearch project maintains opensearch-mcp-server-py in its own GitHub organization and publishes it on PyPI. It lets an agent query and inspect OpenSearch clusters: list indices, read mappings, run Query DSL searches, check cluster health and shards, and call other APIs.
It runs over stdio by default, and it has a streaming transport that covers SSE and Streamable HTTP. The older standalone SSE server has been folded into the streaming one and is marked for deprecation. Authentication options include basic auth, AWS IAM roles and profiles (with Amazon OpenSearch Serverless), header-based auth and mTLS.
Two things stand out. A zero-config mode lets you start the server with no environment variables and have the agent pass opensearch_url and credentials on each call, and a multi mode reads several clusters from a YAML file. Only the core tools are on by default; other groups are enabled by category.
How it connects
Your AI app
An assistant or agent that supports MCP
OpenSearch MCP Server
Runs as
- Python (uv / pip)
Gives the agent
- Core index and search tools
- Cluster health
- Any API
- Observability and log analysis
- Search relevance testing
- Agent memory
OpenSearch
The data or system the tools act on
What it can do
- Core index and search tools
- ListIndexTool, IndexMappingTool, SearchIndexTool, CountTool, ExplainTool and MsearchTool cover listing indices, reading mappings and running Query DSL searches, counts and multi-searches.
- Cluster health
- ClusterHealthTool and GetShardsTool are on by default. GetClusterStateTool, CatNodesTool, GetNodesHotThreadsTool, GetAllocationTool and GetLongRunningTasksTool can be switched on for deeper diagnostics.
- Any API
- GenericOpenSearchApiTool calls any OpenSearch endpoint with a custom path, method, query parameters and body, so you are not limited to the named tools.
- Observability and log analysis
- The observability category adds PPLQueryTool for PPL queries, and the skills category adds DataDistributionTool, LogPatternAnalysisTool and MetricChangeAnalysisTool.
- Search relevance testing
- The search_relevance category manages query sets, judgment lists and experiments, for example CreateQuerySetTool, CreateLLMJudgmentListTool and CreateExperimentTool.
- Agent memory
- Opt-in SaveMemoryTool, SearchMemoryTool and DeleteMemoryTool store an agent's notes in OpenSearch, and the agentic_memory category wraps the OpenSearch Agentic Memory API.
Setting it up
Install uv (pip install uv) and run the server with uvx, or install it with pip install opensearch-mcp-server-py. For Claude Desktop, edit claude_desktop_config.json from Settings, Developer and add a server with command uvx, args ["opensearch-mcp-server-py"], and env OPENSEARCH_URL, OPENSEARCH_USERNAME and OPENSEARCH_PASSWORD; set OPENSEARCH_NO_AUTH=true for a cluster without auth, or use AWS_REGION with AWS_IAM_ARN or AWS_PROFILE for Amazon OpenSearch Service. Leave out every variable and the server starts in zero-config mode, where the agent passes opensearch_url and credentials on each call. Enable extra tool groups with OPENSEARCH_ENABLED_CATEGORIES, for example observability or search_relevance. For a remote setup, start it with python -m mcp_server_opensearch --transport stream, and add --mode multi --config config.yml to serve several clusters.
Where each client keeps its MCP config file, and the JSON it expects (cheat sheet)
Where it helps
- Check cluster health and shard allocation when an on-call alert fires
- Inspect an index mapping and write a Query DSL search that returns the right documents
- Run PPL queries over log indices and look for unusual log patterns
- Set up a search relevance experiment comparing two search configurations
- Give a coding agent persistent memory stored in an Amazon OpenSearch Service domain
Limitations and things to watch
- Write operations are allowed by default (OPENSEARCH_SETTINGS_ALLOW_WRITE is true), and GenericOpenSearchApiTool can call any endpoint, so disable writes or restrict categories for production clusters.
- In zero-config mode a caller can point opensearch_url at any reachable host, including localhost and private addresses, unless you enable OPENSEARCH_SSRF_GUARD.
- SearchIndexTool returns at most 100 results per call by default unless you raise max_size_limit.
- The standalone SSE server is being folded into the streaming transport and will be deprecated.
- Memory Tools need Amazon OpenSearch Service 2.19+ or Serverless, and Agentic Memory needs OpenSearch 3.3.0+ with a memory container set up first.
Sources
Written from the project's own documentation, checked November 2026.
- github.com /opensearch-project/opensearch-mcp-server-py
- github.com /opensearch-project/opensearch-mcp-server-py/blob/main/USER_GUIDE.md
- github.com /opensearch-project/opensearch-mcp-server-py/blob/main/MEMORY.md
How we research: where our facts come from, how often we re-check them, and why no one can pay for a review or a verdict.