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.
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
Option 2: Using Project-specific Configuration (Recommended)
Create a .cursor/mcp.json file in your project root:
Create the .cursor directory in your project root:
Create a mcp.json file with the following content:
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:
Open Cursor Settings > Features > MCP
Check that "Milvus" appears in the list of MCP servers
Verify that the tools are listed (e.g., milvus_list_collections, milvus_vector_search, etc.)
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":
Verify your Milvus instance is running: docker ps (if using Docker)
Check the URI is correct in your configuration
Ensure there are no firewall rules blocking the connection
Try using 127.0.0.1 instead of localhost in the URI
Authentication Issues
If you see authentication errors:
Verify your MILVUS_TOKEN is correct
Check if your Milvus instance requires authentication
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:
Restart the application
Check the server logs for any errors
Verify the MCP server is running correctly
Press the refresh button in the MCP settings (for Cursor)
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.
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
Option 2: Using Project-specific Configuration (Recommended)
Create a .cursor/mcp.json file in your project root:
Create the .cursor directory in your project root:
Create a mcp.json file with the following content:
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:
Open Cursor Settings > Features > MCP
Check that "Milvus" appears in the list of MCP servers
Verify that the tools are listed (e.g., milvus_list_collections, milvus_vector_search, etc.)
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":
Verify your Milvus instance is running: docker ps (if using Docker)
Check the URI is correct in your configuration
Ensure there are no firewall rules blocking the connection
Try using 127.0.0.1 instead of localhost in the URI
Authentication Issues
If you see authentication errors:
Verify your MILVUS_TOKEN is correct
Check if your Milvus instance requires authentication
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:
Restart the application
Check the server logs for any errors
Verify the MCP server is running correctly
Press the refresh button in the MCP settings (for Cursor)