Milvus MCP Server Setup Guide

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

  1. Modify the .env file in the src/mcp_server_milvus/ directory to set the environment variables.

  2. 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

  1. Install Claude Desktop from https://claude.ai/download.

  2. Open your Claude Desktop configuration file:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  3. 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"
      ]
      }
      }
     }
     
  4. Restart Claude Desktop.

Cursor

Option 1: Using Cursor Settings UI

  1. Go to Cursor Settings > Features > MCP.

  2. Click on the + Add New MCP Server button.

  3. 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.1 instead of localhost to avoid potential DNS resolution issues.

Option 2: Using Project-specific Configuration (Recommended)

  1. Create a .cursor directory in your project root:

    mkdir -p /path/to/your/project/.cursor
     
  2. Create a mcp.json file 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"
      ]
      }
      }
     }
     
  3. Restart Cursor or reload the window.

  4. 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 token
  • MILVUS_DB: Database name (defaults to “default”)
Share this post: