How to Use the Milvus (Open-Source Vector Database) MCP in LangChain
Build LangChain chains that run ANN vector searches and manage Milvus collections via this MCP server.
Works with every AI agent you already use
…and any MCP-compatible client
Connect Milvus (Open-Source Vector Database) MCP to LangChain
Create your Vinkius account to connect Milvus (Open-Source Vector Database) to LangChain and route execution through our secure gateway. The platform manages server hosting, runtime updates, and security layers. Configuration requires no manual server provisioning.
Let your LangChain agents search Milvus vectors directly
The `search_vectors` tool lets your LangChain agent run fast similarity lookups by dumping raw embedding arrays straight into your Milvus collections. This isn't some basic search. It's a dynamic step in a ReAct loop where the agent reads the output to figure out what to fetch next. If the vector search returns garbage confidence scores, the agent pivots on the spot. It uses `query_entities` to apply scalar filters or falls back to a broader lookup, keeping your chain moving without manual intervention.
Inspect and manage collection schemas in any chain
The `describe_collection` tool exposes the exact schema definitions and index configurations of your Milvus setup to your LangChain pipeline. Your agent reads this structure to understand what fields are available before formatting complex scalar queries. To avoid blowing up on empty collections, the agent can call `get_collection_stats` to check row counts first. This keeps your LangChain run from crashing when dealing with newly initialized or cold vector stores.
Multi-step cleanups using the Milvus MCP Server
The `delete_entities` tool gives your LangChain agent the keys to prune stale vectors using their primary keys. When an agent identifies outdated records during a processing chain, it targets them for removal instantly. Before pulling the trigger, the agent uses `get_entities` to inspect the exact payload first. This safety loop ensures your LangChain workflow only deletes the precise records you intended to drop.
Set up Milvus (Open-Source Vector Database) MCP in LangChain
Prerequisites
- Python 3.10+ installed
-
langchain-mcp-adapters+langgraphpackages - Active Vinkius subscription with a valid endpoint token
- 1
Install dependencies
Run
pip install langchain-mcp-adapters langgraph langchain-openai. The MCP adapters package converts MCP tools into native LangChainBaseToolobjects. - 2
Connect via HTTP transport
Use
MultiServerMCPClientwith"transport": "http"pointing to your Vinkius endpoint. Replace[YOUR_TOKEN_HERE]with your token from cloud.vinkius.com. - 3
Create a ReAct agent
Pass the discovered tools to
create_react_agent()from LangGraph. The agent automatically routes Milvus (Open-Source Vector Database) tool calls through the MCP protocol. - 4
Run with any LLM
Swap
ChatOpenAIforChatAnthropic,ChatGoogleGenerativeAI, or any LangChain-compatible model. The MCP tools work identically across all providers.
from langchain_mcp_adapters.client import MultiServerMCPClient
from langgraph.prebuilt import create_react_agent
from langchain_openai import ChatOpenAI
async with MultiServerMCPClient({
"milvus-open-source-vector-database-mcp": {
"transport": "http",
"url": "https://edge.vinkius.com/[YOUR_TOKEN_HERE]/mcp",
}
}) as client:
tools = client.get_tools()
agent = create_react_agent(
ChatOpenAI(model="gpt-4o"),
tools,
)
result = await agent.ainvoke({
"messages": "List recent Milvus (Open-Source Vector Database) transactions"
})
print(result["messages"][-1].content) Independent Platform Disclaimer: Vinkius is an independent platform and is not affiliated with, endorsed by, sponsored by, verified by, or otherwise authorized by Milvus. All third-party trademarks, logos, and brand names are the property of their respective owners. Their use on this website is strictly for informational purposes to identify service compatibility and interoperability.
Why Choose Vinkius
Vinkius connects your tools to AI with real-time monitoring and automatic cost savings — all from one dashboard.
Real-time monitoring
Live
visibility into every interaction
Connect your favorite tools to your AI and see exactly what's happening — every request, every response, in real time.
Built-in savings
60%
lower AI costs
Vinkius compresses data between your apps and your AI automatically. Lower bills every month — no configuration required.
Single dashboard
One
place for every integration
Every tool your AI connects to, managed from a single screen. One account, complete control.
Common questions about Milvus (Open-Source Vector Database) MCP in LangChain
Use it with your favorite AI tools
Connect this server to Cursor, Claude, VS Code, and more.
Start using the Milvus (Open-Source Vector Database) MCP today
We host it, we monitor it, we maintain it. You just paste one token.