基本能力
产品定位
OpenSearch MCP Server 是一个专门用于与 OpenSearch 交互的 MCP 服务器实现,提供文档搜索、索引分析和集群管理等功能。
核心功能
- 索引操作
list_indices
: 列出 OpenSearch 集群中的所有索引。get_mapping
: 获取特定索引的映射配置。-
get_settings
: 获取特定索引的设置配置。 -
文档操作
-
search_documents
: 使用 OpenSearch Query DSL 在索引中搜索文档。 -
集群操作
get_cluster_health
: 获取集群的健康状态。get_cluster_stats
: 获取集群的统计信息。
适用场景
- 数据分析
- 日志管理
- 全文搜索
- 集群监控
工具列表
uv
: 用于本地开发和运行 MCP 服务器。
常见问题解答
- 如何启动 OpenSearch 集群?
使用 Docker Compose 启动:docker-compose up -d
。 - 如何配置 Claude Desktop 使用 MCP 服务器?
修改claude_desktop_config.json
文件并重启 Claude Desktop。
使用教程
使用依赖
- 安装 Docker 和 Docker Compose。
安装教程
- 启动 OpenSearch 集群:
bash
docker-compose up -d - 克隆仓库并配置 Claude Desktop:
json
{
"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"
}
}
}
}
调试方式
- 重启 Claude Desktop 以加载新的 MCP 服务器。
- 使用自然语言命令与 OpenSearch 集群交互,例如:
- "List all indices in the cluster"
- "How old is the student Bob?"
- "Show me the cluster health status"