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.


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
- Go to
Cursor>Settings>MCP - Click on the
+ Add New Global MCP Serverbutton - 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
- Install Claude Desktop from https://claude.ai/download
- Open your Claude Desktop configuration:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
- 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"
}
}
}
}
- Restart Claude Desktop
⚠️ Note: Remember to set the
OPENAI_API_KEYenvironment 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.jsonat 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
{
"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"
}
}
}
}