# OpenSearch Vector MCP

> OpenSearch Vector MCP lets your AI client treat OpenSearch like a true vector database. You can create k-NN indexes for cosine similarity and manage the entire embedding workflow through conversation. Run complex similarity searches, upsert document embeddings with metadata, or inspect index health without writing any `curl` commands.

## Overview
- **Category:** loved-by-devs
- **Price:** Free
- **Tags:** vector-database, k-nn, search-engine, embeddings, indexing

## Description

Need to run semantic searches on your knowledge base? This MCP connects OpenSearch directly to your AI client, turning it into a powerful vector store. You don't have to leave your chat window to perform complex database operations. Your agent can now execute k-Nearest Neighbors queries against any index, retrieving documents based on conceptual similarity rather than keywords.

It handles the full lifecycle of vector data. Need to start fresh? You can provision new k-NN indexes optimized for specific dimensions and similarities. Later, when you have content ready, your agent will upsert those vectors with associated metadata. The whole process—from checking an index's current count to running a deep similarity search—is accessible via natural conversation. By connecting this MCP through the Vinkius catalog, you get immediate access to robust vector management for your entire suite of AI applications.

## Tools

### search
Executes a K-Nearest Neighbors search to find documents conceptually similar to a provided vector embedding.

### list_indexes
Retrieves a list of all explicitly created indexes residing on the OpenSearch cluster.

### get_index
Fetches detailed mapping and settings for a specific OpenSearch index name.

### index_document
Inserts or updates a single vector document directly into the OpenSearch KNN index, preserving its metadata.

### delete_document
Removes an entire vector document from the designated OpenSearch embedding space using its ID.

### create_index
Sets up a new, native OpenSearch KNN index optimized for receiving and storing vector embeddings.

## Prompt Examples

**Prompt:** 
```
List all vector indexes in my OpenSearch cluster.
```

**Response:** 
```
Found 4 indexes. 1) 'product-embeddings' — 45,230 docs, green health, 768 dimensions. 2) 'support-tickets' — 12,800 docs, green, 1536 dimensions. 3) 'knowledge-base' — 3,450 docs, green, 384 dimensions. 4) 'test-index' — 50 docs, yellow, 768 dimensions. Want me to inspect the mapping of any of these?
```

**Prompt:** 
```
Find the 5 most similar documents to this embedding in the knowledge-base index.
```

**Response:** 
```
Top 5 results from 'knowledge-base' (cosine similarity): 1) 'API Rate Limiting Guide' — score: 0.94. 2) 'Authentication Best Practices' — score: 0.89. 3) 'Error Handling Documentation' — score: 0.87. 4) 'SDK Migration Guide v3' — score: 0.83. 5) 'Webhook Configuration' — score: 0.81. Want me to pull the full content of the top result?
```

**Prompt:** 
```
Create a new k-NN index called 'customer-feedback' with 1536 dimensions.
```

**Response:** 
```
Index 'customer-feedback' created successfully. Configuration: k-NN enabled, 1536 dimensions, cosine similarity, NMSLIB engine. The index is empty and ready for document ingestion. Want me to upsert a test document to verify the mapping?
```

## Capabilities

### Search similar documents
Run k-Nearest Neighbors queries against an index using a provided embedding array to find conceptually related data.

### Manage indexes
List all existing OpenSearch indexes and retrieve detailed configuration settings for any specific index.

### Create vector indexes
Provision new k-NN indexes, setting them up with required dimensions and cosine similarity optimization.

### Add document embeddings
Insert or update a single vector document directly into the index along with its metadata.

### Remove documents
Delete specific vector documents from the embedding space using their unique identifier.

## Use Cases

### Troubleshooting a knowledge base
A data team member needs to know which indexes exist before starting work. They simply ask the agent, and it uses list_indexes to provide an immediate overview of all available vector stores.

### Building a new feature store
An ML engineer wants to test embeddings for customer feedback. Instead of writing boilerplate code, they instruct the agent to use create_index to provision a dedicated 1536-dimensional k-NN index.

### Retrieving context in real time
A developer wants to answer a complex question using RAG. They pass the query embedding to the agent, which uses search to find the top 5 most similar documents from the production knowledge base index.

### Cleaning up stale data
The team needs to remove old user profile embeddings that are no longer relevant. They tell the agent to use delete_document, referencing the specific document IDs for a clean sweep of obsolete vectors.

## Benefits

- Run k-Nearest Neighbors searches without leaving your chat. Provide a dense float vector and let the MCP perform a similarity query using the search tool.
- Avoid manual dashboard navigation. Use list_indexes to see all cluster indexes, check their health status, and get document counts instantly.
- Build reliable RAG pipelines by provisioning new k-NN indexes with create_index, configuring specific dimensions for cosine similarity.
- Keep your data clean and current. Index a single vector document using index_document or delete outdated records with delete_document.
- Understand exactly what you're dealing with. Get detailed index settings and mappings for any cluster component by calling get_index.

## How It Works

The bottom line is that you manage and query your entire vector store through simple conversation, bypassing complex command-line interfaces.

1. Subscribe to this MCP and provide your OpenSearch Host, Username, and Password credentials.
2. Your AI client authenticates with the connection details, making all vector data operations available in a conversational context.
3. You instruct your agent to perform an action—like creating an index or running a search—and it executes the query against your live cluster.

## Frequently Asked Questions

**How do I start with OpenSearch Vector MCP?**
Start by subscribing to this MCP and providing your OpenSearch credentials. Once connected, you can immediately use list_indexes to see what indexes are available in your cluster.

**What is the difference between search and index_document using OpenSearch Vector MCP?**
The 'search' tool reads data: it takes an embedding and finds similar documents. The 'index_document' tool writes data: it takes an embedding and saves it to the cluster.

**Can I create a new index with OpenSearch Vector MCP?**
Yes, you use the create_index tool. You specify if you want k-NN enabled and what vector dimensions (like 768 or 1536) the index needs.

**How do I find out about an existing OpenSearch index?**
Use get_index. This tool retrieves the full mapping, settings, and engine configuration for any specific index you point it toward.

**Does OpenSearch Vector MCP only handle text searches?**
No, this MCP is specifically designed for vector data. It executes k-NN searches on dense float vectors (embeddings), making it ideal for semantic similarity tasks.