# Supabase Vector MCP for AI Agents AI Agent Connect

> Supabase Vector lets your AI client talk directly to your pgvector database. You can perform semantic similarity searches, manage multi-dimensional embeddings, and run standard relational queries without switching tabs. It handles the heavy lifting of RAG infrastructure, letting your agent find the right data based on meaning rather than just keywords.

## Overview
- **Category:** loved-by-devs
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_r2cwX4M1GouGmm6VnqY7CUQyTiHKovu2fp0L81jN/ai-agent-connect
- **Tags:** pgvector, embeddings, semantic-search, machine-learning, vector-storage

## Description

Managing vector embeddings and relational data usually means jumping between a database console, an embedding provider, and your code. This Connector changes that by letting your AI client act as a direct administrator for your database instance. Instead of writing complex queries or manually inspecting tables to see if your embeddings are working, you simply ask your agent to find the most similar documents, insert new records, or check the current schema. It connects your raw data to your conversational workflows, making it much easier to build and debug Retrieval-Augmented Generation systems. You test new distance metrics or clear out old test data through a simple chat interface. By connecting this through the Vinkius catalog, you get a unified way to manage your vector storage and standard PostgreSQL tables in one place. It's about getting your data into your agent's hands without the friction of manual database management. You no longer have to worry about the nuances of database syntax or the headache of managing multiple connection strings. This setup lets you focus on the quality of your results rather than the mechanics of the database. It is the most direct path to getting your vector data working within your everyday workflow.

## Tools

### delete_table_rows
Removes specific rows from a table based on a column value.

### get_table_row
Fetches a single row from a table when you provide a specific column value.

### insert_table_rows
Adds new data to a table using a JSON array of objects.

### list_tables
Shows a list of all available tables in your Supabase project.

### match_vectors
Runs a similarity search using a vector RPC and an embedding array.

### query_table_rows
Pulls rows from a table with optional filters or limits.

### call_postgres_function
Executes a custom Postgres RPC function with your specific parameters.

## Prompt Examples

**Prompt:** 
```
Find the top 5 most similar documents to 'How do I reset my password?' using my match_docs function.
```

**Response:** 
```
### Similarity Search Results

I've queried the `match_docs` RPC for your request. Here are the top 5 matches based on your embedding:

| Rank | Document ID | Similarity Score | Snippet |
|------|-------------|------------------|---------|
| 1    | #42         | 0.92             | To reset your password, go to the login page... |
| 2    | #11         | 0.89             | Password reset links are sent via email... |
| 3    | #88         | 0.85             | If you lose access to your account... |
| 4    | #22         | 0.82             | Security questions can be used for resets... |
| 5    | #54         | 0.79             | Our support team can help if links fail... |

**Summary:** The top result is a high-confidence match for standard password recovery instructions.
```

**Prompt:** 
```
List all my tables and then show me the first 5 rows of the 'user_profiles' table.
```

**Response:** 
```
### Database Schema Overview

I've scanned your Supabase project. Here are your active tables:
- `documents_embeddings`
- `user_profiles`
- `audit_logs`
- `test_metadata`

### User Profiles (Top 5)

| User ID | Username | Join Date | Status |
|---------|----------|-----------|--------|
| 1001     | jdoe_99  | 2024-01-12| Active |
| 1002     | smith_r  | 2024-01-15| Active |
| 1003     | walker_b | 2024-02-01| Pending|
| 1004     | lee_x    | 2024-02-05| Active |
| 1005     | garcia_m | 2024-02-10| Active |
```

**Prompt:** 
```
Delete all the rows in the 'temp_embeddings' table where the status is 'expired'.
```

**Response:** 
```
### Data Cleanup Operation

I've executed the deletion query on the `temp_embeddings` table.

**Action:** Removed rows where `status = 'expired'`.
**Result:** Successfully removed 42 legacy records.
**Status:** Table `temp_embeddings` is now updated and cleared of expired entries.
```

## Capabilities

### Perform similarity searches
Use match_vectors to find the most relevant data based on semantic meaning.

### List all database tables
Use list_tables to see every table available in your Supabase project.

### Insert new data rows
Use insert_table_rows to add new records to your database using a JSON array.

### Query specific table data
Use query_table_rows to pull specific data from your tables with filters.

### Run custom Postgres functions
Use call_postgres_function to execute custom logic already stored in your backend.

### Delete specific rows
Use delete_table_rows to remove specific entries from your tables.

### Retrieve individual records
Use get_table_row to pull a single record when you have a specific ID or value.

## Use Cases

### Debugging RAG
An engineer asks the agent to find the top 3 matches for a query and then uses call_postgres_function to trigger a review.

### Data Cleanup
A developer tells the agent to find all rows in 'test_embeddings' and use delete_table_rows to clear out the junk.

### Schema Exploration
A new team member asks the agent to list all tables and then query the 'documents' table to see the current structure.

### Rapid Prototyping
A researcher inserts a new batch of embeddings using insert_table_rows to see how they affect search results immediately.

## Benefits

- Run similarity searches instantly using match_vectors to see how well your embeddings actually capture meaning.
- Manage your database schema easily with list_tables so your agent always knows what data is available to it.
- Update your records on the fly with insert_table_rows and delete_table_rows to keep your training data fresh.
- Execute complex logic via call_postgres_function without having to write and deploy new middleware for every task.
- Get specific data points with get_table_row and query_table_rows to verify your database state in seconds.

## How It Works

The bottom line is that you get a conversational interface for your entire Supabase Vector database.

1. Add your Supabase URL and Service Role Key to your configuration.
2. Connect the Connector to your favorite client like Claude or Cursor.
3. Ask your agent to perform tasks like finding similar items or updating the embeddings table.

## Frequently Asked Questions

**Can the Supabase Vector MCP help me build a RAG system?**
Yes, it connects your AI client directly to your vector database, making it easy to perform similarity searches and retrieve relevant context for your agent.

**Does the Supabase Vector MCP allow me to delete data?**
It can delete specific rows from your tables based on a value you provide, which is great for cleaning up test data or removing old records.

**Can I run my own custom functions with the Supabase Vector MCP?**
Yes, you can call any Postgres RPC functions you've already configured in your Supabase backend directly through your AI client.

**Is this Connector only for vector searches?**
No, while it's great for pgvector similarity searches, it also lets your agent perform standard relational queries and manage your regular database tables.

**Do I need to know SQL to use the Supabase Vector MCP?**
You don't need to write SQL; you just tell your AI client what you want to do in plain English, and it uses the Connector tools to execute the commands.

**How does the Supabase Vector MCP handle my database security?**
It uses your service role key to operate as an administrator, so it can bypass row-level security to perform the actions you request.

**Are embedding arrays processed efficiently during intensive vector similarity matching?**
The integration specifically manages large semantic arrays seamlessly by calling lightweight Postgres RPC configurations locally natively internally securely.

**How is risk managed securely when manipulating and clearing root analytical vectors?**
Executing `delete_table_rows` operates systematically relying inherently on exactly structured string conditions implicitly naturally precisely eliminating ambiguity securely effectively actively strictly smoothly securely precisely correctly reliably locally dynamically successfully effortlessly intelligently gracefully elegantly safely accurately directly comprehensively natively.

**Which distance metrics does the vector search support?**
pgvector supports cosine similarity, inner product, and L2 (Euclidean) distance. The metric used depends on how your RPC function and index are configured in PostgreSQL — the AI passes arguments accordingly.