home / mcp / milvus mcp server
Model Context Protocol Servers for Milvus
Configuration
View docs{
"mcpServers": {
"zilliztech-mcp-server-milvus": {
"command": "uv",
"args": [
"run",
"src/mcp_server_milvus/server.py",
"--milvus-uri",
"http://localhost:19530"
],
"env": {
"MILVUS_DB": "default",
"MILVUS_URI": "http://localhost:19530",
"MILVUS_TOKEN": "YOUR_TOKEN"
}
}
}
}You use the MCP server to connect Milvus vector database capabilities to your LLM applications. It standardizes how you query, search, and manage collections and embeddings so your AI workflows can access vector data, run searches, and insert or update items from any MCP-compliant client.
You connect to the Milvus MCP server from your MCP-enabled client (such as Claude Desktop or Cursor) by configuring the MCP endpoint that the client should talk to. The server exposes tools for text search, vector similarity, hybrid searches, collection management, and data operations, so your LLM can perform end-to-end vector data workflows without custom integration code.
A typical usage pattern is to start the MCP server, point your client to either the stdio or SSE endpoint, and then issue commands from your LLM through the MCP interface. If you choose stdio, you communicate over standard input/output. If you choose SSE, your client connects via HTTP Server-Sent Events and can support multiple clients concurrently.
Prerequisites you need before starting the server: Python 3.10 or higher, a running Milvus instance (local or remote), and uv installed to run the MCP server.
Install and run the server directly using the following steps.
# Run in stdio mode (default) using Milvus at the given URI
uv run src/mcp_server_milvus/server.py --milvus-uri http://localhost:19530
# Alternatively, use environment variables (milvus URI can be set in a .env file)
uv run src/mcp_server_milvus/server.py
```
When using a .env file, note that its values take precedence over command line arguments.If you want to use SSE mode for HTTP-based clients, start the SSE service with a port and then connect your MCP client to the SSE URL.
uv run src/mcp_server_milvus/server.py --sse --milvus-uri http://localhost:19530 --port 8000
```
To debug in SSE mode after starting the service, you can run the MCP inspector for testing.Two running modes are supported: stdio (default) and SSE. The environment and command-line options determine how you start and connect to the server.
Environment variables you may configure include MILVUS_URI, MILVUS_TOKEN, and MILVUS_DB. MILVUS_URI can be used instead of --milvus-uri, MILVUS_TOKEN for authentication, and MILVUS_DB to specify the Milvus database name (defaults to default).
After you configure the client, verify that the MCP server appears in your client’s MCP settings and that the available Milvus-related tools are listed, such as text search, vector search, and collection management.
If you encounter issues, check that the MCP server is running, review logs for errors, ensure the Milvus URI is correct, and verify network access between the client and the server.
Using Claude Desktop in SSE mode, you would configure a milvus-sse server entry with the SSE URL (for example, http://your_sse_host:port/sse) and restart Claude Desktop to apply the changes.
Using Cursor, you can add a global MCP server entry that points to the stdio or SSE endpoint and then reload Cursor to apply the configuration.
Search for documents using full text search within a Milvus collection, returning specified fields and results up to a configurable limit.
Perform vector similarity search on a Milvus collection using a query vector, with options for limit, output fields, and filtering.
Combine text and vector search in a hybrid query to retrieve results based on both textual and vector criteria.
Execute text similarity search against a collection with an embedding-based approach, returning top results and optional filters (Milvus 2.6.0+).
Query a collection with filter expressions and return matching results with selected fields.
List all collections within the Milvus database.
Create a new collection with either a quick setup schema or a customized field schema, including index parameters.
Load a specific collection into memory to accelerate search and query operations.
Release a loaded collection from memory to free resources.
Retrieve detailed information about a specific collection, including its schema and metadata.
Insert data into a Milvus collection, mapping field names to value lists.
Delete entities from a collection based on a filter expression.