OpenSearch MCP
An MCP server for OpenSearch, the community-driven, Apache 2.0 search and analytics suite.
What it does
Search through OpenSearch indices, manage documents, create/delete indexes, check cluster health, and monitor statistics. Perfect for AI agents that need to query search indexes.
Tools
check_health- Check cluster health statuslist_indices- List all indicesget_index- Get index detailscreate_index- Create a new indexdelete_index- Delete an indexsearch_index- Search documents in an indexsearch_raw- Search with raw OpenSearch query DSLget_documents- List documents in an indexget_document- Get a single document by IDindex_document- Add a document to an indexdelete_document- Delete a document by IDget_stats- Get instance-wide statisticsget_cluster_stats- Get cluster statisticsget_tasks- List async tasksget_mappings- Get index mappingslist_shards- List all shardslist_nodes- List all cluster nodes
Install
npx opensearch-mcp
Environment Variables
OPENSEARCH_URL- OpenSearch server URL (default:http://localhost:9200)OPENSEARCH_API_KEY- API key for authentication (preferred)OPENSEARCH_USERNAME/OPENSEARCH_PASSWORD- Basic auth credentials
Claude Desktop setup
{
"mcpServers": {
"opensearch": {
"command": "npx",
"args": ["-y", "opensearch-mcp"],
"env": {
"OPENSEARCH_URL": "http://localhost:9200",
"OPENSEARCH_API_KEY": "your-api-key"
}
}
}
}
Example usage
"Search my products index for 'wireless headphones'" "Check if my OpenSearch cluster is healthy" "Create a new index called 'blog-posts'" "How many documents are in my logs index?"
License
MIT