milvus-mcp-server

milvus-mcp-server

3.1

If you are the rightful owner of milvus-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

This repository provides a setup to connect Anthropic's Claude to a Milvus vector database using the Model Context Protocol (MCP).

Claude-Compatible Milvus MCP Server

This repo provides everything needed to connect Anthropic's Claude (via Claude Desktop) to a Milvus vector database using the MCP (Model Context Protocol). It includes:

  • 🧠 A fully MCP-compatible FastMCP server
  • πŸ—ƒοΈ Milvus setup (via Docker)
  • πŸ› οΈ Shell script to launch the server correctly for Claude
  • βœ… Official Milvus tool names for Claude compatibility

πŸ“¦ Folder Structure

. β”œβ”€β”€ milvus-standalone/ # Contains Docker Compose for Milvus β”‚ β”œβ”€β”€ docker-compose.yml β”‚ └── config/ # Milvus etcd config files (if needed) β”œβ”€β”€ fastmcp/ β”‚ β”œβ”€β”€ milvus-server/ # Your custom MCP server files β”‚ β”‚ β”œβ”€β”€ server.py # MCP server code β”‚ β”‚ └── run_milvus_server.sh # Shell script to launch server for Claude β”‚ β”œβ”€β”€ .venv/ # uv-managed Python virtual env β”‚ └── pyproject.toml # FastMCP + dependencies β”œβ”€β”€ claude_desktop_config.json # Add this entry to Claude's config └── README.md

πŸš€ Setup Guide

  1. Clone the Repo bash Copy Edit git clone https://github.com/YOUR_USERNAME/milvus-mcp-server cd milvus-mcp-server

  2. Run Milvus (Docker) Ensure Docker is installed and running. cd milvus-standalone docker-compose up -d

  3. Install uv (if you haven’t yet) brew install uv

  4. Sync Python Environment Inside fastmcp/: cd fastmcp uv sync

  5. Test the Server uv run python milvus-server/server.py You should see logs like:

pgsql Copy Edit INFO: Connected to Milvus βœ… Server loaded and tools are registered

  1. Update Claude Config Update claude_desktop_config.json like so: } "milvus": { "command": "/full/path/to/run_milvus_server.sh", "args": [] }

Make sure to restart Claude after this.

  1. Ask Claude Try:

β€œCall the Milvus tool to list all collections.”

It should now connect and execute.

🧠 Tool Naming Rules (Critical!)

Claude only recognizes tools if they exactly match Milvus naming conventions. Do not rename tools. Use:

create_collection

list_collections

search

etc.

Use @mcp.tool(name="create_collection") β€” the name is case-sensitive.

πŸ§ͺ Debugging Tips

Ensure Milvus Docker is healthy (docker ps)

Check FastMCP server logs in the terminal

Add print statements in tools to debug

Make sure .venv and uv are used consistently

Don't use emojis or non-ASCII characters in tool descriptions

πŸ“Œ Next Steps

Add more tools (delete_collection, upsert, etc.)

Add test scripts (test_server.py)

Add GitHub Actions for validation

πŸ§ͺ Tests

To manually run tool tests, use the test_server_full.py or Claude Desktop interface.

🀝 Credits

  • Built by @TerrysPOV
  • Powered by FastMCP
  • Vectors stored in Milvus
  • Embeddings via OpenAI (text-embedding-ada-002)

πŸ“œ License

MIT