# Oracle Vector DB MCP

> Oracle Vector DB MCP connects your AI agent directly to Oracle Database 23ai's native vector capabilities. You can execute complex VECTOR_DISTANCE similarity searches, inspect schema details, and manage indexes—all from natural conversation. It lets ML engineers test RAG pipelines and data teams run advanced analytics without context switching.

## Overview
- **Category:** industry-titans
- **Price:** Free
- **Tags:** vector-database, sql, rag, machine-learning, database-administration, similarity-search

## Description

This MCP brings deep database functionality into your AI agent workflow. Your agent can run native Oracle 23ai VECTOR_DISTANCE queries using cosine or Euclidean metrics against any table containing vector columns. Need to know what's in the schema? You can list all tables and describe column types, making sure to spot those key VECTOR-enabled columns for embedding storage. If you need raw data, execute arbitrary SQL queries through ORDS for ad-hoc analysis. Beyond querying, your agent handles index management, allowing it to list specialized AI vector indexes (HNSW or IVF) and check overall table statistics. It's all integrated via Vinkius, giving you full control over complex database operations without writing a single line of boilerplate code.

## Tools

### list_tables
Lists every table available in the current Oracle schema for immediate reference.

### describe_table
Provides a detailed breakdown of a specific table's columns and their explicit data types, including VECTOR fields.

### execute_sql_query
Allows you to run any arbitrary SQL query against the Oracle runtime environment via ORDS.

### vector_search
Performs a vector similarity search using native Oracle 23ai VECTOR_DISTANCE on designated columns.

### list_vector_indexes
Retrieves a list of specialized AI vector indexes (HNSW, IVF) that have been created across your tables.

### table_stats
Gathers crucial data on table cardinality and optimizer statistics for performance planning.

### get_database_version
Returns the exact Oracle DB Runtime version banner, verifying compatibility with 23ai features.

## Prompt Examples

**Prompt:** 
```
Show me all tables in my schema that have VECTOR columns.
```

**Response:** 
```
Found 3 tables with VECTOR columns. 1) DOCUMENTS — columns: ID (NUMBER), CONTENT (CLOB), EMBEDDING (VECTOR(1536)), 82,400 rows. 2) PRODUCTS — columns: ID, NAME, FEATURES_VECTOR (VECTOR(768)), 5,200 rows. 3) FAQ_ENTRIES — columns: ID, QUESTION, ANSWER_EMBEDDING (VECTOR(384)), 1,100 rows. Want me to search one?
```

**Prompt:** 
```
Find the 5 most similar documents to this embedding using cosine distance.
```

**Response:** 
```
Top 5 results from DOCUMENTS table (cosine): 1) Doc #4521 — 'API Rate Limits Overview', distance: 0.034. 2) Doc #1892 — 'Authentication Flow Guide', distance: 0.089. 3) Doc #7301 — 'Error Handling Reference', distance: 0.112. 4) Doc #2244 — 'SDK Quickstart', distance: 0.145. 5) Doc #9010 — 'Webhook Setup', distance: 0.178.
```

**Prompt:** 
```
What version of Oracle is running and does it support vectors?
```

**Response:** 
```
Oracle Database 23ai (23.4.0.24.05) — Free tier. Vector features: fully supported. VECTOR data type: available. VECTOR_DISTANCE function: available. HNSW index support: yes. Your instance is ready for vector similarity search operations.
```

## Capabilities

### Run Vector Similarity Searches
Execute native Oracle 23ai VECTOR_DISTANCE queries using cosine or Euclidean metrics against specified vector columns.

### Inspect Database Schema
List accessible tables and describe column types, identifying which ones store vector embeddings.

### Execute Arbitrary SQL Queries
Run custom SQL queries against the Oracle runtime environment for general data retrieval and analysis.

### Manage Vector Indexes
List all instantiated AI vector search indexes, such as HNSW or IVF, across your database tables.

### Retrieve Database Statistics
Get table cardinality and optimizer statistics to plan for capacity and tune query performance.

## Use Cases

### Finding related documents in an enterprise knowledge base
A data scientist needs to find documentation related to 'API Rate Limits' from a massive set of records. They ask their agent, which uses `vector_search` with cosine distance, and immediately gets the top 5 most relevant document IDs and snippets.

### Auditing vector index setup on a new database
A DBA wants to verify if all necessary indexes are in place for a project. They instruct their agent to run `list_vector_indexes` and check the schema using `describe_table`, confirming both the structure and the indexing status.

### Running ad-hoc financial reports
A business analyst needs to quickly count records for a specific quarter that aren't covered by standard dashboards. They use the agent to run an `execute_sql_query` on the raw transaction table, getting immediate counts and aggregates.

### Verifying database feature compatibility
An ML engineer is setting up a new RAG pipeline and needs confidence that the target Oracle instance supports the latest features. They ask the agent to run `get_database_version` and check for vector support.

## Benefits

- You get to run advanced, native VECTOR_DISTANCE queries directly through your AI client. This means you can test complex retrieval-augmented generation (RAG) patterns without writing code or switching tools.
- Instead of manually checking SQL Developer, you simply ask the MCP to list tables and describe columns. It's instant visibility into which data sets are ready for embedding storage.
- Complex database operations—like running arbitrary queries using `execute_sql_query`—are handled conversationally. You just tell your agent what data you need, and it gets it.
- The MCP manages index overhead by letting you list specialized AI vector indexes (`list_vector_indexes`). This gives ML engineers clear visibility into the performance infrastructure.
- You can plan for growth using `table_stats`. Instead of guessing if a table is large enough, your agent checks its actual cardinality and optimizer statistics.

## How It Works

The bottom line is that you speak naturally to your AI client, and it translates those requests into complex, secure Oracle database actions.

1. Subscribe the MCP using your Oracle ORDS URL, Schema, Username, and Password credentials.
2. Connect your preferred AI client (like Cursor or Claude) to this MCP via Vinkius.
3. Instruct your agent to perform a task, such as 'Find documents similar to X' or 'List all tables with vector columns.' The tool executes the necessary database call.

## Frequently Asked Questions

**Does Oracle Vector DB MCP support all kinds of vector searches?**
Yes, it supports native Oracle 23ai VECTOR_DISTANCE queries using either cosine or Euclidean metrics for similarity searching. The `vector_search` tool handles this.

**What if I only need to see the column names in my database?**
You can use `list_tables` to get a list of all accessible tables, or run `describe_table` on a specific table name to get full details.

**How do I check if my Oracle instance is ready for vector data?**
You should first use the `get_database_version` tool. This verifies your runtime version and confirms compatibility with 23ai features like VECTOR_DISTANCE.

**Can I run queries that aren't related to vectors?**
Absolutely. The `execute_sql_query` tool lets you run any standard SQL query against the Oracle runtime, regardless of whether it involves vector data.

**Does listing indexes cost money or resources?**
The MCP only reads metadata when you call `list_vector_indexes`. It reports on existing HNSW and IVF indices without performing any write operations.