关于 Azure AI Search MCP Server
Azure AI Search MCP Server 是一个 MCP 服务,让 Claude Desktop 通过 Azure AI 服务搜索内容。它提供基于 Azure AI Agent Service 的版本(含文档搜索与 Bing 网页搜索),也提供直接连接 Azure AI Search 的版本。
主要功能
- 01基于 Azure AI Agent Service 的文档搜索
- 02Bing 网页搜索并附带来源引用
- 03直接连接 Azure AI Search
- 04关键词、向量与混合搜索三种方式
适用场景
- 01在 Claude Desktop 中检索 Azure AI Search 索引中的私有文档
- 02结合网页搜索查询最新信息并核对来源
- 03比较关键词、向量与混合搜索的结果
MCP 相关
该项目是一个 MCP 服务,向 Claude Desktop 等 MCP 客户端暴露搜索能力。
配置
本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。
我们还没有获取到这个服务的安装包或远程地址,请按项目 README 中的说明安装。
工具
本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。
详细介绍
Azure AI Agent Service + Azure AI Search MCP 服务
一个模型上下文协议(MCP)服务,可让 Claude Desktop 使用 Azure AI 服务搜索你的内容。你可以选择 Azure AI Agent Service(同时支持文档搜索和网络搜索),也可以选择直接集成 Azure AI Search。

概述
本项目提供两种 MCP 服务实现,用于将 Claude Desktop 与 Azure 搜索功能连接起来:
-
Azure AI Agent Service 实现(推荐) - 使用功能强大的 Azure AI Agent Service 提供以下功能:
- Azure AI Search 工具 - 使用 AI 增强的结果搜索已建立索引的文档
- Bing Web Grounding 工具 - 搜索网络并提供来源引用
-
直接集成 Azure AI Search - 通过以下三种方式直接连接到 Azure AI Search:
- 关键词搜索 - 精确匹配词项
- 向量搜索 - 使用嵌入进行语义相似度搜索
- 混合搜索 - 结合关键词搜索和向量搜索
功能
- AI 增强搜索 - Azure AI Agent Service 通过智能处理优化搜索结果
- 多种数据源 - 同时搜索私人文档和公共网络
- 来源引用 - 网络搜索结果包含原始来源的引用
- 灵活的实现方式 - 可选择 Azure AI Agent Service 或直接集成 Azure AI Search
- 与 Claude 无缝集成 - 可通过 Claude Desktop 界面使用所有搜索功能
- 可自定义 - 可轻松扩展或修改搜索行为
快速链接
要求
- Python: 版本 3.10 或更高
- Claude Desktop: 最新版本
- Azure 资源:
- 包含向量化文本数据的索引的 Azure AI Search 服务
- 对于 Agent Service:包含 Azure AI Search 和 Bing 连接的 Azure AI Project
- 操作系统: Windows 或 macOS(提供 Windows 说明,但可调整)
Azure AI Agent Service 实现(推荐)
设置指南
-
项目目录:
mkdir mcp-server-azure-ai-search cd mcp-server-azure-ai-search -
创建
.env文件:echo "PROJECT_CONNECTION_STRING=your-project-connection-string" > .env echo "MODEL_DEPLOYMENT_NAME=your-model-deployment-name" >> .env echo "AI_SEARCH_CONNECTION_NAME=your-search-connection-name" >> .env echo "BING_CONNECTION_NAME=your-bing-connection-name" >> .env echo "AI_SEARCH_INDEX_NAME=your-index-name" >> .env -
设置虚拟环境:
uv venv .venv\Scripts\activate uv pip install "mcp[cli]" azure-identity python-dotenv azure-ai-projects -
使用
azure_ai_agent_service_server.py脚本与 Azure AI Agent Service 集成。
Azure AI Agent Service 设置
使用此实现之前,你需要:
-
创建 Azure AI Project:
- 转到 Azure Portal 并创建一个新的 Azure AI Project
- 记下项目连接字符串和模型部署名称
-
创建 Azure AI Search 连接:
- 在 Azure AI Project 中,添加到 Azure AI Search 服务的连接
- 记下连接名称和索引名称
-
创建 Bing Web Search 连接:
- 在 Azure AI Project 中,添加到 Bing Search 服务的连接
- 记下连接名称
-
通过 Azure 进行身份验证:
az login
配置 Claude Desktop
{
"mcpServers": {
"azure-ai-agent": {
"command": "C:\\path\\to\\.venv\\Scripts\\python.exe",
"args": ["C:\\path\\to\\azure_ai_agent_service_server.py"],
"env": {
"PROJECT_CONNECTION_STRING": "your-project-connection-string",
"MODEL_DEPLOYMENT_NAME": "your-model-deployment-name",
"AI_SEARCH_CONNECTION_NAME": "your-search-connection-name",
"BING_CONNECTION_NAME": "your-bing-connection-name",
"AI_SEARCH_INDEX_NAME": "your-index-name"
}
}
}
}
注意: 将路径占位符替换为你的实际项目路径。
直接集成 Azure AI Search
如果你更倾向于直接集成 Azure AI Search,而不使用 Agent Service:
-
创建另一个
.env文件:echo "AZURE_SEARCH_SERVICE_ENDPOINT=https://your-service-name.search.windows.net" > .env echo "AZURE_SEARCH_INDEX_NAME=your-index-name" >> .env echo "AZURE_SEARCH_API_KEY=your-api-key" >> .env -
安装依赖项:
uv pip install "mcp[cli]" azure-search-documents==11.5.2 azure-identity python-dotenv -
使用
azure_search_server.py脚本直接集成 Azure AI Search。 -
配置 Claude Desktop:
{ "mcpServers": { "azure-search": { "command": "C:\\path\\to\\.venv\\Scripts\\python.exe", "args": ["C:\\path\\to\\azure_search_server.py"], "env": { "AZURE_SEARCH_SERVICE_ENDPOINT": "https://your-service-name.search.windows.net", "AZURE_SEARCH_INDEX_NAME": "your-index-name", "AZURE_SEARCH_API_KEY": "your-api-key" } } } }
测试服务
- 重启 Claude Desktop以加载新配置
- 在输入框右下角查找 MCP 工具图标(锤子图标)
- 尝试以下查询:
- “在我的 Azure Search 索引中搜索有关 AI 的信息”
- “在网络上搜索 LLM 的最新进展”
- “使用混合搜索查找有关神经网络的信息”
故障排除
-
服务未显示:
- 检查 Claude Desktop 日志(在 Windows 上,位于
%APPDATA%\Claude\logs\mcp*.log) - 检查配置中的文件路径和环境变量
- 直接尝试运行服务:
python azure_ai_agent_service_server.py或uv run python azure_ai_agent_service_server.py
- 检查 Claude Desktop 日志(在 Windows 上,位于
-
Azure AI Agent Service 问题:
- 确保已正确配置 Azure AI Project
- 确认存在连接且配置正确
- 检查 Azure 身份验证状态
自定义服务
- 修改工具指令: 调整提供给各 Agent 的指令,以更改其处理查询的方式
- 添加新工具: 使用
@mcp.tool()装饰器集成其他工具 - 自定义响应格式: 编辑响应的格式以及返回到 Claude Desktop 的方式
- 调整 Web 搜索参数: 修改 Web 搜索工具,使其聚焦于特定域名
许可证
本项目采用 MIT License 许可。
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。