Prerequisites
Ensure you have the following before proceeding:
- Python 3.10 or higher
- A running Milvus instance (local or remote)
uvinstalled (recommended for running the server)
Clone the Repository
git clone https://github.com/zilliztech/mcp-server-milvus.git
cd mcp-server-milvus
Running the Server
Option 1: Direct Command
Run the server directly using uv:
uv run src/mcp_server_milvus/server.py --milvus-uri http://localhost:19530
Option 2: Using .env File
-
Modify the
.envfile in thesrc/mcp_server_milvus/directory to set the environment variables. -
Run the server:
uv run src/mcp_server_milvus/server.py
Note: The .env file will have higher priority than command line arguments.
Usage with Supported Applications
Claude Desktop
-
Install Claude Desktop from https://claude.ai/download.
-
Open your Claude Desktop configuration file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- macOS:
-
Add the following configuration:
{ "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" ] } } } -
Restart Claude Desktop.
Cursor
Option 1: Using Cursor Settings UI
-
Go to Cursor Settings > Features > MCP.
-
Click on the
+ Add New MCP Serverbutton. -
Fill out 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
Note: Use
127.0.0.1instead oflocalhostto avoid potential DNS resolution issues. - Type: Select
Option 2: Using Project-specific Configuration (Recommended)
-
Create a
.cursordirectory in your project root:mkdir -p /path/to/your/project/.cursor -
Create a
mcp.jsonfile with the following content:{ "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" ] } } } -
Restart Cursor or reload the window.
-
Press the refresh button in the MCP settings to populate the tool list.
Environment Variables
MILVUS_URI: Milvus server URI (can be set instead of--milvus-uri)MILVUS_TOKEN: Optional authentication tokenMILVUS_DB: Database name (defaults to “default”)