# SurrealDB MCP for AI Agents AI Agent Connect

> SurrealDB MCP for AI Agents. Connect your SurrealDB instance to any AI agent to execute SurrealQL queries, manage records, and monitor database health using natural language. Get rid of the constant tab-switching between your code editor and your database console.

## Overview
- **Category:** databases
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_z8y2X9S7Lg9neGU4YlezuYLhsuJbWmTxMe30Ga4Q/ai-agent-connect
- **Tags:** multi-model, surrealql, graph-database, relational-database, document-store, query-execution

## Description

Managing a multi-model database usually means jumping between your code editor and a separate database management tool, constantly copying and pasting queries to see if they actually work. This SurrealDB MCP changes that by letting your AI agent handle the heavy lifting. You can ask your agent to find specific records, run complex SurrealQL statements, or check the health of your instance directly through your chat interface. It is about making the data layer feel like a conversation rather than a manual chore. Since Vinkius hosts this Connector, you can get it running in your favorite client in minutes. Whether you are debugging a tricky join or just want to see if a recent update hit the right table, you just tell your agent what you need and it does the work. You get immediate feedback on your data state without the friction of manual execution. This connection turns your database into an active part of your workspace, letting you focus on building features instead of babysitting records.

## Tools

### delete_all
Remove every record from a target table. Use this for clearing out test data or resetting a specific category.

### import_sql
Bring in SurrealQL queries from external files. This makes it easy to run pre-written scripts against your live data.

### update_all
Update all records in a table. This allows for broad changes to your data across an entire table.

### get_version
Check the current version of your SurrealDB instance. This helps you keep track of your database software updates.

### create_specific_record
Create a new record with a specific ID. This helps when you need to insert precise data into your tables.

### delete_record
Remove a single specific record from your database. This is the standard way to clean up individual entries.

### export_data
Move your data out of the database into a portable format. It is useful for backups or sharing datasets with other teams.

### get_health
Check the current health of your SurrealDB instance. Use this to ensure your database is online and responding correctly.

### modify_all
Update every record in a table using a merge operation. This is great for applying bulk changes across a whole dataset.

### modify_record
Update a specific record using a merge operation. It is the go-to way to change individual entries without overwriting the whole thing.

### select_all
Grab every record from a specific table. Use this when you need to see the full scope of a dataset at once.

### create_record
Add a new record to a table with a random ID. This is perfect for quick data entry where the specific ID does not matter.

### execute_sql
Run any raw SurrealQL statement with optional variables. This gives your agent full power to perform complex queries and logic.

### get_status
Check the status of the SurrealDB web server. Use this to verify that your instance is reachable and running.

### select_record
Retrieve a specific record from your database. Use this when you need to pull details for one particular entry.

### update_record
Update a specific record in your database. This is the standard way to modify individual data points.

## Prompt Examples

**Prompt:** 
```
Can you check if my database is healthy and tell me what version it's running?
```

**Response:** 
```
I've checked your SurrealDB instance. The web server is healthy (200 OK) and you're currently running version 2.1.0.
```

**Prompt:** 
```
Show me all the records in the 'products' table.
```

**Response:** 
```
I've retrieved the records from the 'products' table. Here are the items:

* **Product:01** (Price: $20)
* **Product:02** (Price: $45)
* **Product:03** (Price: $10)

Would you like to see the full details for any of these?
```

**Prompt:** 
```
Find all posts that are marked as 'published'.
```

**Response:** 
```
Running the SurrealDB query now... I found 12 posts with a 'published' status. The most recent one is **post:mcp-guide** created on 2023-10-27.
```

## Capabilities

### Run raw SurrealQL queries
Execute complex queries and logic directly through your AI client.

### Create and update records
Add new entries or modify existing ones using natural language instructions.

### Batch delete or modify data
Perform bulk operations to clear tables or update multiple records at once.

### Export and import data sets
Move information in and out of your instance to handle migrations or backups.

### Monitor database health
Check your web server status and health metrics to ensure your instance is online.

### Query specific records
Retrieve individual data points or full tables for quick inspection.

### Check database versioning
Verify your current SurrealDB version to ensure compatibility with your scripts.

## Use Cases

### Verifying published content
A developer needs to see all published posts. Ask your agent to run a query to find posts with a published status. It returns the count and the most recent entry instantly.

### Clearing test data
A data engineer needs to clear a test table. Use delete_all to wipe a table of dummy records before starting a new test cycle.

### Quick business metric checks
A product manager wants to see user counts. Ask your agent to select_all from the users table to get a quick count of active accounts.

### Deployment health checks
A developer needs to check if the database is down. Use get_status to quickly verify if the web server is responding during a deployment.

## Benefits

- Stop switching tabs between your code editor and the SurrealDB console to run queries.
- Run complex SurrealQL statements using execute_sql without manual copy-pasting.
- Manage your data at scale by using select_all or delete_all to clear or view tables.
- Perform bulk updates across your entire dataset using modify_all and update_all.
- Keep your database online with quick health checks via get_health and get_status.
- Move data easily between environments using import_sql and export_data.

## How It Works

The bottom line is you get a direct line to your SurrealDB instance from your AI chat.

1. Subscribe to the SurrealDB MCP on the Vinkius marketplace.
2. Enter your SurrealDB URL and credentials, including your Namespace, Database, and Auth.
3. Start asking your agent to perform tasks like finding active users or checking server status.

## Frequently Asked Questions

**Can I use the SurrealDB MCP to run custom SurrealQL queries?**
Yes, you can. Your agent can execute raw SurrealQL statements directly, allowing you to perform complex queries and logic using natural language.

**How does the SurrealDB MCP help with data migrations?**
It makes moving data much easier. You can use the import and export tools to move information in and out of your instance without manual script handling.

**Can I use SurrealDB MCP to check if my database is online?**
Yes, you can. The Connector includes tools to check the web server status and overall health metrics so you can verify your instance is up and running.

**Is the SurrealDB MCP good for managing large amounts of data?**
It is great for bulk actions. You can use specific tools to update or delete all records in a table at once, making it efficient for large-scale management.

**What kind of databases does the SurrealDB MCP work with?**
It is designed specifically for SurrealDB, which is a multi-model database supporting graph, relational, and document data types.

**Can I use the SurrealDB MCP to update specific records?**
Yes, you can. You can ask your agent to modify a single record or update a whole table using merge operations, all through your chat interface.

**Can I run custom SurrealQL queries with variables?**
Yes! Use the `execute_sql` tool. You can provide the raw SQL string and an optional JSON object of variables to be used in the query.

**How do I check if my SurrealDB instance is online and healthy?**
You can use the `get_status` tool to check the web server status or `get_health` to verify that both the server and the storage engine are functioning correctly.

**Is it possible to delete all records from a specific table at once?**
Yes, the `delete_all` tool allows you to remove all records from a specified table in a single operation.