mcp-server-milvus Project Detailed Introduction
Project Overview
mcp-server-milvus is an open-source project developed by Zilliz Tech that provides a Model Context Protocol (MCP) server implementation for the Milvus vector database. This project enables LLM applications to seamlessly integrate and access the functionality of the Milvus vector database through a standardized protocol.
Core Features
Supported Operation Tools
The MCP server provides the following core tools:
-
milvus_text_search: Searches documents using full-text search functionality.- Parameters: collection_name, query_text, limit, output_fields, drop_ratio
-
milvus_vector_search: Performs vector similarity search on a collection.- Parameters: collection_name, vector, vector_field, limit, output_fields, metric_type
-
milvus_query: Queries a collection using a filter expression.- Parameters: collection_name, filter_expr, output_fields, limit
-
milvus_list_collections: Lists all collections in the database. -
milvus_create_collection: Creates a new collection with a specified schema.- Parameters: collection_name, collection_schema, index_params
-
milvus_load_collection: Loads a collection into memory for searching and querying.- Parameters: collection_name, replica_number
-
milvus_release_collection: Releases a collection from memory.- Parameters: collection_name
-
milvus_insert_data: Inserts data into a collection.- Parameters: collection_name, data
-
milvus_delete_entities: Deletes entities from a collection based on a filter expression.- Parameters: collection_name, filter_expr
System Requirements
- Python 3.10 or higher
- Running Milvus instance (local or remote)
- uv tool (recommended for running the server)
Installation and Configuration
Clone the Project
git clone https://github.com/zilliztech/mcp-server-milvus.git
cd mcp-server-milvus
Run the Server Directly
The recommended way is to use uv to run the server directly without installation:
uv run src/mcp_server_milvus/server.py --milvus-uri http://localhost:19530
Or by setting environment variables in the .env file:
uv run src/mcp_server_milvus/server.py
Supported Client Applications
The MCP server can be used with various LLM applications that support the Model Context Protocol:
Claude Desktop Integration
- Install Claude Desktop
- Configure the
claude_desktop_config.jsonfile:
{
"mcpServers": {
"milvus": {
"command": "/PATH/TO/uv",
"args": [
"--directory",
"/path/to/mcp-server-milvus/src/mcp_server_milvus",
"run",
"server.py",
"--milvus-uri",
"http://localhost:19530"
]
}
}
}
Cursor Editor Integration
Cursor supports two configuration methods:
Method 1: Configure via GUI
- Go to Cursor Settings > Features > MCP
- Click the "+ Add New MCP Server" button
- Fill in the form:
- Type: Select
stdio - Name:
milvus - Command:
/PATH/TO/uv --directory /path/to/mcp-server-milvus/src/mcp_server_milvus run server.py --milvus-uri http://127.0.0.1:19530
- Type: Select
Method 2: Configuration File
Create a .cursor/mcp.json file:
{
"mcpServers": {
"milvus": {
"command": "/PATH/TO/uv",
"args": [
"--directory",
"/path/to/mcp-server-milvus/src/mcp_server_milvus",
"run",
"server.py",
"--milvus-uri",
"http://127.0.0.1:19530"
]
}
}
}
Environment Variable Configuration
MILVUS_URI: Milvus server URI (alternative to the --milvus-uri parameter)MILVUS_TOKEN: Optional authentication tokenMILVUS_DB: Database name (defaults to "default")
Usage Examples
Usage in Claude Desktop
Users can interact with the Milvus database through natural language:
Query the list of collections:
What are the collections I have in my Milvus DB?
Search for documents:
Find documents in my text_collection that mention "machine learning"
Usage in Cursor
Create a new collection:
Create a new collection called 'articles' in Milvus with fields for title (string), content (string), and a vector field (128 dimensions)
Troubleshooting
Connection Issues
- Verify that the Milvus instance is running
- Check that the URI configuration is correct
- Ensure that firewall rules do not block the connection
- Try using
127.0.0.1instead oflocalhost
Authentication Issues
- Verify that the
MILVUS_TOKENis correct - Check if the Milvus instance requires authentication
- Ensure you have the correct permissions to perform the operation
Technical Architecture
The project is developed based on Python and adopts a modern development toolchain:
- Uses uv as a package management and running tool
- Follows the MCP standard protocol specification
- Provides complete Milvus database operation encapsulation
- Supports multiple AI application clients
Application Scenarios
This project is mainly suitable for the following scenarios:
- AI-driven code editor enhancement
- Context enhancement for chat interfaces
- Custom AI workflow construction
- Integration of vector databases and LLMs
- Semantic search and RAG (Retrieval Augmented Generation) applications
Through mcp-server-milvus, developers can easily integrate the powerful features of the Milvus vector database into various AI applications, providing users with a more intelligent and accurate interactive experience.