Milvus SDK Code Helper MCP Server

$uv run src/mcp_pymilvus_code_generate_helper/fastmcp_server.py
README.md

Retrieves relevant code snippets or documents to help generating pymilvus code.

milvus-sdk-code-helper

A Model Context Protocol server that retrieves relevant code snippets or documents to help generating pymilvus code.

Architecture

Example

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)

Quick Start with FastMCP

The recommended way to use this MCP server is through FastMCP, which provides better performance and easier configuration.

First Time Setup (with Document Update)

For the first time running the server, use the main FastMCP server which will automatically update the document database:

uv run src/mcp_pymilvus_code_generate_helper/fastmcp_server.py

This will:

  • Connect to your Milvus instance (default: http://localhost:19530)
  • Download and process the latest Milvus documentation
  • Start the MCP server with all three tools available
Custom Configuration
# Connect to remote Milvus server
uv run src/mcp_pymilvus_code_generate_helper/fastmcp_server.py --milvus_uri http://your-server:19530 --milvus_token your_token

# Change server host and port
uv run src/mcp_pymilvus_code_generate_helper/fastmcp_server.py --host 0.0.0.0 --port 8080

# Use different transport (default is http)
uv run src/mcp_pymilvus_code_generate_helper/fastmcp_server.py --transport sse

Subsequent Runs (Lightweight Mode)

After the initial setup, you can use the lightweight FastMCP server for faster startup:

uv run examples/fastmcp_server.py

This lightweight version:

  • Skips document synchronization
  • Starts immediately without background tasks
  • Assumes documents are already loaded in Milvus
Lightweight Server Options
# Custom configuration for lightweight server
uv run examples/fastmcp_server.py --milvus_uri http://your-server:19530 --host 0.0.0.0 --port 8080 --transport http

Key Features

  • Automatically fetches and indexes the latest Milvus documentation version (可以获取最新文档版本)
  • Weekly auto-refresh via a lightweight background scheduler

Usage with Cursor

  1. Go to Cursor > Settings > MCP
  2. Click on the + Add New Global MCP Server button
  3. Configure based on your chosen mode:
For HTTP Transport (Recommended)
{
  "mcpServers": {
    "milvus-sdk-code-helper": {
      "url": "http://localhost:8000/mcp"
    }
  }
}
For SSE Transport
{
  "mcpServers": {
    "milvus-sdk-code-helper": {
      "url": "http://localhost:8000"
    }
  }
}
For STDIO Transport
{
  "mcpServers": {
    "milvus-sdk-code-helper": {
      "command": "/PATH/TO/uv",
      "args": [
        "--directory",
        "/path/to/milvus-sdk-code-helper",
        "run",
        "examples/fastmcp_server.py",
        "--transport",
        "stdio",
        "--milvus_uri",
        "http://localhost:19530"
      ],
      "env": {
        "OPENAI_API_KEY": "YOUR_OPENAI_API_KEY"
      }
    }
  }
}

Usage with Claude Desktop

  1. Install Claude Desktop from https://claude.ai/download
  2. Open your Claude Desktop configuration:
    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
  3. Add the following configuration:
For HTTP Transport
{
  "mcpServers": {
    "milvus-sdk-code-helper": {
      "url": "http://localhost:8000/mcp"
    }
  }
}
For STDIO Transport
{
  "mcpServers": {
    "milvus-sdk-code-helper": {
      "command": "/PATH/TO/uv",
      "args": [
        "--directory",
        "/path/to/milvus-sdk-code-helper",
        "run",
        "examples/fastmcp_server.py",
        "--transport",
        "stdio",
        "--milvus_uri",
        "http://localhost:19530"
      ],
      "env": {
        "OPENAI_API_KEY": "YOUR_OPENAI_API_KEY"
      }
    }
  }
}
  1. Restart Claude Desktop

⚠️ Note: Remember to set the OPENAI_API_KEY environment variable when using STDIO transport.

Usage with Claude Code (VS Code)

Using CLI (Recommended)

# HTTP (recommended)
claude mcp add --transport http milvus-sdk-code-helper http://localhost:8000/mcp

# SSE
claude mcp add --transport sse milvus-sdk-code-helper http://localhost:8000

# STDIO
claude mcp add milvus-sdk-code-helper /ABS/PATH/TO/uv -- \
  --directory /ABS/PATH/TO/milvus-sdk-code-helper \
  run examples/fastmcp_server.py --transport stdio --milvus_uri http://localhost:19530

Manual Configuration

  • Global (~/.claude.json) – HTTP transport
{
  "mcpServers": {
    "milvus-sdk-code-helper": {
      "type": "http",
      "url": "http://localhost:8000/mcp"
    }
  }
}
  • Project (.mcp.json at project root) – STDIO transport
{
  "mcpServers": {
    "milvus-sdk-code-helper": {
      "type": "stdio",
      "command": "/ABS/PA

Environment Variables

OPENAI_API_KEYrequiredRequired for processing and embedding documentation for retrieval.

Configuration

claude_desktop_config.json
{
  "mcpServers": {
    "milvus-sdk-code-helper": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/milvus-sdk-code-helper",
        "run",
        "examples/fastmcp_server.py",
        "--transport",
        "stdio",
        "--milvus_uri",
        "http://localhost:19530"
      ],
      "env": {
        "OPENAI_API_KEY": "YOUR_OPENAI_API_KEY"
      }
    }
  }
}

Try it

Help me generate PyMilvus code to create a collection with HNSW index.
Convert this Milvus ORM code to the new MilvusClient syntax.
Translate this Python Milvus search snippet into a Go SDK implementation.
Retrieve the latest documentation for Milvus vector similarity search parameters.

Frequently Asked Questions

What are the key features of Milvus SDK Code Helper?

Automatically fetches and indexes the latest Milvus documentation version.. Supports PyMilvus code generation and ORM-to-client conversion.. Cross-language translation between Python, Java, and Go SDKs.. Weekly auto-refresh of documentation via a background scheduler..

What can I use Milvus SDK Code Helper for?

Developers needing to migrate legacy Milvus ORM code to the modern MilvusClient API.. Engineers building vector search applications who need quick access to SDK syntax and examples.. Translating existing Milvus implementation logic from Python to other languages like Java or Go..

How do I install Milvus SDK Code Helper?

Install Milvus SDK Code Helper by running: uv run src/mcp_pymilvus_code_generate_helper/fastmcp_server.py

What MCP clients work with Milvus SDK Code Helper?

Milvus SDK Code Helper works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Use Milvus SDK Code Helper with Conare

Manage MCP servers visually, upload persistent context, and never start from zero with Claude Code & Codex.

Try Free