The Azure AI Agent Service + Azure AI Search MCP Server integrates with Claude Desktop to provide powerful search capabilities using Azure AI services. You can choose between Azure AI Agent Service (offering both document and web search) or direct Azure AI Search integration for searching your content.
This implementation provides both document search and web search capabilities.
Create a project directory:
mkdir mcp-server-azure-ai-search
cd mcp-server-azure-ai-search
Create a .env
file with your Azure configurations:
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
Set up a virtual environment and install dependencies:
uv venv
.venv\Scripts\activate
uv pip install "mcp[cli]" azure-identity python-dotenv azure-ai-projects
Before using this implementation, complete these steps:
Create an Azure AI Project in the Azure Portal
Add an Azure AI Search connection to your project
Add a Bing Web Search connection
Authenticate with Azure:
az login
Add the following to Claude Desktop's configuration:
{
"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"
}
}
}
}
For a simpler setup that connects directly to Azure AI Search without Agent Service:
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
Install the required dependencies:
uv pip install "mcp[cli]" azure-search-documents==11.5.2 azure-identity python-dotenv
Configure 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"
}
}
}
}
After setting up the server:
%APPDATA%\Claude\logs\mcp*.log
on Windows)python azure_ai_agent_service_server.py
az account show
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.