home / mcp / milvus mcp server

Milvus MCP Server

Model Context Protocol Servers for Milvus

Installation
Add the following to your MCP client configuration file.

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.

How to use

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.

How to install

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.

Configuration and running notes

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

Verifying the integration

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.

Examples

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.

Available tools

milvus_text_search

Search for documents using full text search within a Milvus collection, returning specified fields and results up to a configurable limit.

milvus_vector_search

Perform vector similarity search on a Milvus collection using a query vector, with options for limit, output fields, and filtering.

milvus_hybrid_search

Combine text and vector search in a hybrid query to retrieve results based on both textual and vector criteria.

milvus_text_similarity_search

Execute text similarity search against a collection with an embedding-based approach, returning top results and optional filters (Milvus 2.6.0+).

milvus_query

Query a collection with filter expressions and return matching results with selected fields.

milvus_list_collections

List all collections within the Milvus database.

milvus_create_collection

Create a new collection with either a quick setup schema or a customized field schema, including index parameters.

milvus_load_collection

Load a specific collection into memory to accelerate search and query operations.

milvus_release_collection

Release a loaded collection from memory to free resources.

milvus_get_collection_info

Retrieve detailed information about a specific collection, including its schema and metadata.

milvus_insert_data

Insert data into a Milvus collection, mapping field names to value lists.

milvus_delete_entities

Delete entities from a collection based on a filter expression.