Home / MCP / OpenSearch MCP Server
Provides OpenSearch interactions for indexing, searching, and cluster management via MCP endpoints.
Configuration
View docs{
"mcpServers": {
"opensearch_mcp": {
"command": "uv",
"args": [
"--directory",
"path/to/src/opensearch_mcp_server",
"run",
"opensearch-mcp-server"
],
"env": {
"OPENSEARCH_HOST": "https://localhost:9200",
"OPENSEARCH_USERNAME": "opensearch",
"OPENSEARCH_PASSWORD": "test123",
"DASHBOARDS_HOST": "https://localhost:5601"
}
}
}
}You can interact with an OpenSearch cluster through a dedicated MCP server that exposes index, document, and cluster operations. This MCP server lets you search documents, inspect mappings and settings, and monitor cluster health and stats, all via a client that speaks the MCP protocol.
Connect with an MCP client to run OpenSearch operations. Start the OpenSearch cluster, then run the MCP server client integration to issue queries and manage the cluster.
Prerequisites you need before starting:
1) Start the OpenSearch cluster locally with a 3-node setup and Kibana using Docker Compose.
docker-compose up -d2) Verify you can access Kibana at the default URL.
3) Configure Claude Desktop to run the MCP server via UV by placing the following configuration in your Claude Desktop configuration file. Update the path to the OpenSearch MCP server source as needed.
{
"mcpServers": {
"opensearch": {
"command": "uv",
"args": [
"--directory",
"path/to/src/opensearch_mcp_server",
"run",
"opensearch-mcp-server"
],
"env": {
"OPENSEARCH_HOST": "https://localhost:9200",
"OPENSEARCH_USERNAME": "opensearch",
"OPENSEARCH_PASSWORD": "test123",
"DASHBOARDS_HOST": "https://localhost:5601"
}
}
}
}On macOS, place the Claude configuration at ~/Library/Application Support/Claude/claude_desktop_config.json. On Windows, place it at %APPDATA%/Claude/claude_desktop_config.json. Restart Claude Desktop after saving the changes to load the new MCP server.
With the OpenSearch MCP server you can perform these core operations:
Lists all indices present in the connected OpenSearch cluster.
Retrieves the index mapping for a specified index.
Fetches the settings for a specified index.
Executes a search against documents in an index using OpenSearch Query DSL.
Returns the health status of the OpenSearch cluster.
Provides statistical information about the OpenSearch cluster.