rag-mcp-server
Generates embeddings for queries using Azure OpenAI, enabling hybrid vector and keyword search over an Azure AI Search index.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@rag-mcp-serversearch for 'MCP server architecture'"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
rag-mcp-server
An MCP (Model Context Protocol) server that exposes Azure AI Search as a tool. Connect it to any MCP-compatible client (Claude Desktop, MCP Inspector, etc.) to give it hybrid vector + keyword search over your own document index.
What it does
Exposes a single MCP tool:
search_documents(query: str, top_k: int = 5) -> strGenerates an embedding for the query using Azure OpenAI, runs a hybrid search against Azure AI Search, and returns the top matching document chunks with source and metadata.
Related MCP server: RAG In A Box MCP Server
Prerequisites
Python 3.11+
An Azure AI Search index with a
content_vectorfieldAn Azure OpenAI embedding deployment (e.g.
text-embedding-3-small)
Quick Start
Run locally with Python
# 1. Clone and enter the directory
git clone <repo-url>
cd rag-mcp
# 2. Create a virtual environment and install dependencies
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
# 3. Configure credentials
cp .env.example .env
# Edit .env and fill in your Azure endpoints and API keys
# 4. Start the server
python server.pyServer listens at http://localhost:8001/mcp.
Run with Docker
cp .env.example .env
# Edit .env and fill in your Azure endpoints and API keys
docker compose up --buildEnvironment Variables
Copy .env.example to .env and fill in the values:
Variable | Description |
| Azure OpenAI resource endpoint |
| API key for the embedding deployment |
| Embedding model deployment name |
| Azure AI Search service endpoint |
| Azure AI Search admin or query key |
| Name of the search index to query |
Testing with MCP Inspector
MCP Inspector is an interactive UI for calling MCP tools manually.
# Terminal 1 — start the server
python server.py
# Terminal 2 — open the inspector
npx @modelcontextprotocol/inspectorOpen the URL printed by the inspector (e.g. http://localhost:5173), set transport to Streamable HTTP, enter http://localhost:8001/mcp, and click Connect. Navigate to the Tools tab to call search_documents.
Connect to Claude Desktop
Add the following to your claude_desktop_config.json:
{
"mcpServers": {
"rag-mcp": {
"type": "streamable-http",
"url": "http://localhost:8001/mcp"
}
}
}Run the Automated Test
With the server running, execute the MCP client test:
python test.pyPasses three assertions: tool is registered, no server-side error, and results contain formatted document chunks.
Deploy to Azure Container Apps
See deploy.ps1 for a full Azure CLI deployment script. Fill in your resource group at the top of the file, then run:
.\deploy.ps1The script builds and pushes the Docker image to ACR, creates a Container Apps environment, and deploys the server with a public HTTPS endpoint.
This server cannot be deployed
Maintenance
Related MCP Connectors
Agent-driven search: build, import, tune, search, and score result quality — all over MCP.
Cloud or self-hosted knowledge for AI agents: hybrid search, reranking, GraphRAG, scoped MCP tools.
Live AI-native web search with citations. One tool for every MCP client. Flat per-request pricing.
Multi-engine search for AI agents. Trust scoring, local corpus, MCP-native. Self-hostable, BYOK.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceExposes Elasticsearch semantic search capabilities as MCP tools, enabling ELSER, kNN, and hybrid search with automatic index setup.MIT
- FlicenseNot gradedqualityBmaintenanceEnables any MCP-compatible AI assistant to search, filter, and retrieve information from a local document collection using a hybrid search pipeline with vector, BM25, reranking, and LLM enrichment.4-
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to search, query, and manage Azure AI Search indexes using full-text, semantic, and vector search, alongside index and document operations.MIT
- AlicenseNot gradedqualityBmaintenanceEnables hybrid document search (BM25 and dense) over a configurable corpus via MCP tools, returning passages and sources for AI agents to cite in answers.MIT