DHI搜索MCP服务器
MCP(模型上下文协议)服务器,为AI助手提供Docker强化映像目录搜索功能。它允许LLM搜索安全、最小的容器映像,检查目录统计信息,并在DHI目录中列出可用的存储库。
特性
- search_dhi_catalog:使用模糊匹配搜索Docker强化映像匹配。
- get_dhi_统计:获取目录统计信息(按类型计数,例如IMAGE、HELM_CHART)。
- list_dhi_images:列出所有可用图像,可选择按类型筛选。
- list_image_tags:列出特定图像存储库的所有标签。
- get_compliance_info:根据特定映像存储库的标签检测其FIPS和STIG合规性。
- get_image_support_info:检索图像标签的生命周期信息(生命周期结束、支持终止)。
- 连通性测试:内置
--test标记以在没有MCP客户端的情况下验证凭据。
______________________________________________________________________
使用Docker和Claude桌面运行
1.塑造形象
docker build -t dhi-search-mcp .2.检查连接
docker run -i --rm -e DOCKER_USERNAME="your_username" -e DOCKER_PAT="your_pat" dhi-search-mcp --test如果测试成功,您应该看到类似于以下内容的输出:
Successfully connected to DHI Catalog!
Catalog contains 287 items.
- IMAGE: 259
- HELM_CHART: 283.克劳德桌面集成
将以下内容添加到您的Claude Desktop配置中(~/Library/Application\ Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"dhi-search-docker": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e", "DOCKER_USERNAME=your_username",
"-e", "DOCKER_PAT=your_pat",
"dhi-search-mcp"
]
}
}
}4.测试集成
示例输入提示
is kubectl available in the DHI catalog?
is there a helm chart for Grafana?
what are the tags for the postgres versions available in the DHI catalog?
Is there a FIPS compliant image for prometheus克劳德桌面版
______________________________________________________________________
使用Docker MCP网关运行
服务器可以与 通过包含 server.yaml 或者发布到Docker Hub的预构建目录。
选项1:使用已发布的目录
直接从Docker Hub中提取目录并将其添加到配置文件中:
docker mcp catalog pull demonstrationorg/search-dhi-catalog:latest
docker mcp profile server add
catalog://demonstrationorg/search-dhi-catalog:latest选项2:从server.yaml创建本地目录
docker mcp catalog create dhi-search-catalog --title "DHI Search" --server file://./server.yaml
docker mcp profile server add
--catalog dhi-search-catalog选项3:直接通过MCP网关运行
docker mcp gateway run --server file://./server.yaml