How to Use the Elasticsearch Vector MCP in OpenAI Agents SDK
Run production-grade vector search on Elasticsearch with your OpenAI Agent, backed by built-in safety guardrails.
Works with every AI agent you already use
…and any MCP-compatible client
Connect Elasticsearch Vector MCP to OpenAI Agents SDK
Create your Vinkius account to connect Elasticsearch Vector to OpenAI Agents SDK and route execution through our secure gateway. The platform manages server hosting, runtime updates, and security layers. Configuration requires no manual server provisioning.
Manage Elasticsearch Indexes From Your Agent
Your agent can now directly manage vector search indexes. Use `create_index` to set up a new `dense_vector` index with specific mappings and dimensions, right from your Python code. No more manual setup in Kibana. Before you index, your agent can check what's already there with `list_indexes` or get the details of a specific one using `get_index`. This gives your agent the context it needs to avoid errors and manage its own data environment. It's a solid way to build autonomous systems that handle their own setup.
Index and Search with the OpenAI Agents SDK
The `index_document` tool lets your agent add new documents with their corresponding vectors to any index. Your code prepares the data, and the agent handles the transaction with Elasticsearch. You can also remove specific entries using `delete_document` by its ID. The main event is the `search` tool. Your agent feeds it a query vector, and it runs a k-NN search to find the most similar documents. Since you're using the OpenAI Agents SDK, you can build guardrails around this, ensuring the agent only searches approved indexes or validates results before acting on them. This MCP Server makes it happen.
Build Self-Contained Search Applications
Connect this MCP Server and your agent can handle the entire lifecycle of a vector search task. It can check for an index, create it if missing, populate it with documents, and then run searches against it. This isn't just about running queries. It's about building agents that can maintain their own knowledge bases inside Elasticsearch. The agent becomes responsible for the data it uses, which is a big step up from just being a stateless tool-caller.
Set up Elasticsearch Vector MCP in OpenAI Agents SDK
Prerequisites
- Python 3.10+ installed
-
openai-agentspackage (pip install openai-agents) - Active Vinkius subscription with a valid endpoint token
- 1
Install the SDK
Run
pip install openai-agentsto install the OpenAI Agents SDK. The MCP integration is built-in — no extra dependencies needed. - 2
Connect via SSE transport
Use
MCPServerSsewith your Vinkius endpoint URL. Replace[YOUR_TOKEN_HERE]with your token from cloud.vinkius.com. The SDK auto-discovers all Elasticsearch Vector tools at runtime. - 3
Create your Agent
Pass the MCP to
Agent(mcp_servers=[server]). The agent receives Elasticsearch Vector tools as native definitions — JSON schemas resolve automatically. - 4
Run the agent
Call
Runner.run(agent, prompt)to execute. The agent invokes the appropriate Elasticsearch Vector tools and returns structured results. Copy the full example on the right to get started.
import asyncio
from agents import Agent, Runner
from agents.mcp import MCPServerSse
async def main():
async with MCPServerSse(
url="https://edge.vinkius.com/[YOUR_TOKEN_HERE]/mcp"
) as server:
agent = Agent(
name="Elasticsearch Vector Agent",
instructions="You have access to Elasticsearch Vector tools.",
mcp_servers=[server],
)
result = await Runner.run(agent, "List recent transactions")
print(result.final_output)
asyncio.run(main()) Independent Platform Disclaimer: Vinkius is an independent platform and is not affiliated with, endorsed by, sponsored by, verified by, or otherwise authorized by Elasticsearch Vector. 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 Elasticsearch Vector MCP in OpenAI Agents SDK
Use it with your favorite AI tools
Connect this server to Cursor, Claude, VS Code, and more.
Start using the Elasticsearch Vector MCP today
We host it, we monitor it, we maintain it. You just paste one token.