milvus_code_generatorLABSCO SUMMARY
SDK answers grounded in current docs, not stale training data.
The reason this exists is version drift: Milvus APIs move, and a model writing from memory produces code that no longer runs. Indexing the live documentation and retrieving against it is the fix, and the translation tool extends the same index to the other language SDKs.
What it is
A retrieval server for Milvus SDK code. It indexes the current Milvus documentation into a Milvus instance and answers code questions from that index rather than from memory.
What you get
- milvus_code_generator writes or supplies sample PyMilvus code from a plain-language request
- orm_client_code_convertor converts between the ORM style and the client style for a list of Milvus APIs
- milvus_code_translator translates Milvus code between Python, Java, Go, C#, Node and REST
- The documentation index refreshes on a background weekly schedule and picks up the newest documentation version automatically
- A lightweight start-up mode skips document synchronisation once the index is populated, so restarts are immediate
- Runs over HTTP, server-sent events or stdio
Requirements
Python, plus a running Milvus instance — local or remote — to hold the document index, with its token if it is secured. Document processing and embedding generation call OpenAI, so an API key is needed. A container image is provided.
Setup effort
Follow the published steps — uv run src/mcp_pymilvus_code_generate_helper/fastmcp_server.py
USE CASES
Writing a Milvus query you do not write often
Describe what you want in plain language and get sample code retrieved from the current documentation.
Migrating off the ORM style
Hand it the list of APIs you use and get the client-style equivalents back.
Porting a working Python example to another SDK
Translate the same operations into Java, Go, C#, Node or REST rather than rewriting them by hand.
Making sure the sample matches your version
Answers come from the indexed documentation, which refreshes on a schedule and tracks the newest version.
3 tools
Listed in project docs. Your client may show a different list.
orm_client_code_convertormilvus_code_translatorBEFORE YOU INSTALL
What to know first
Tools you get
3 tools named in the project's documentation. Every STDIO config in the documentation starts the lightweight server, which skips document sync; run the full server first to populate Milvus, or the tools search an empty index.
Requires
- Python 3.10 or later
- A running Milvus instance, local or remote
- uv
- OPENAI_API_KEY in your environment
INSTALLATION
Connect your client
Server setup
git clone https://github.com/Shawnzheng011019/milvus-sdk-code-helper
cd milvus-sdk-code-helperHave a running Milvus instance and uv installed
First Time Setup (with Document Update)
uv run src/mcp_pymilvus_code_generate_helper/fastmcp_server.pySubsequent Runs (Lightweight Mode) — after the first run has filled the index
uv run examples/fastmcp_server.pyMCP Clients
Cursor — HTTP
{
"mcpServers": {
"milvus-sdk-code-helper": {
"url": "http://localhost:8000/mcp"
}
}
}Cursor — SSE
{
"mcpServers": {
"milvus-sdk-code-helper": {
"url": "http://localhost:8000"
}
}
}Cursor — stdio, Claude Desktop — stdio
{
"mcpServers": {
"milvus-sdk-code-helper": {
"command": "<YOUR_PATH_TO_UV>",
"args": [
"--directory",
"<YOUR_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>"
}
}
}
}Claude Code — CLI
claude mcp add --transport http milvus-sdk-code-helper http://localhost:8000/mcpClaude Code — global
{
"mcpServers": {
"milvus-sdk-code-helper": {
"type": "http",
"url": "http://localhost:8000/mcp"
}
}
}Other routes
Docker
docker build -t milvus-code-helper .
docker run -p 8000:8000 -e OPENAI_API_KEY=<YOUR_OPENAI_API_KEY> -e MILVUS_URI=http://<YOUR_MILVUS_HOST>:19530 -e MILVUS_TOKEN=<YOUR_MILVUS_TOKEN> milvus-code-helper