MI
OfficialAI & ML

Milvus MCP Server for LLM Context Integration

Integrate LLMs with external data and tools using the MCP server to provide standardized, seamless context for AI apps, chat, and custom workflows.

Quick Install
npx -y @zilliztech/mcp-server-milvus

Overview

The Milvus MCP Server implements the Model Context Protocol (MCP) to expose Milvus vector database capabilities to LLM-based applications. It acts as a standardized bridge between large language models (or MCP-capable clients) and an external vector store, enabling apps to fetch, store, and query contextual data that augments model responses — e.g., documents, embeddings, tool outputs, or application state.

This server is lightweight and designed to run alongside your Milvus instance. It supports two communication modes (stdio and HTTP Server-Sent Events / SSE), making it easy to integrate with desktop clients (like Claude Desktop), code editors (Cursor), or any custom MCP client. The project source is available on GitHub: https://github.com/zilliztech/mcp-server-milvus.

Features

  • Exposes Milvus vector database operations via the MCP protocol
  • Two runtime modes:
    • stdio: single-client stdin/stdout integration (default)
    • SSE: multi-client HTTP Server-Sent Events endpoint
  • Easy to run without installation using the uv runner
  • Configurable via CLI flags and a .env file (env file takes precedence)
  • Works with MCP-aware apps: Claude Desktop, Cursor, or custom clients
  • Contains developer tooling support (MCP inspector / dev proxy)

Prerequisites

  • Python 3.10+
  • A running Milvus instance (local or remote)
  • Optional: uv runner (recommended for running the server without install)
  • Network access from the MCP server to the Milvus host/port

Installation / Configuration

Clone the repository and run the server directly; no package install required:

git clone https://github.com/zilliztech/mcp-server-milvus.git
cd mcp-server-milvus

Run in the default (stdio) mode:

uv run src/mcp_server_milvus/server.py --milvus-uri http://localhost:19530

Run in SSE mode (HTTP SSE endpoint):

uv run src/mcp_server_milvus/server.py --sse --milvus-uri http://localhost:19530 --port 8000

Notes:

  • The server reads environment variables from the .env file located in src/mcp_server_milvus/ if present; values there override CLI arguments.
  • Common CLI flags:
    • –milvus-uri — Milvus connection URI (e.g., http://localhost:19530)
    • –sse — enable SSE mode
    • –port — SSE server port (default: 8000)

      Debugging (MCP Inspector):

      mcp dev src/mcp_server_milvus/server.py
      

      This launches an MCP inspector and a small proxy suited for testing; the inspector is typically reachable at http://127.0.0.1:6274 with a proxy port shown in the output.

      Table: run modes at-a-glance

      ModeCommunicationWhen to useExample command
      stdiostdin/stdoutDesktop clients launched as subprocessuv run …
      SSEHTTP Server-Sent EventsWeb clients or multiple HTTP clientsuv run … –sse –port 8000

      Available Resources

      The Milvus MCP Server exposes standard vector-store operations to MCP clients. Typical capabilities include:

      • Collection management: list, create, drop collections
      • Data operations: upsert, delete vectors and metadata
      • Similarity search / query by embedding
      • Metadata filters and paging for search results

      Clients that implement MCP can invoke these operations through the protocol; the server maps MCP tool requests to Milvus API operations and returns standardized MCP responses.

      Repository and documentation:

      • GitHub: https://github.com/zilliztech/mcp-server-milvus

      Integration Examples

      Claude Desktop (SSE mode)

      1. Install Claude Desktop.
      2. Edit the configuration file (macOS path shown):
        • ~/Library/Application Support/Claude/claude_desktop_config.json
      3. Add an SSE MCP server entry:
      {
        "mcpServers": {
          "milvus-sse": {
            "url": "http://your_sse_host:8000/sse",
            "disabled": false,
            "autoApprove": []
          }
        }
      }
      

      Claude Desktop (stdio mode)

      • Configure the app to start the MCP server as a subprocess:
      {
        "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"
            ]
          }
        }
      }
      

      Cursor editor

      • Cursor supports both stdio and SSE MCP servers. Use the same patterns: point Cursor’s mcp.json either to the SSE URL (http://host:port/sse) or configure a subprocess running uv as shown above.

      Use Cases

      • Augment chatbots with company doc search: serve embeddings stored in Milvus so conversational agents can ground replies in up-to-date documents.
      • Code-aware IDE features: surface similar code snippets or API docs from a vector index inside an AI-enabled editor (Cursor).
      • Custom workflows: build MCP-aware orchestration that queries Milvus for context, then calls LLMs or external tools with precise, retrieval-augmented context.
      • Tooling integration: connect internal tools (ticketing, knowledge bases) by embedding records into Milvus and exposing them via MCP for on-demand retrieval.

      Security and Operational Notes

      • Ensure network access and authentication to your Milvus instance are configured according to your environment (firewalls, TLS).
      • Be cautious with autoApprove or any configuration that auto-grants an MCP server access—limit trusted hosts and clients.
      • Monitor resource usage on Milvus for large-scale vector storage and search workloads.

      For code, issues, and further documentation, see the project repository: https://github.com/zilliztech/mcp-server-milvus.

      Tags:ai-ml