
Azure AI Search MCP Server
Model Context Protocol Servers for Azure AI Search
What is Azure AI Search MCP Server?
Azure AI Search MCP Server is a Model Context Protocol (MCP) server that integrates with Azure AI Search, allowing Claude Desktop to query search indexes using keyword, vector, or hybrid methods.
How to use Azure AI Search MCP Server?
To use the server, set up your project directory, create a .env
file with your Azure Search credentials, set up a virtual environment, install dependencies, and configure Claude Desktop to recognize the MCP server.
Key features of Azure AI Search MCP Server?
- Seamless integration with Claude Desktop and Azure AI Search.
- Supports multiple search methods: keyword, vector, and hybrid searches.
- Customizable for additional tools and search logic modifications.
Use cases of Azure AI Search MCP Server?
- Searching for specific information in Azure Search indexes.
- Utilizing semantic similarity for more relevant search results.
- Combining different search methods for enhanced query capabilities.
FAQ from Azure AI Search MCP Server?
- What programming language is used?
The server is implemented in Python, requiring version 3.10 or higher.
- What are the system requirements?
You need Azure AI Search Service configured with an index, Claude Desktop, and either Windows or macOS.
- How can I troubleshoot issues?
Check Claude Desktop logs, verify file paths and environment variables, and test running the server directly.
Azure AI Search MCP Server
A Model Context Protocol (MCP) server that integrates with Azure AI Search, enabling Claude Desktop to query your search indexes using keyword, vector, or hybrid methods.
Overview
This project provides an MCP server implementation that connects Claude Desktop with Azure AI Search. The server supports three search methods:
- Keyword Search: Exact lexical matches.
- Vector Search: Semantic similarity using vector embeddings.
- Hybrid Search: A combination of keyword and vector searches.
Features
- Seamless Integration: Connect Claude Desktop with Azure AI Search.
- Multiple Search Methods: Supports keyword, vector, and hybrid searches.
- Customizable: Easy to extend with additional tools or modify search logic.
Requirements
- Python: Version 3.10 or higher
- Azure AI Search Service: Configured with an index containing vectorized text data
- Claude Desktop: Latest version
- Operating System: Windows or macOS (instructions provided for Windows, but adaptable)
Quick Start Guide
1. Installation
-
Set Up Project Directory:
mkdir mcp-server-azure-ai-search cd mcp-server-azure-ai-search
-
Create a
.env
File: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
2. Set Up Virtual Environment
-
Create and Activate the Virtual Environment:
uv venv .venv\Scripts\activate
-
Install Dependencies:
uv pip install "mcp[cli]" azure-search-documents==11.5.2 azure-identity python-dotenv
3. Server Script
Create a file named azure_search_server.py
. This script:
- Loads configuration from the
.env
file. - Initializes the Azure AI Search client.
- Defines search functions for keyword, vector, and hybrid searches.
- Registers these functions as MCP tools for Claude Desktop.
For detailed implementation, refer to the inline comments within the script.
Configuring Claude Desktop
-
Open Claude Desktop.
-
Navigate to Settings > Developer > Edit Config.
-
Add the following configuration (update paths and credentials):
{ "mcpServers": { "azure-search": { "command": "C:path\tomcp-server-azure-ai-search.venvScriptspython.exe", "args": ["C:path\tomcp-server-azure-ai-searchazure_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" } } } }
Note: Replace
C:\path\to\mcp-server-azure-ai-search
with your actual project path.
Testing the Server
- Restart Claude Desktop to load the new configuration.
- Look for the MCP tools icon (hammer icon) in the bottom-right of the input field.
- Try queries such as:
- "Can you search for information about AI in my Azure Search index?"
- "Search for vector databases using the vector search tool."
- "Find information about neural networks using hybrid search."
Troubleshooting
- Server Not Appearing:
- Check Claude Desktop logs (typically found at
%APPDATA%\Claude\logs\mcp*.log
on Windows). - Verify file paths and environment variables in the configuration.
- Test running the server directly via
python azure_search_server.py
. oruv run python azure_search_server.py
- Check Claude Desktop logs (typically found at
Customizing Your Server
- Modify Search Logic: Adjust the search methods in the
AzureSearchClient
class. - Add New Tools: Use the
@mcp.tool()
decorator to integrate additional search functionalities. - Customize Output: Edit the markdown formatting function for search results.
License
This project is licensed under the MIT License.