About OpenSearch MCP Server
OpenSearch MCP Server lets users interact with an OpenSearch cluster through natural language from MCP clients. Its tools cover cluster status, indices, documents, and query DSL searches.
Key features
- 01Inspect cluster health and statistics
- 02List and manage indices
- 03Bulk-write document operations
- 04Retrieve documents
- 05Search with query DSL
Use cases
- 01Check cluster health and statistics
- 02Create or remove an index
- 03Bulk-write documents to an index
- 04Search indexed documents with query DSL
MCP support
It exposes tools for interacting with an OpenSearch cluster to MCP clients, including cluster, index, document, and search operations.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
uvx 'git+https://github.com/loupipalien/opensearch-mcp-server'OPENSEARCH_HOSTSOPENSEARCH_USERNAMEOPENSEARCH_PASSWORDSecretLocal servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMEOpenSearch MCP Server
Interact with your OpenSearch cluster through natural language directly from any MCP Client (like Cursor, Cline) using the Model Context Protocol (MCP).
This server provides the abilities of analyzing cluster health status, bulking documents to indices, getting index mappings, searching documents and so on through a set of tools.
Tools
Cluster
opensearch_cluster_health: get cluster health statusopensearch_cluster_stats: get cluster statistics information
Document
opensearch_bulk: write multiple document operations with bulkopensearch_get_document: get a document from the index
Index
opensearch_list_indices: list indices in the clusteropensearch_create_index: create index with specified configsopensearch_delete_index: delete index by index nameopensearch_get_index: get information about index
Search
opensearch_search: query index using the provided query dsl
Prerequisites
Before using this mcp server, you need to install the following components:
- python 3.10+ or higher
- uv installed
Usage
Select any of the following config to add to your mcp settings file. Then set your opensearch cluster hosts (separated by commas when multiple hosts), username and password to mcp server config.
Run using remote repo
{
"mcpServers": {
"opensearch-mcp-server": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/loupipalien/opensearch-mcp-server",
"opensearch-mcp-server"
],
"env": {
"OPENSEARCH_HOSTS": "your_opensearch_cluster_hosts",
"OPENSEARCH_USERNAME": "your_opensearch_cluster_username",
"OPENSEARCH_PASSWORD": "your_opensearch_cluster_password"
}
}
}
}
Run using local repo
{
"mcpServers": {
"opensearch-mcp-server": {
"command": "uv",
"args": [
"--directory",
"path/to/repo/src/opensearch_mcp_server",
"run",
"server.py"
],
"env": {
"OPENSEARCH_HOSTS": "your_opensearch_cluster_hosts",
"OPENSEARCH_USERNAME": "your_opensearch_cluster_username",
"OPENSEARCH_PASSWORD": "your_opensearch_cluster_password"
}
}
}
}
Start OpenSearch Cluster
If you don't have an OpenSearch cluster, you can run the following command in your local repository root directory to start one. More details can be found in here.
It will create a 2-node cluster and a dashboards. The default username is admin and password is your_opensearch_cluster_password. You can access the cluster from https://localhost:9200 and access the dashboards from http://localhost:5601
export OPENSEARCH_INITIAL_ADMIN_PASSWORD=your_opensearch_cluster_password
docker-compose up -d
Stop the cluster and dashboards
docker-compose down -v
License
This project is licensed under the Apache v2.0 License.
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.