Azure AI Search MCP server

Integrates with Azure AI Search to enable keyword, vector, and hybrid search capabilities for retrieving information from search indexes in readable markdown format.
Back to servers
Provider
Farzad
Release date
Mar 17, 2025
Language
Python
Stats
45 stars

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.

Requirements

  • Python 3.10 or higher
  • Claude Desktop (latest version)
  • Azure resources:
    • Azure AI Search service with vectorized text data index
    • For Agent Service: Azure AI Project with Azure AI Search and Bing connections
  • Windows or macOS operating system

Azure AI Agent Service Implementation (Recommended)

This implementation provides both document search and web search capabilities.

Setup Guide

  1. Create a project directory:

    mkdir mcp-server-azure-ai-search
    cd mcp-server-azure-ai-search
    
  2. 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
    
  3. 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
    

Azure AI Agent Service Configuration

Before using this implementation, complete these steps:

  1. Create an Azure AI Project in the Azure Portal

    • Save the project connection string and model deployment name
  2. Add an Azure AI Search connection to your project

    • Note the connection name and index name
  3. Add a Bing Web Search connection

    • Save the connection name
  4. Authenticate with Azure:

    az login
    

Configure Claude Desktop

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"
      }
    }
  }
}

Direct Azure AI Search Implementation

For a simpler setup that connects directly to Azure AI Search without Agent Service:

  1. 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. Install the required dependencies:

    uv pip install "mcp[cli]" azure-search-documents==11.5.2 azure-identity python-dotenv
    
  3. 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"
          }
        }
      }
    }
    

Using the Search Capabilities

After setting up the server:

  1. Restart Claude Desktop to load the new configuration
  2. Look for the MCP tools icon (hammer) in the bottom-right of the input field
  3. Try example queries:
    • "Search for information about AI in my Azure Search index"
    • "Search the web for the latest developments in LLMs"
    • "Find information about neural networks using hybrid search"

Troubleshooting

Server Not Appearing

  • Check Claude Desktop logs (located at %APPDATA%\Claude\logs\mcp*.log on Windows)
  • Verify file paths and environment variables in your configuration
  • Test running the server directly: python azure_ai_agent_service_server.py

Azure AI Agent Service Issues

  • Confirm that your Azure AI Project is correctly configured
  • Verify that all necessary connections exist and are properly configured
  • Check your Azure authentication status with az account show

How to add this MCP server to Cursor

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.

Adding an MCP server to Cursor globally

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"
            ]
        }
    }
}

Adding an MCP server to a project

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.

How to use the MCP server

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.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later