milvus vector database.com
milvus vector database.com logo

Milvus Vector Database

Integrates with Milvus vector database to enable vector search, full-text search, and hybrid queries for semantic search...

Created byApr 22, 2025

MCP Server for Milvus

The Model Context Protocol (MCP) is an open protocol that enables seamless integration between LLM applications and external data sources and tools. Whether you're building an AI-powered IDE, enhancing a chat interface, or creating custom AI workflows, MCP provides a standardized way to connect LLMs with the context they need.
This repository contains a MCP server that provides access to Milvus vector database functionality.
MCP with Milvus

Prerequisites

Before using this MCP server, ensure you have:
  • Python 3.10 or higher
  • A running Milvus instance (local or remote)
  • uv installed (recommended for running the server)

Usage

The recommended way to use this MCP server is to run it directly with uv without installation. This is how both Claude Desktop and Cursor are configured to use it in the examples below.
If you want to clone the repository:
Then you can run the server directly:
Alternatively you can change the .env file in the src/mcp_server_milvus/ directory to set the environment variables and run the server with the following command:

Important: the .env file will have higher priority than the command line arguments.

Supported Applications

This MCP server can be used with various LLM applications that support the Model Context Protocol:
  • Claude Desktop: Anthropic's desktop application for Claude
  • Cursor: AI-powered code editor with MCP support
  • Custom MCP clients: Any application implementing the MCP client specification

Usage with Claude Desktop

  1. Install Claude Desktop from https://claude.ai/download
  1. Open your Claude Desktop configuration:
  1. Add the following configuration:
  1. Restart Claude Desktop

Usage with Cursor

Cursor also supports MCP tools. You can add the Milvus MCP server to Cursor in two ways:

Option 1: Using Cursor Settings UI

  1. Go to Cursor Settings > Features > MCP
  1. Click on the + Add New MCP Server button
  1. Fill out the form:

Option 2: Using Project-specific Configuration (Recommended)

Create a .cursor/mcp.json file in your project root:
  1. Create the .cursor directory in your project root:
  1. Create a mcp.json file with the following content:
  1. Restart Cursor or reload the window
After adding the server, you may need to press the refresh button in the MCP settings to populate the tool list. The Agent will automatically use the Milvus tools when relevant to your queries.

Verifying the Integration

To verify that Cursor has successfully integrated with your Milvus MCP server:
  1. Open Cursor Settings > Features > MCP
  1. Check that "Milvus" appears in the list of MCP servers
  1. Verify that the tools are listed (e.g., milvus_list_collections, milvus_vector_search, etc.)
  1. If the server is enabled but shows an error, check the Troubleshooting section below

Available Tools

The server provides the following tools:

Search and Query Operations

  • milvus_text_search: Search for documents using full text search
  • milvus_vector_search: Perform vector similarity search on a collection
  • milvus_query: Query collection using filter expressions

Collection Management

  • milvus_list_collections: List all collections in the database
  • milvus_create_collection: Create a new collection with specified schema
  • milvus_load_collection: Load a collection into memory for search and query
  • milvus_release_collection: Release a collection from memory

Data Operations

  • milvus_insert_data: Insert data into a collection
  • milvus_delete_entities: Delete entities from a collection based on filter expression

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

Development

To run the server directly:

Examples

Using Claude Desktop

Example 1: Listing Collections

Claude will then use MCP to check this information on your Milvus DB.

Example 2: Searching for Documents

Claude will use the full-text search capabilities of Milvus to find relevant documents:

Using Cursor

Example: Creating a Collection

In Cursor, you can ask:
Cursor will use the MCP server to execute this operation:

Troubleshooting

Common Issues

Connection Errors

If you see errors like "Failed to connect to Milvus server":
  1. Verify your Milvus instance is running: docker ps (if using Docker)
  1. Check the URI is correct in your configuration
  1. Ensure there are no firewall rules blocking the connection
  1. Try using 127.0.0.1 instead of localhost in the URI

Authentication Issues

If you see authentication errors:
  1. Verify your MILVUS_TOKEN is correct
  1. Check if your Milvus instance requires authentication
  1. Ensure you have the correct permissions for the operations you're trying to perform

Tool Not Found

If the MCP tools don't appear in Claude Desktop or Cursor:
  1. Restart the application
  1. Check the server logs for any errors
  1. Verify the MCP server is running correctly
  1. Press the refresh button in the MCP settings (for Cursor)

Getting Help

If you continue to experience issues:
  1. Check the GitHub Issues for similar problems
  1. Join the Zilliz Community Discord for support
  1. File a new issue with detailed information about your problem

MCP Server for Milvus

The Model Context Protocol (MCP) is an open protocol that enables seamless integration between LLM applications and external data sources and tools. Whether you're building an AI-powered IDE, enhancing a chat interface, or creating custom AI workflows, MCP provides a standardized way to connect LLMs with the context they need.
This repository contains a MCP server that provides access to Milvus vector database functionality.
MCP with Milvus

Prerequisites

Before using this MCP server, ensure you have:
  • Python 3.10 or higher
  • A running Milvus instance (local or remote)
  • uv installed (recommended for running the server)

Usage

The recommended way to use this MCP server is to run it directly with uv without installation. This is how both Claude Desktop and Cursor are configured to use it in the examples below.
If you want to clone the repository:
Then you can run the server directly:
Alternatively you can change the .env file in the src/mcp_server_milvus/ directory to set the environment variables and run the server with the following command:

Important: the .env file will have higher priority than the command line arguments.

Supported Applications

This MCP server can be used with various LLM applications that support the Model Context Protocol:
  • Claude Desktop: Anthropic's desktop application for Claude
  • Cursor: AI-powered code editor with MCP support
  • Custom MCP clients: Any application implementing the MCP client specification

Usage with Claude Desktop

  1. Install Claude Desktop from https://claude.ai/download
  1. Open your Claude Desktop configuration:
  1. Add the following configuration:
  1. Restart Claude Desktop

Usage with Cursor

Cursor also supports MCP tools. You can add the Milvus MCP server to Cursor in two ways:

Option 1: Using Cursor Settings UI

  1. Go to Cursor Settings > Features > MCP
  1. Click on the + Add New MCP Server button
  1. Fill out the form:

Option 2: Using Project-specific Configuration (Recommended)

Create a .cursor/mcp.json file in your project root:
  1. Create the .cursor directory in your project root:
  1. Create a mcp.json file with the following content:
  1. Restart Cursor or reload the window
After adding the server, you may need to press the refresh button in the MCP settings to populate the tool list. The Agent will automatically use the Milvus tools when relevant to your queries.

Verifying the Integration

To verify that Cursor has successfully integrated with your Milvus MCP server:
  1. Open Cursor Settings > Features > MCP
  1. Check that "Milvus" appears in the list of MCP servers
  1. Verify that the tools are listed (e.g., milvus_list_collections, milvus_vector_search, etc.)
  1. If the server is enabled but shows an error, check the Troubleshooting section below

Available Tools

The server provides the following tools:

Search and Query Operations

  • milvus_text_search: Search for documents using full text search
  • milvus_vector_search: Perform vector similarity search on a collection
  • milvus_query: Query collection using filter expressions

Collection Management

  • milvus_list_collections: List all collections in the database
  • milvus_create_collection: Create a new collection with specified schema
  • milvus_load_collection: Load a collection into memory for search and query
  • milvus_release_collection: Release a collection from memory

Data Operations

  • milvus_insert_data: Insert data into a collection
  • milvus_delete_entities: Delete entities from a collection based on filter expression

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

Development

To run the server directly:

Examples

Using Claude Desktop

Example 1: Listing Collections

Claude will then use MCP to check this information on your Milvus DB.

Example 2: Searching for Documents

Claude will use the full-text search capabilities of Milvus to find relevant documents:

Using Cursor

Example: Creating a Collection

In Cursor, you can ask:
Cursor will use the MCP server to execute this operation:

Troubleshooting

Common Issues

Connection Errors

If you see errors like "Failed to connect to Milvus server":
  1. Verify your Milvus instance is running: docker ps (if using Docker)
  1. Check the URI is correct in your configuration
  1. Ensure there are no firewall rules blocking the connection
  1. Try using 127.0.0.1 instead of localhost in the URI

Authentication Issues

If you see authentication errors:
  1. Verify your MILVUS_TOKEN is correct
  1. Check if your Milvus instance requires authentication
  1. Ensure you have the correct permissions for the operations you're trying to perform

Tool Not Found

If the MCP tools don't appear in Claude Desktop or Cursor:
  1. Restart the application
  1. Check the server logs for any errors
  1. Verify the MCP server is running correctly
  1. Press the refresh button in the MCP settings (for Cursor)

Getting Help

If you continue to experience issues:
  1. Check the GitHub Issues for similar problems
  1. Join the Zilliz Community Discord for support
  1. File a new issue with detailed information about your problem