# Convex MCP for AI Agents AI Agent Connect

> Convex lets you connect your backend directly to your AI agent. Instead of switching tabs to check your database, you can just tell your agent to fetch records, update user states, or trigger external APIs. It handles the communication with your Convex deployment, making your data live and accessible for any task your agent needs to perform.

## Overview
- **Category:** loved-by-devs
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_MADGSG1GwcjX2nZFJX7QdDYmcBCtd1WoRLCUHsG9/ai-agent-connect
- **Tags:** real-time-database, serverless-functions, typescript, backend-as-a-service, acid-transactions

## Description

This Convex MCP connects your Convex deployment to any AI agent so you can manage your application's data and logic through natural conversation. Managing a real-time backend usually means jumping between your code editor, your database dashboard, and your terminal. If you're a developer or a product lead, you know the friction of manually checking a user's subscription status or running a series of updates to fix a data inconsistency. This connector changes that by putting your live application state right into your chat interface. You can ask your agent to pull a list of recent signups, modify a specific record to fix a bug, or fire off a heavy background task without ever opening a new browser tab. It bridges the gap between your live application state and your conversation with the AI. Because it's hosted on the Vinkius marketplace, you get a reliable way to link your backend to any compatible client you already use. It's about moving from how do I get this data to what does this data mean by making your backend accessible through natural language.

## Tools

### run_mutation
Use this to modify your database records or update application state with full ACID guarantees. It ensures your data changes are reliable and consistent.

### run_query
Fetch specific documents or lists from your Convex tables to see the current state of your data. This helps you get the exact information you need instantly.

### run_function
Call a specific Convex function using its URL identifier for targeted logic execution. It is the best way to trigger specific backend behaviors.

### run_action
Trigger side effects like sending notifications or hitting third-party APIs without needing to be transactional. This is perfect for handling external interactions.

## Prompt Examples

**Prompt:** 
```
Can you show me the last 5 users who signed up?
```

**Response:** 
```
I've pulled the latest signups from your Convex table. Here they are:

| Name | Email | Signup Time |
| :--- | :--- | :--- |
| Alice | alice@example.com | 2024-05-20 10:00 |
| Bob | bob@example.com | 2024-05-20 10:05 |
| Charlie | charlie@example.com | 2024-05-20 10:10 |
| David | david@example.com | 2024-05-20 10:15 |
| Eve | eve@example.com | 2024-05-20 10:20 |
```

**Prompt:** 
```
Update the status of the user with ID 'user_123' to 'active'.
```

**Response:** 
```
I've updated that record. The user 'user_123' is now marked as active in your database. ✅
```

**Prompt:** 
```
Trigger the 'send_welcome_packet' action for user 'user_456'.
```

**Response:** 
```
I've triggered the action. The welcome packet is being sent to 'user_456' via your external service.
```

## Capabilities

### Fetch live records
Retrieve documents and state from your Convex tables instantly.

### Update database records
Modify data with full ACID guarantees directly through your chat.

### Trigger external APIs
Call Convex actions to handle side effects like sending emails or hitting third-party endpoints.

### Run cloud functions
Execute specific backend logic using standard URL identifiers.

### Execute data migrations
Run updates across your database to keep your records in sync.

## Use Cases

### Fixing a broken user profile
A support agent notices a user's account is locked. They ask the AI to find the user by email and use run_mutation to unlock it.

### Checking live signups
A product manager wants to see how many users joined in the last hour. They ask the agent to use run_query to pull the latest records.

### Triggering a welcome email
A developer needs to manually trigger a welcome flow for a VIP user. They tell the agent to use run_action to hit the email service.

### Running a data migration
A dev needs to update a status field for 500 users. They describe the logic to the agent and use run_mutation to execute the change.

## Benefits

- Stop context switching between your IDE and your database dashboard by using run_query to see live data instantly.
- Fix data inconsistencies quickly by using run_mutation to apply changes with full ACID guarantees directly from your chat.
- Trigger complex side effects like sending emails or hitting third-party APIs using run_action without writing extra glue code.
- Run specific logic flows by calling run_function with a URL identifier for maximum flexibility in your backend calls.
- Let your agent handle repetitive data checks so you can focus on high-level product decisions instead of manual lookups.

## How It Works

The bottom line is that you get a direct line from your AI client to your live backend data and logic.

1. Subscribe to this Connector on the Vinkius marketplace.
2. Enter your Convex Deployment URL and Access Key.
3. Ask your agent to query or mutate your data.

## Frequently Asked Questions

**Can I use the Convex MCP to update my database?**
Yes, you can use it to modify records directly through your agent. It handles mutations with full ACID guarantees.

**Does the Convex MCP work with my existing deployment?**
It connects directly to your live Convex deployment using your deployment URL and access key.

**Can I use it to trigger external APIs?**
Yes, the Connector allows your agent to call Convex actions, which is the standard way to handle side effects like hitting third-party APIs.

**Is it safe to let an AI agent modify my data?**
You control the access. The agent only performs the actions you authorize through your natural language requests.

**Does the Convex MCP support complex queries?**
It supports both standard queries for fetching data and functions for more complex logic, making it very flexible for different backend needs.

**How do I connect my Convex backend to my AI client?**
You just need your Convex Deployment URL and an optional Access Key to link it through the Vinkius marketplace.

**What is the difference between run_query and run_mutation?**
Use `run_query` for read-only operations that fetch data. Use `run_mutation` when you need to write, update, or delete data transactionally in your database.

**Can I call external APIs using this server?**
Yes, by using the `run_action` tool. Actions in Convex are designed for side effects like calling third-party APIs or performing long-running tasks.

**How do I reference functions in subdirectories?**
You can use `run_query` with colon notation (e.g., 'folder/file:function') or use `run_function` which accepts URL-style identifiers with slashes.